-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jans-auth-server): draft for - improve dcr / ssa validation for …
…dynamic registration #2980
- Loading branch information
Showing
7 changed files
with
478 additions
and
23 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
145 changes: 145 additions & 0 deletions
145
jans-auth-server/model/src/main/java/io/jans/as/model/ssa/SsaValidationConfig.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,145 @@ | ||
package io.jans.as.model.ssa; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Yuriy Z | ||
*/ | ||
@JsonIgnoreProperties( | ||
ignoreUnknown = true | ||
) | ||
public class SsaValidationConfig { | ||
|
||
private String id; | ||
private SsaValidationType type; | ||
private String displayName; | ||
private String description; | ||
private List<String> scopes; | ||
private List<String> allowedClaims; | ||
private String jwks; | ||
private String jwksUri; | ||
private List<String> issuers; | ||
private String configurationEndpoint; | ||
private String configurationEndpointClaim; | ||
private String sharedSecret; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public SsaValidationType getType() { | ||
return type; | ||
} | ||
|
||
public void setType(SsaValidationType type) { | ||
this.type = type; | ||
} | ||
|
||
public String getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
public void setDisplayName(String displayName) { | ||
this.displayName = displayName; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public List<String> getScopes() { | ||
if (scopes == null) scopes = new ArrayList<>(); | ||
return scopes; | ||
} | ||
|
||
public void setScopes(List<String> scopes) { | ||
this.scopes = scopes; | ||
} | ||
|
||
public List<String> getAllowedClaims() { | ||
if (allowedClaims == null) allowedClaims = new ArrayList<>(); | ||
return allowedClaims; | ||
} | ||
|
||
public void setAllowedClaims(List<String> allowedClaims) { | ||
this.allowedClaims = allowedClaims; | ||
} | ||
|
||
public String getJwks() { | ||
return jwks; | ||
} | ||
|
||
public void setJwks(String jwks) { | ||
this.jwks = jwks; | ||
} | ||
|
||
public String getJwksUri() { | ||
return jwksUri; | ||
} | ||
|
||
public void setJwksUri(String jwksUri) { | ||
this.jwksUri = jwksUri; | ||
} | ||
|
||
public List<String> getIssuers() { | ||
if (issuers == null) issuers = new ArrayList<>(); | ||
return issuers; | ||
} | ||
|
||
public void setIssuers(List<String> issuers) { | ||
this.issuers = issuers; | ||
} | ||
|
||
public String getConfigurationEndpoint() { | ||
return configurationEndpoint; | ||
} | ||
|
||
public void setConfigurationEndpoint(String configurationEndpoint) { | ||
this.configurationEndpoint = configurationEndpoint; | ||
} | ||
|
||
public String getConfigurationEndpointClaim() { | ||
return configurationEndpointClaim; | ||
} | ||
|
||
public void setConfigurationEndpointClaim(String configurationEndpointClaim) { | ||
this.configurationEndpointClaim = configurationEndpointClaim; | ||
} | ||
|
||
public String getSharedSecret() { | ||
return sharedSecret; | ||
} | ||
|
||
public void setSharedSecret(String sharedSecret) { | ||
this.sharedSecret = sharedSecret; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SsaValidationConfig{" + | ||
"id='" + id + '\'' + | ||
", type=" + type + | ||
", displayName='" + displayName + '\'' + | ||
", description='" + description + '\'' + | ||
", scopes=" + scopes + | ||
", allowedClaims=" + allowedClaims + | ||
", jwks='" + jwks + '\'' + | ||
", jwksUri='" + jwksUri + '\'' + | ||
", issuers=" + issuers + | ||
", configurationEndpoint='" + configurationEndpoint + '\'' + | ||
", configurationEndpointClaim='" + configurationEndpointClaim + '\'' + | ||
", sharedSecret='" + sharedSecret + '\'' + | ||
'}'; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
jans-auth-server/model/src/main/java/io/jans/as/model/ssa/SsaValidationType.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,29 @@ | ||
package io.jans.as.model.ssa; | ||
|
||
/** | ||
* @author Yuriy Z | ||
*/ | ||
public enum SsaValidationType { | ||
NONE("none"), | ||
SSA("ssa"), | ||
DCR("dcr"); | ||
|
||
private final String value; | ||
|
||
SsaValidationType(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public static SsaValidationType of(String value) { | ||
for (SsaValidationType t : values()) { | ||
if (t.value.equalsIgnoreCase(value)) { | ||
return t; | ||
} | ||
} | ||
return NONE; | ||
} | ||
} |
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
Oops, something went wrong.