-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incremental commit: Added backend support for KeyInfo containing OIDC fields
- Loading branch information
Showing
32 changed files
with
361 additions
and
177 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,4 +97,4 @@ public List<XMLObject> getOrderedChildren() { | |
|
|
||
| return children; | ||
| } | ||
| } | ||
| } | ||
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
41 changes: 12 additions & 29 deletions
41
...a/edu/internet2/tier/shibboleth/admin/ui/domain/frontend/KeyDescriptorRepresentation.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,38 +1,21 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.frontend; | ||
|
|
||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| public class KeyDescriptorRepresentation implements Serializable { | ||
|
|
||
| private static final long serialVersionUID = -2397547851045884034L; | ||
|
|
||
| private boolean x509CertificateAvailable; | ||
|
|
||
| private boolean authenticationRequestsSigned; | ||
|
|
||
| private String x509Certificate; | ||
|
|
||
| public boolean isX509CertificateAvailable() { | ||
| return x509CertificateAvailable; | ||
| } | ||
|
|
||
| public void setX509CertificateAvailable(boolean x509CertificateAvailable) { | ||
| this.x509CertificateAvailable = x509CertificateAvailable; | ||
| } | ||
|
|
||
| public boolean isAuthenticationRequestsSigned() { | ||
| return authenticationRequestsSigned; | ||
| } | ||
|
|
||
| public void setAuthenticationRequestsSigned(boolean authenticationRequestsSigned) { | ||
| this.authenticationRequestsSigned = authenticationRequestsSigned; | ||
| } | ||
|
|
||
| public String getX509Certificate() { | ||
| return x509Certificate; | ||
| } | ||
| private String name; | ||
| private String value; | ||
| private String type; | ||
| private ElementType elementType; | ||
|
|
||
| public void setX509Certificate(String x509Certificate) { | ||
| this.x509Certificate = x509Certificate; | ||
| public enum ElementType { | ||
| jwksData, jwksUri, clientSecret, clientSecretKeyReference, X509Data, unsupported | ||
| } | ||
| } | ||
| } |
77 changes: 13 additions & 64 deletions
77
...va/edu/internet2/tier/shibboleth/admin/ui/domain/frontend/SecurityInfoRepresentation.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,86 +1,35 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.frontend; | ||
|
|
||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| public class SecurityInfoRepresentation implements Serializable { | ||
|
|
||
| private static final long serialVersionUID = 9016350010045719454L; | ||
|
|
||
| private boolean x509CertificateAvailable; | ||
|
|
||
| private boolean authenticationRequestsSigned; | ||
|
|
||
| private boolean wantAssertionsSigned; | ||
|
|
||
| private List<X509CertificateRepresentation> x509Certificates = new ArrayList<>(); | ||
| private List<KeyDescriptorRepresentation> keyDescriptors = new ArrayList<>(); | ||
|
|
||
| public boolean isX509CertificateAvailable() { | ||
| return x509CertificateAvailable; | ||
| } | ||
|
|
||
| public void setX509CertificateAvailable(boolean x509CertificateAvailable) { | ||
| this.x509CertificateAvailable = x509CertificateAvailable; | ||
| } | ||
|
|
||
| public boolean isAuthenticationRequestsSigned() { | ||
| return authenticationRequestsSigned; | ||
| } | ||
|
|
||
| public void setAuthenticationRequestsSigned(boolean authenticationRequestsSigned) { | ||
| this.authenticationRequestsSigned = authenticationRequestsSigned; | ||
| } | ||
|
|
||
| public boolean isWantAssertionsSigned() { | ||
| return wantAssertionsSigned; | ||
| } | ||
|
|
||
| public void setWantAssertionsSigned(boolean wantAssertionsSigned) { | ||
| this.wantAssertionsSigned = wantAssertionsSigned; | ||
| } | ||
|
|
||
| public List<X509CertificateRepresentation> getX509Certificates() { | ||
| return x509Certificates; | ||
| } | ||
|
|
||
| public void setX509Certificates(List<X509CertificateRepresentation> x509Certificates) { | ||
| this.x509Certificates = x509Certificates; | ||
| public void addKeyDescriptor(KeyDescriptorRepresentation keyDescriptorRep) { | ||
| keyDescriptors.add(keyDescriptorRep); | ||
| } | ||
|
|
||
| @Getter | ||
| @Setter | ||
| @Deprecated | ||
| public static class X509CertificateRepresentation implements Serializable { | ||
|
|
||
| private static final long serialVersionUID = -4893206348572998788L; | ||
|
|
||
| private String name; | ||
|
|
||
| private String value; | ||
| //TODO refactor into Enum? | ||
| private String type; | ||
|
|
||
| private String value; | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public String getType() { | ||
| return type; | ||
| } | ||
|
|
||
| public void setType(String type) { | ||
| this.type = type; | ||
| } | ||
|
|
||
| public String getValue() { | ||
| return value; | ||
| } | ||
|
|
||
| public void setValue(String value) { | ||
| this.value = value; | ||
| } | ||
| } | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
.../main/java/edu/internet2/tier/shibboleth/admin/ui/domain/oidc/AbstractValueXMLObject.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,30 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.oidc; | ||
|
|
||
| import edu.internet2.tier.shibboleth.admin.ui.domain.AbstractAuditable; | ||
| import edu.internet2.tier.shibboleth.admin.ui.domain.AbstractXMLObject; | ||
| import lombok.EqualsAndHashCode; | ||
| import org.hibernate.envers.AuditOverride; | ||
| import org.hibernate.envers.Audited; | ||
|
|
||
| import javax.annotation.Nullable; | ||
| import javax.persistence.Entity; | ||
| import javax.persistence.Inheritance; | ||
| import javax.persistence.InheritanceType; | ||
|
|
||
| @Entity | ||
| @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @Audited | ||
| @AuditOverride(forClass = AbstractXMLObject.class) | ||
| public abstract class AbstractValueXMLObject extends AbstractXMLObject implements ValueXMLObject { | ||
| private String stringValue; | ||
|
|
||
| @Nullable | ||
| public String getValue() { | ||
| return this.stringValue; | ||
| } | ||
|
|
||
| public void setValue(@Nullable String newValue) { | ||
| this.stringValue = newValue; | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/oidc/ClientSecret.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,12 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.oidc; | ||
|
|
||
| import lombok.EqualsAndHashCode; | ||
| import org.hibernate.envers.Audited; | ||
|
|
||
| import javax.persistence.Entity; | ||
|
|
||
| @Entity | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @Audited | ||
| public class ClientSecret extends AbstractValueXMLObject implements net.shibboleth.oidc.saml.xmlobject.ClientSecret { | ||
| } |
12 changes: 12 additions & 0 deletions
12
...ain/java/edu/internet2/tier/shibboleth/admin/ui/domain/oidc/ClientSecretKeyReference.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,12 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.oidc; | ||
|
|
||
| import lombok.EqualsAndHashCode; | ||
| import org.hibernate.envers.Audited; | ||
|
|
||
| import javax.persistence.Entity; | ||
|
|
||
| @Entity | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @Audited | ||
| public class ClientSecretKeyReference extends AbstractValueXMLObject implements net.shibboleth.oidc.saml.xmlobject.ClientSecretKeyReference { | ||
| } |
12 changes: 12 additions & 0 deletions
12
backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/oidc/JwksData.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,12 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.oidc; | ||
|
|
||
| import lombok.EqualsAndHashCode; | ||
| import org.hibernate.envers.Audited; | ||
|
|
||
| import javax.persistence.Entity; | ||
|
|
||
| @Entity | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @Audited | ||
| public class JwksData extends AbstractValueXMLObject implements net.shibboleth.oidc.saml.xmlobject.JwksData { | ||
| } |
12 changes: 12 additions & 0 deletions
12
backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/oidc/JwksUri.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,12 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.oidc; | ||
|
|
||
| import lombok.EqualsAndHashCode; | ||
| import org.hibernate.envers.Audited; | ||
|
|
||
| import javax.persistence.Entity; | ||
|
|
||
| @Entity | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @Audited | ||
| public class JwksUri extends AbstractValueXMLObject implements net.shibboleth.oidc.saml.xmlobject.JwksUri { | ||
| } |
14 changes: 14 additions & 0 deletions
14
.../src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/oidc/ValueXMLMarshaller.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,14 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.oidc; | ||
|
|
||
| import net.shibboleth.utilities.java.support.xml.ElementSupport; | ||
| import org.opensaml.core.xml.XMLObject; | ||
| import org.opensaml.core.xml.io.AbstractXMLObjectMarshaller; | ||
| import org.opensaml.core.xml.io.MarshallingException; | ||
| import org.w3c.dom.Element; | ||
|
|
||
| public class ValueXMLMarshaller extends AbstractXMLObjectMarshaller { | ||
| protected void marshallElementContent(final XMLObject xmlObject, final Element domElement) throws MarshallingException { | ||
| final ValueXMLObject valueXMLObject = (ValueXMLObject) xmlObject; | ||
| ElementSupport.appendTextContent(domElement, valueXMLObject.getValue()); | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/oidc/ValueXMLObject.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,9 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.oidc; | ||
|
|
||
| /** | ||
| * ValueXMLObject is an XML Object that has a "value" through String getValue() and void setValue(String) methods | ||
| */ | ||
| public interface ValueXMLObject { | ||
| String getValue(); | ||
| void setValue(String value); | ||
| } |
11 changes: 11 additions & 0 deletions
11
...rc/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/oidc/ValueXMLUnmarshaller.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,11 @@ | ||
| package edu.internet2.tier.shibboleth.admin.ui.domain.oidc; | ||
|
|
||
| import org.opensaml.core.xml.XMLObject; | ||
| import org.opensaml.core.xml.io.AbstractXMLObjectUnmarshaller; | ||
|
|
||
| public class ValueXMLUnmarshaller extends AbstractXMLObjectUnmarshaller { | ||
| protected void processElementContent(final XMLObject xmlObject, final String elementContent) { | ||
| final ValueXMLObject valueXMLObject = (ValueXMLObject) xmlObject; | ||
| valueXMLObject.setValue(elementContent); | ||
| } | ||
| } |
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.