question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration 0.8 -> 0.9 / @Auth doesn't have required attribute any more

See original GitHub issue

Dropwizard 0.8 had an attribute to @Auth so you could annotate a method with

@Auth(required = false)

Dropwizard 0.9 doesn’t. The Migration Guide doesn’t describe how to solve this. I found a discussion #1162 about @PermitAll but I am not sure if I read it correctly and if this discussion is up to date with the release of 0.9.

Please write a short paragraph in the migration guide on how to handle this.

Thanks!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
R-Gerardcommented, Feb 16, 2016

+1 for missing the required = false flag.

According to the 0.9 documentation:

If you have a resource which is optionally protected (e.g., you want to display a logged-in user’s name but not require login), you need to implement a custom filter which injects a security context containing the principal if it exists, without performing authentication.

I’d rather not implement a new filter just because one of my APIs has optional auth. I looked into extending OAuthCredentialAuthFilter, but its constructor is private (so the class is essentially marked final), which forces me to copy-paste the implementation. 😞

@ahus1 's solution works for me. Perhaps this should be included in the documentation as an alternative to rolling your own auth filter.

0reactions
github-actions[bot]commented, Aug 19, 2019

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

Read more comments on GitHub >

github_iconTop Results From Across the Web

cosmwasm/MIGRATING.md at main - GitHub
This guide explains what is needed to upgrade contracts when migrating over major releases of cosmwasm . Note that you can also view...
Read more >
Changelog — os-migrate documentation - GitHub Pages
Sometimes when using pre-existing key and mounting it into a container, the mode seems to be set wrong (reason not discovered). We now...
Read more >
Release Notes - Flyway by Redgate • Database Migrations ...
Fix issue where post schema clean didn't include correct schemas. Clean mode now cleans more schemas for SQL Server integrated authentication logins. Issue...
Read more >
Apache Camel 2.x to 3.0 Migration Guide
This document is intended to help you migrate your Apache Camel ... The camel-jetty component no longer supports producer (eg to) which has...
Read more >
Troubleshooting LDAP - GitLab Docs
GitLab does not cache or store credentials for LDAP users to provide ... LDAP high availability and a separate secondary sign-in option is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found