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

Configure the default OAuth2 ClientID #209

Merged
merged 2 commits into from
May 4, 2022

Conversation

joshstrohminger
Copy link
Contributor

Describe the PR
Allow callers to configure the default ClientID for OAuth2. This just pre-populates the client_id form field in the Authorize dialog. Here is what it looks like using the following line config:

router.GET("/docs/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.Oauth2DefaultClientID("swagger")))

image

Relation issue
None

Additional context
This is done by calling the initOAuth function with the configured value if one is provided.

@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #209 (99aeaa0) into master (64d8dea) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 99aeaa0 differs from pull request most recent head 36f23f5. Consider uploading reports for the commit 36f23f5 to get more accurate results

@@            Coverage Diff            @@
##            master      #209   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           93        98    +5     
=========================================
+ Hits            93        98    +5     
Impacted Files Coverage Δ
swagger.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64d8dea...36f23f5. Read the comment docs.

ubogdan
ubogdan previously approved these changes May 4, 2022
Copy link
Contributor

@ubogdan ubogdan left a comment

Choose a reason for hiding this comment

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

LGTM

@ubogdan
Copy link
Contributor

ubogdan commented May 4, 2022

@joshstrohminger would you mind updating the README.md file regarding this feature?

@joshstrohminger
Copy link
Contributor Author

Sorry I missed the readme update. Let me know if it's not to your liking.

Copy link
Contributor

@ubogdan ubogdan left a comment

Choose a reason for hiding this comment

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

LGTM

@ubogdan ubogdan merged commit bdcc4ec into swaggo:master May 4, 2022
@ubogdan
Copy link
Contributor

ubogdan commented May 4, 2022

@joshstrohminger Thanks for your contribution.

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