This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Config struct { | |
| Db struct { | |
| Name string | |
| User string | |
| Password string | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Db": { | |
| "Name": "authdb", | |
| "User": "postgres", | |
| "Password": "postgres" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| database: | |
| driverClass: org.postgresql.Driver | |
| user: postgres | |
| password: postgres | |
| url: jdbc:postgresql://localhost/authdb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| database: | |
| driverClass: org.postgresql.Driver | |
| user: postgres | |
| password: postgres | |
| url: jdbc:postgresql://localhost/authdb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| database: | |
| driverClass: org.postgresql.Driver | |
| user: postgres | |
| password: postgres | |
| url: jdbc:postgresql://localhost/authdb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Path("authenticate") | |
| @Produces(MediaType.APPLICATION_JSON) | |
| public class AuthResource { | |
| private final UserDAO userDAO; | |
| public AuthResource(UserDAO userDAO) { | |
| this.userDAO = userDAO; | |
| } | |
| @GET |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AuthConfiguration extends Configuration { | |
| @Valid | |
| @NotNull | |
| @JsonProperty | |
| private DatabaseConfiguration database = new DatabaseConfiguration(); | |
| public DatabaseConfiguration getDatabaseConfiguration() { | |
| return database; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| database: | |
| driverClass: org.postgresql.Driver | |
| user: postgres | |
| password: postgres | |
| url: jdbc:postgresql://localhost/authdb | |
| properties: | |
| charSet: UTF-8 | |
| http: | |
| requestLog: | |
| console: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Db": { | |
| "Name": "authdb", | |
| "User": "postgres", | |
| "Password": "postgres" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Config struct { | |
| Db struct { | |
| Name string | |
| User string | |
| Password string | |
| } | |
| } | |
| func ReadConfig() Config { | |
| if len(os.Args) != 2 { |