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

Adds options to prefill swagger ui security schemes #101

Merged

Conversation

Charlesthebird
Copy link
Collaborator

@Charlesthebird Charlesthebird commented Sep 16, 2024

This PR allows users to enter the parameters for each of these swagger ui instance methods using environment variables, with an option for including the currently logged in user token. The README.md is also updated with these new options.

I was able to verify that the Swagger UI instance has the information by checking the "Available Authorizations" modal after pre-filling the Swagger UI options with the following environment variables. However, I didn't have any real services set up with auth, so I didn't test the actual e2e authenticated requests that the Swagger UI should make.

VITE_SWAGGER_PREFILL_API_KEY='["api_key","{{USER_TOKEN}}"]'
VITE_SWAGGER_PREFILL_BASIC='["basic","test-username","test-pass"]'
VITE_SWAGGER_PREFILL_OAUTH='{"clientId": "your-client-id","clientSecret": "your-client-secret-if-required","realm": "your-realms","appName": "your-app-name","scopeSeparator": " ","scopes": "openid profile","additionalQueryStringParams": {"test": "hello"},"useBasicAuthenticationWithAccessCodeGrant": true,"usePkceWithAuthorizationCodeGrant": true}'
Screenshot 2024-09-18 at 2 24 49 PM Screenshot 2024-09-18 at 2 24 51 PM

BOT NOTES:
resolves https://github.com/solo-io/solo-projects/issues/6859

Signed-off-by: Nicholas Bucher <[email protected]>
@solo-changelog-bot
Copy link

Issues linked to changelog:
https://github.com/solo-io/solo-projects/issues/6859

@Charlesthebird Charlesthebird changed the title changelog Adds an option to prefill the swagger ui bearer token Sep 16, 2024
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
Signed-off-by: Nicholas Bucher <[email protected]>
@Charlesthebird Charlesthebird changed the title Adds an option to prefill the swagger ui bearer token Adds an option to prefill the swagger ui security schemes Sep 18, 2024
@Charlesthebird Charlesthebird changed the title Adds an option to prefill the swagger ui security schemes Adds options to prefill swagger ui security schemes Sep 18, 2024
Signed-off-by: Nicholas Bucher <[email protected]>
@Charlesthebird Charlesthebird marked this pull request as ready for review September 18, 2024 19:04
Copy link
Contributor

@Worfle Worfle left a comment

Choose a reason for hiding this comment

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

I know the full e2e wasn't tested, but nothing in the Swagger seems odd or worrisome at all.

Looks solid to me

@Charlesthebird Charlesthebird merged commit 074b82b into gg-portal-1.18-features Sep 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants