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

Change login.gov URL processing to using a format string. #2096

Open
5 tasks
xlorepdarkhelm opened this issue Nov 8, 2024 · 0 comments
Open
5 tasks

Change login.gov URL processing to using a format string. #2096

xlorepdarkhelm opened this issue Nov 8, 2024 · 0 comments

Comments

@xlorepdarkhelm
Copy link
Contributor

xlorepdarkhelm commented Nov 8, 2024

Currently, the way we are processing the URL string for login.gov is we are doing a simple string search & replace for NONCE and STATE to the values they are supposed to be. This is simple enough, but can have some hidden gotchas, as we discovered in #2093 as such, I recommend we set the environment variable(s) we are using to be Python format strings, with curly braces, and then use the str.format() method on them to stick the values in. This would be cleaner, more Pythonic, and more precise, and would avoid the problem we encountered with the staging environment's env var.

This would mean the following has to be done:

  • Change the environment variables to be format strings. Replacing NONCE with {nonce} and STATE with {state}
  • Update the relevant code where this is used to use the URL's .format() method and stick the values in through there i.e. url.format(nonce=nonce, state=state).
  • Verify everything now works correctly locally.
  • Check if this is necessary for api.
  • Entire team needs to update their .env files to reflect this change.
@xlorepdarkhelm xlorepdarkhelm converted this from a draft issue Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🌱 New
Development

No branches or pull requests

1 participant