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

Add support for Dropwizard 0.9. #8

Closed
wants to merge 3 commits into from
Closed

Add support for Dropwizard 0.9. #8

wants to merge 3 commits into from

Conversation

omodica
Copy link

@omodica omodica commented Nov 18, 2015

[Fixes #7] Most of the authentication changes resolve around the use of the Principal interface and optionally providing support for authorization through an Authorizer.

The simplest (and likely most common) use of the API bundle, and closest to the version targeting Dropwizard 0.8, is to use the DefaultApiKeyBundle which uses the default implementation of the Principal interface (provided by the Dropwizard Auth module) and a permit all authorization scheme. You do need to annotate your resource with a Principal type instead of a String, however given the Principal interface is provided through a base package (java.security) this will meets the desire to avoid using interfaces/classes from the library in the resources (one of the reason ApiKey was refactored to a String in an earlier release).

However if you require the use of a different Principal implementation, or an extending type, you can use the ApiKeyBundle directly and provide the Principal type and a PrincipalFactory. You can also provide an Authorizer if needed.

The migration changes are fully documented here: https://github.com/dropwizard/dropwizard/wiki/Upgrade-guide-0.8.x-to-0.9.x.

…solve around the use of the Principal interface and optionally providing support for authorization through an Authorizer.

The simplest (and likely most common) use of the API bundle, and closest to the version targeting Dropwizard 0.8, is to use the DefaultApiKeyBundle which uses the default implementation of the Principal interface (provided by the Dropwizard Auth module) and a permit all authorization scheme. You do need to annotate your resource with a Principal type instead of a String, however given the Principal interface is provided through a base package (java.security) this will meets the desire to avoid using interfaces/classes from the library in the resources (one of the reason ApiKey was refactored to a String in an earlier release).

However if you require the use of a different Principal implementation, or an extending type, you can use the ApiKeyBundle directly and provide the Principal type and a PrincipalFactory. You can also provide an Authorizer if needed.

The migration changes are fully documented here: https://github.com/dropwizard/dropwizard/wiki/Upgrade-guide-0.8.x-to-0.9.x.
@omodica
Copy link
Author

omodica commented Nov 18, 2015

Note that I actually didn't mean to suggest this be merged into master (Github failed me), but rather that if possible a dropwizard-0.9 branch be created and a 0.9.x-y release generated off that branch in addition to the 0.8.x-y train.

@omodica
Copy link
Author

omodica commented Dec 14, 2015

Until this can be merged I have released this version under Pivot Freight's GitHub at https://github.com/pivotfreight/dropwizard-api-key-bundle.

omodica added 2 commits March 3, 2016 15:17
… useful when adding the API key bundle to a Dropwizard service that provides all of its responses as JSON or follows a specific format for its error responses.
@omodica omodica closed this by deleting the head repository Apr 11, 2023
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.

Add support for Dropwizard 0.9
1 participant