Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

[Issue #58] Locally, preserve the auth token in the OpenAPI across refreshes #67

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

chouinar
Copy link
Collaborator

Summary

Fixes #58

Time to review: 3 mins

Changes proposed

Set the persistAuthorization OpenAPI config locally to True

Context for reviewers

For local development, we frequently need to go to http://localhost:8080/docs - enter the auth token, and then repeat this process every time we reopen this page or refresh. Having to either copy paste or retype in the auth token is tedious. This flag makes it so it gets preserved in your browsers local storage.

We are only enabling this for the local endpoint at the moment as there are possibly security implications we would need to consider non-locally (eg. what if someone is using a public computer).


# For the OpenAPI docs, set whether the auth tokens are stored
# across refreshes of the page. Currently we only set this to true locally
persist_authorization_openapi: bool = False
Copy link
Collaborator

Choose a reason for hiding this comment

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

This just sets it false by default - and then the local.env overrides it locally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes - this way non-locally it is false. Followed this pattern for several fields and it works well.

@chouinar chouinar merged commit 0f38c92 into main Jun 3, 2024
8 checks passed
@chouinar chouinar deleted the chouinar/58-local-preserve-token branch June 3, 2024 14:31
acouch pushed a commit that referenced this pull request Sep 18, 2024
…ss refreshes (#67)

Fixes HHS#2072

Set the `persistAuthorization` OpenAPI config locally to True

For local development, we frequently need to go to
http://localhost:8080/docs - enter the auth token, and then repeat this
process every time we reopen this page or refresh. Having to either copy
paste or retype in the auth token is tedious. This flag makes it so it
gets preserved in your browsers local storage.

We are only enabling this for the local endpoint at the moment as there
are possibly security implications we would need to consider non-locally
(eg. what if someone is using a public computer).
acouch pushed a commit that referenced this pull request Sep 18, 2024
…ss refreshes (#67)

Fixes HHS#2072

Set the `persistAuthorization` OpenAPI config locally to True

For local development, we frequently need to go to
http://localhost:8080/docs - enter the auth token, and then repeat this
process every time we reopen this page or refresh. Having to either copy
paste or retype in the auth token is tedious. This flag makes it so it
gets preserved in your browsers local storage.

We are only enabling this for the local endpoint at the moment as there
are possibly security implications we would need to consider non-locally
(eg. what if someone is using a public computer).
acouch pushed a commit to HHS/simpler-grants-gov that referenced this pull request Sep 18, 2024
…refreshes (navapbc#67)

Fixes #2072

Set the `persistAuthorization` OpenAPI config locally to True

For local development, we frequently need to go to
http://localhost:8080/docs - enter the auth token, and then repeat this
process every time we reopen this page or refresh. Having to either copy
paste or retype in the auth token is tedious. This flag makes it so it
gets preserved in your browsers local storage.

We are only enabling this for the local endpoint at the moment as there
are possibly security implications we would need to consider non-locally
(eg. what if someone is using a public computer).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: For local development, have the swagger UI auto-populate the auth token
2 participants