added dashboard
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -5,14 +5,15 @@ import de.srsoftware.oidc.api.data.AuthResult;
|
||||
import de.srsoftware.oidc.api.data.Authorization;
|
||||
import java.time.Instant;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface AuthorizationService {
|
||||
AuthorizationService authorize(String userId, String clientId, Collection<String> scopes, Instant expiration);
|
||||
Optional<Authorization> consumeAuthorization(String authCode);
|
||||
AuthResult getAuthorization(String userId, String clientId, Collection<String> scopes);
|
||||
|
||||
Optional<String> consumeNonce(String uuid, String id);
|
||||
List<String> authorizedClients(String userId);
|
||||
Optional<String> consumeNonce(String uuid, String id);
|
||||
|
||||
void nonce(String uuid, String id, String string);
|
||||
}
|
||||
|
||||
@@ -37,12 +37,8 @@ public final class Client {
|
||||
}
|
||||
|
||||
public Map<String, Object> map() {
|
||||
var map = new HashMap<String, Object>();
|
||||
map.put(CLIENT_ID, id);
|
||||
map.put(NAME, name);
|
||||
var map = safeMap();
|
||||
map.put(SECRET, secret);
|
||||
nullable(redirectUris).ifPresent(uris -> map.put(REDIRECT_URIS, uris));
|
||||
nullable(landingPage).ifPresent(lp -> map.put(LANDING_PAGE, lp));
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -51,6 +47,15 @@ public final class Client {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Map<String, Object> safeMap() {
|
||||
var map = new HashMap<String, Object>();
|
||||
map.put(CLIENT_ID, id);
|
||||
map.put(NAME, name);
|
||||
nullable(redirectUris).ifPresent(uris -> map.put(REDIRECT_URIS, uris));
|
||||
nullable(landingPage).ifPresent(lp -> map.put(LANDING_PAGE, lp));
|
||||
return map;
|
||||
}
|
||||
|
||||
public String secret() {
|
||||
return secret;
|
||||
}
|
||||
|
||||
@@ -74,4 +74,5 @@ public abstract class AuthServiceTest {
|
||||
}
|
||||
|
||||
// TODO: test nonce methods
|
||||
// TODO: test authorizedClients method
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user