-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: publish Lock message on id_token issue/revoke (#7271)
* chore: move token entry to core-service to allow reuse Signed-off-by: Yuriy Movchan <Yuriy.Movchan@gmail.com> * chore: remove unused reference and method Signed-off-by: Yuriy Movchan <Yuriy.Movchan@gmail.com> * feat: publish Lock message on id_token issue/revoke #7244 Signed-off-by: Yuriy Movchan <Yuriy.Movchan@gmail.com> * feat: publish Lock message on id_token issue/revoke #7244 Signed-off-by: Yuriy Movchan <Yuriy.Movchan@gmail.com> --------- Signed-off-by: Yuriy Movchan <Yuriy.Movchan@gmail.com>
- Loading branch information
Showing
11 changed files
with
115 additions
and
21 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
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
48 changes: 48 additions & 0 deletions
48
jans-lock/service/src/main/java/io/jans/lock/service/TokenService.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,48 @@ | ||
/* | ||
* Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. | ||
* | ||
* Copyright (c) 2020, Janssen Project | ||
*/ | ||
|
||
package io.jans.lock.service; | ||
|
||
import org.slf4j.Logger; | ||
|
||
import io.jans.lock.model.config.StaticConfiguration; | ||
import io.jans.model.token.TokenEntity; | ||
import io.jans.orm.PersistenceEntryManager; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
|
||
/** | ||
* | ||
* Token service | ||
* | ||
* @author Yuriy Movchan Date: 01/05/2024 | ||
*/ | ||
@ApplicationScoped | ||
public class TokenService { | ||
|
||
@Inject | ||
private Logger log; | ||
|
||
@Inject | ||
private PersistenceEntryManager persistenceEntryManager; | ||
|
||
@Inject | ||
private StaticConfiguration staticConfiguration; | ||
|
||
public String buildDn(String hashedToken) { | ||
return String.format("tknCde=%s,", hashedToken) + tokenBaseDn(); | ||
} | ||
|
||
private String tokenBaseDn() { | ||
return staticConfiguration.getBaseDn().getTokens(); // ou=tokens,o=jans | ||
} | ||
|
||
public TokenEntity findToken(String tokenCode) { | ||
String tokenDn = buildDn(tokenCode); | ||
return persistenceEntryManager.find(TokenEntity.class, tokenDn); | ||
} | ||
|
||
} |
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
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