Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grzegorz
CTF
Commits
9056ef2d
Commit
9056ef2d
authored
Mar 22, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename authenticator
parent
b70e6b96
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
CTFApplication.java
.../java/com/telephoners/krakyournet/ctf/CTFApplication.java
+2
-2
UserAuthenticator.java
...m/telephoners/krakyournet/ctf/auth/UserAuthenticator.java
+2
-3
No files found.
service/src/main/java/com/telephoners/krakyournet/ctf/CTFApplication.java
View file @
9056ef2d
...
@@ -5,7 +5,7 @@ import com.google.common.collect.ImmutableSet;
...
@@ -5,7 +5,7 @@ import com.google.common.collect.ImmutableSet;
import
com.google.common.reflect.ClassPath
;
import
com.google.common.reflect.ClassPath
;
import
com.google.inject.Guice
;
import
com.google.inject.Guice
;
import
com.google.inject.Injector
;
import
com.google.inject.Injector
;
import
com.telephoners.krakyournet.ctf.auth.
Example
Authenticator
;
import
com.telephoners.krakyournet.ctf.auth.
User
Authenticator
;
import
com.telephoners.krakyournet.ctf.beans.User
;
import
com.telephoners.krakyournet.ctf.beans.User
;
import
com.telephoners.krakyournet.ctf.commands.PurgeDatabaseCommand
;
import
com.telephoners.krakyournet.ctf.commands.PurgeDatabaseCommand
;
import
com.telephoners.krakyournet.ctf.commands.RegisterTasksCommand
;
import
com.telephoners.krakyournet.ctf.commands.RegisterTasksCommand
;
...
@@ -56,7 +56,7 @@ public class CTFApplication extends Application<ApplicationConfiguration>
...
@@ -56,7 +56,7 @@ public class CTFApplication extends Application<ApplicationConfiguration>
{
{
environment
.
jersey
().
register
(
new
AuthDynamicFeature
(
environment
.
jersey
().
register
(
new
AuthDynamicFeature
(
new
BasicCredentialAuthFilter
.
Builder
<
User
>()
new
BasicCredentialAuthFilter
.
Builder
<
User
>()
.
setAuthenticator
(
injector
.
getInstance
(
Example
Authenticator
.
class
))
.
setAuthenticator
(
injector
.
getInstance
(
User
Authenticator
.
class
))
.
buildAuthFilter
()));
.
buildAuthFilter
()));
environment
.
jersey
().
register
(
RolesAllowedDynamicFeature
.
class
);
environment
.
jersey
().
register
(
RolesAllowedDynamicFeature
.
class
);
environment
.
jersey
().
register
(
new
AuthValueFactoryProvider
.
Binder
<>(
User
.
class
));
environment
.
jersey
().
register
(
new
AuthValueFactoryProvider
.
Binder
<>(
User
.
class
));
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/auth/
Example
Authenticator.java
→
service/src/main/java/com/telephoners/krakyournet/ctf/auth/
User
Authenticator.java
View file @
9056ef2d
...
@@ -8,13 +8,12 @@ import io.dropwizard.auth.AuthenticationException;
...
@@ -8,13 +8,12 @@ import io.dropwizard.auth.AuthenticationException;
import
io.dropwizard.auth.Authenticator
;
import
io.dropwizard.auth.Authenticator
;
import
io.dropwizard.auth.basic.BasicCredentials
;
import
io.dropwizard.auth.basic.BasicCredentials
;
public
class
Example
Authenticator
implements
Authenticator
<
BasicCredentials
,
User
>
public
class
User
Authenticator
implements
Authenticator
<
BasicCredentials
,
User
>
{
{
private
UsersRepository
usersRepository
;
private
UsersRepository
usersRepository
;
@Inject
@Inject
public
Example
Authenticator
(
UsersRepository
usersRepository
)
public
User
Authenticator
(
UsersRepository
usersRepository
)
{
{
this
.
usersRepository
=
usersRepository
;
this
.
usersRepository
=
usersRepository
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment