12urenloop / Telraam

New and hopefully improved application to count laps of the 12urenloop event
MIT License
6 stars 2 forks source link

Add authentication #52

Closed mcbloch closed 1 year ago

mcbloch commented 3 years ago

also fix a classname lookup on a 404.

Usage in code

No annotation means you don't need to be authenticated @PermitAll means all authenticated users can access the resource @DenyAll means nobody can access it @Auth Optional<User> userOpt as path parameter means authentication is not required and gives you a user object, even for anonymous users. Useful to to remove authentication for 1 method when auth is required for the rest of the class

For more see the docs https://www.dropwizard.io/en/latest/manual/auth.html

Using the api

Authenticate using basic auth specifying a username:password. The password is a common one at the moment. When it's valid, your specified username can be used for further authorization. Password at the moment is 'secret'. All Create, Update and Delete methods now require authentication.

Examples

Valid authentication: http -a username:secret localhost:8080/hello-world/auth

Invalid authentication: http -a username:invalid localhost:8080/hello-world/auth

Using curl: curl -u username:secret localhost:8080/hello-world/auth

sonarcloud[bot] commented 3 years ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

47.1% 47.1% Coverage
0.0% 0.0% Duplication

abeforgit commented 2 years ago

note this is breaking for all currently existing clients

abeforgit commented 2 years ago

recommend to merge after test-day

redfast00 commented 1 year ago

We've decided to not do authentication