token enricher should use new access token api

This commit is contained in:
Sebastian Sdorra
2017-01-17 15:33:19 +01:00
parent 2388cfd35d
commit 70d5942250
10 changed files with 68 additions and 70 deletions

View File

@@ -30,24 +30,23 @@
*/
package sonia.scm.security;
import java.util.Map;
import sonia.scm.plugin.ExtensionPoint;
/**
* TokenClaimsEnricher is able to modify the claims of a JWT token, before it is delivered to the client.
* TokenClaimsEnricher can be used to add custom values to the token claim.
* AccessTokenEnricher is able to enhance the {@link AccessToken}, before it is delivered to the client.
* AccessTokenEnricher can be used to add custom fields to the {@link AccessToken}. The enricher is always called before
* an {@link AccessToken} is build by the {@link AccessTokenBuilder}.
*
* @author Sebastian Sdorra
* @since 2.0.0
*/
@ExtensionPoint
public interface TokenClaimsEnricher {
public interface AccessTokenEnricher {
/**
* Modify the token claims.
* Enriches the access token by adding fields to the {@link AccessTokenBuilder}.
*
* @param claims token claims
* @param builder access token builder
*/
void enrich(Map<String, Object> claims);
void enrich(AccessTokenBuilder builder);
}