-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ea4180
commit ac01608
Showing
8 changed files
with
172 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
5 changes: 5 additions & 0 deletions
5
.../alert-messenger/src/main/java/tech/ebp/oqm/plugin/alertMessenger/repositories/Query.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package tech.ebp.oqm.plugin.alertMessenger.repositories; | ||
|
||
public @interface Query { | ||
|
||
} |
This file contains 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
35 changes: 20 additions & 15 deletions
35
...gins/alert-messenger/src/main/java/tech/ebp/oqm/plugin/alertMessenger/utils/JwtUtils.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,41 @@ | ||
package tech.ebp.oqm.plugin.alertMessenger.utils; | ||
|
||
import java.util.UUID; | ||
import org.eclipse.microprofile.jwt.Claims; | ||
import org.eclipse.microprofile.jwt.JsonWebToken; | ||
import tech.ebp.oqm.plugin.alertMessenger.model.UserInfo; | ||
|
||
import java.util.Set; | ||
|
||
public class JwtUtils { | ||
public static String getId(JsonWebToken jwt){ | ||
return jwt.getClaim(Claims.sub); | ||
|
||
public static UUID getId(JsonWebToken jwt) { | ||
return UUID.fromString(jwt.getClaim(Claims.sub)); | ||
} | ||
public static String getName(JsonWebToken jwt){ | ||
|
||
public static String getName(JsonWebToken jwt) { | ||
return jwt.getClaim("name"); | ||
} | ||
public static String getEmail(JsonWebToken jwt){ | ||
|
||
public static String getEmail(JsonWebToken jwt) { | ||
return jwt.getClaim(Claims.email); | ||
} | ||
public static String getUserName(JsonWebToken jwt){ | ||
|
||
public static String getUserName(JsonWebToken jwt) { | ||
return jwt.getClaim(Claims.preferred_username); | ||
} | ||
public static Set<String> getRoles(JsonWebToken jwt){ | ||
|
||
public static Set<String> getRoles(JsonWebToken jwt) { | ||
return jwt.getGroups(); | ||
} | ||
public static UserInfo getUserInfo(JsonWebToken jwt){ | ||
|
||
public static UserInfo getUserInfo(JsonWebToken jwt) { | ||
return UserInfo.builder() | ||
.id(getId(jwt)) | ||
.name(getName(jwt)) | ||
.username(getUserName(jwt)) | ||
.email(getEmail(jwt)) | ||
.roles(getRoles(jwt)) | ||
.build(); | ||
.id(getId(jwt)) | ||
.name(getName(jwt)) | ||
.username(getUserName(jwt)) | ||
.email(getEmail(jwt)) | ||
.roles(getRoles(jwt)) | ||
.build(); | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,16 @@ quarkus: | |
username: "[email protected]" | ||
password: "${SMTP_PASSWORD}" | ||
mock: false | ||
# Database configuration below (for user credentials). | ||
datasource: | ||
db-kind: postgresql | ||
jdbc: | ||
url: jdbc:postgresql://localhost:5432/oqm_db | ||
username: Brendan | ||
password: Password123 | ||
hibernate-orm: | ||
database: | ||
generation: update | ||
|
||
mp: | ||
messaging: | ||
|