Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[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.