Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Release v1.31.0 - #minor #503

Merged
merged 20 commits into from
Jan 28, 2025
Merged

New Release v1.31.0 - #minor #503

merged 20 commits into from
Jan 28, 2025

Conversation

adk-swisstopo
Copy link
Member

The main purpose of this new release it to allow the new authentication method to be used in INT and PROD for PB-1284. This also includes changes required for PB-1372 "allow GET range request to check external asset href".

msom and others added 14 commits January 23, 2025 14:49
Add content length check when validating external asset url.
Add test cases.
…rnal_asset_href

using GET range request instead of HEAD to check external asset reach…
Django is configured to use CSRF mitigation tokens. This only works for clients
that are web browsers. Typical API clients are not web browsers, do not keep
track of cookies and fail CSRF mitigation checks. The old token authentication
method works around that by disabling CSRF mitigation when that authentication
method is used. With this change, we do the same for the new token authentication
method.

In PB-1009 we implemented the new authentication method for the Admin UI.
This change does the same for the API endpoints and add tests exercising it.

The API endpoints are rest_framework views that rely on authentication
methods defined by the REST framework which is different from the Admin UI
authentication plumbing. To support both, we need to have modules for both
even though they basically do the same thing.

Specifically:
* create `api_gateway_authentication` as `rest_framework` authentication module
* create `api_gateway_middleware` as generic Django authentication module (for Admin UI)
* abstract the common parts into a new `api_gateway` module
* configure both authentication modules in the debug build
* add tests exercising a PUT API endpoint for both v0.9 and v1, including CSRF checks

This is all flag-guarded behind FEATURE_AUTH_ENABLE_APIGW.
PB-1366: make new auth work for write requests.
Add forecast properties to search filter for GET and POST. Refactor
forecast:variable and forecast:perturbed descriptions into schema properties to
be reused.
Add filters for forecast properties to search endpoints.
Can filter for forecast_reference_datetime either by exact value or by a range.
Decided to remove the forecast parameters because the variable name differs to
the post variable names (using underscore instead of colon) and colons need
url encoding.
Decided to remove the forecast filtering options from the GET /search request
due to colons in the parameter names.
Also fixed the POST request body to actually use the parameters that contain a
colon.
Fix code comments.
Refactor create sample data names.
Add index for the item forecast properties as they can be used as filters in
the item search.
Move models file into folder /models and rename file to general.py.
Fix all imports that referenced the models file.
@github-actions github-actions bot changed the title #minor New Release v1.31.0 - #minor Jan 27, 2025
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can existing user still access the admin page and API the way they use to do it ? Or do they need new credentials ? If they can't access anymore admin page and/or API with their current credentials I would create a major release (add #major in the PR title) and we need to do some coordination for the deployment.

Move collection related models into separate file.
Move item related models into separate file.
Fix import statements across all files.
@adk-swisstopo
Copy link
Member Author

Can existing user still access the admin page and API the way they use to do it ? Or do they need new credentials ? If they can't access anymore admin page and/or API with their current credentials I would create a major release (add #major in the PR title) and we need to do some coordination for the deployment.

The changes in this PR do not actually change the way authentication works. That will be done when the FEATURE_AUTH_ENABLE_APIGW flag is enabled (which happens at Kubernetes level). Even then, the old authentication mechanism keep working in the same way. Hence I believe this qualifies as a minor release.

This also improves the existing documentation:
* explain what session authentication is for;
* point to relevant RFC for Basic authentication;
* be more explicit about the old Token authentication;
* add link from /get-token description to the Authentication section.
The [GitGuardian Bearer token detector](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/bearer_token)
does not like it when we add a realistic-looking token. The documentation
shows a few ways to make it ignore that token. In this change we use the
dummy "123456" value.

The previous token was a more realistic dummy but a dummy nonetheless. It has
never been a valid token and could not be used to access anything.
This also removes documentation for the /get-token endpoint as it is only
relevant for the old Token authentication method.

The old authentication methods (Basic and Token) are only supported for v0.9.
We do not update the v0.9 spec via the Makefile any more.
PB-1282: document the new authentication method.
@adk-swisstopo adk-swisstopo merged commit fca3992 into master Jan 28, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants