Move inner-types so that they are always last
Move all inner-types so that they are consistently the last item defined. This aligns with the style used by Spring Framework and the consistency generally makes it easier to scan the source. Issue gh-8945
This commit is contained in:
+16
-16
@@ -562,6 +562,22 @@ public final class OpenSamlAuthenticationProvider implements AuthenticationProvi
|
||||
return xsAny.getTextContent();
|
||||
}
|
||||
|
||||
private static Saml2Error validationError(String code, String description) {
|
||||
return new Saml2Error(code, description);
|
||||
}
|
||||
|
||||
private static Saml2AuthenticationException authException(String code, String description)
|
||||
throws Saml2AuthenticationException {
|
||||
|
||||
return new Saml2AuthenticationException(validationError(code, description));
|
||||
}
|
||||
|
||||
private static Saml2AuthenticationException authException(String code, String description, Exception cause)
|
||||
throws Saml2AuthenticationException {
|
||||
|
||||
return new Saml2AuthenticationException(validationError(code, description), cause);
|
||||
}
|
||||
|
||||
private static class SignatureTrustEngineConverter
|
||||
implements Converter<Saml2AuthenticationToken, SignatureTrustEngine> {
|
||||
|
||||
@@ -651,22 +667,6 @@ public final class OpenSamlAuthenticationProvider implements AuthenticationProvi
|
||||
|
||||
}
|
||||
|
||||
private static Saml2Error validationError(String code, String description) {
|
||||
return new Saml2Error(code, description);
|
||||
}
|
||||
|
||||
private static Saml2AuthenticationException authException(String code, String description)
|
||||
throws Saml2AuthenticationException {
|
||||
|
||||
return new Saml2AuthenticationException(validationError(code, description));
|
||||
}
|
||||
|
||||
private static Saml2AuthenticationException authException(String code, String description, Exception cause)
|
||||
throws Saml2AuthenticationException {
|
||||
|
||||
return new Saml2AuthenticationException(validationError(code, description), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* A tuple containing the authentication token and the associated OpenSAML
|
||||
* {@link Response}.
|
||||
|
||||
+45
-45
@@ -377,6 +377,51 @@ public final class RelyingPartyRegistration {
|
||||
registration.getAssertingPartyDetails().getSingleSignOnServiceBinding()));
|
||||
}
|
||||
|
||||
private static Saml2X509Credential fromDeprecated(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential credential) {
|
||||
PrivateKey privateKey = credential.getPrivateKey();
|
||||
X509Certificate certificate = credential.getCertificate();
|
||||
Set<Saml2X509Credential.Saml2X509CredentialType> credentialTypes = new HashSet<>();
|
||||
if (credential.isSigningCredential()) {
|
||||
credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.SIGNING);
|
||||
}
|
||||
if (credential.isSignatureVerficationCredential()) {
|
||||
credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.VERIFICATION);
|
||||
}
|
||||
if (credential.isEncryptionCredential()) {
|
||||
credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.ENCRYPTION);
|
||||
}
|
||||
if (credential.isDecryptionCredential()) {
|
||||
credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.DECRYPTION);
|
||||
}
|
||||
return new Saml2X509Credential(privateKey, certificate, credentialTypes);
|
||||
}
|
||||
|
||||
private static org.springframework.security.saml2.credentials.Saml2X509Credential toDeprecated(
|
||||
Saml2X509Credential credential) {
|
||||
PrivateKey privateKey = credential.getPrivateKey();
|
||||
X509Certificate certificate = credential.getCertificate();
|
||||
Set<org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType> credentialTypes = new HashSet<>();
|
||||
if (credential.isSigningCredential()) {
|
||||
credentialTypes.add(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.SIGNING);
|
||||
}
|
||||
if (credential.isVerificationCredential()) {
|
||||
credentialTypes.add(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.VERIFICATION);
|
||||
}
|
||||
if (credential.isEncryptionCredential()) {
|
||||
credentialTypes.add(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.ENCRYPTION);
|
||||
}
|
||||
if (credential.isDecryptionCredential()) {
|
||||
credentialTypes.add(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.DECRYPTION);
|
||||
}
|
||||
return new org.springframework.security.saml2.credentials.Saml2X509Credential(privateKey, certificate,
|
||||
credentialTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* The configuration metadata of the Asserting party
|
||||
*
|
||||
@@ -1000,49 +1045,4 @@ public final class RelyingPartyRegistration {
|
||||
|
||||
}
|
||||
|
||||
private static Saml2X509Credential fromDeprecated(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential credential) {
|
||||
PrivateKey privateKey = credential.getPrivateKey();
|
||||
X509Certificate certificate = credential.getCertificate();
|
||||
Set<Saml2X509Credential.Saml2X509CredentialType> credentialTypes = new HashSet<>();
|
||||
if (credential.isSigningCredential()) {
|
||||
credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.SIGNING);
|
||||
}
|
||||
if (credential.isSignatureVerficationCredential()) {
|
||||
credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.VERIFICATION);
|
||||
}
|
||||
if (credential.isEncryptionCredential()) {
|
||||
credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.ENCRYPTION);
|
||||
}
|
||||
if (credential.isDecryptionCredential()) {
|
||||
credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.DECRYPTION);
|
||||
}
|
||||
return new Saml2X509Credential(privateKey, certificate, credentialTypes);
|
||||
}
|
||||
|
||||
private static org.springframework.security.saml2.credentials.Saml2X509Credential toDeprecated(
|
||||
Saml2X509Credential credential) {
|
||||
PrivateKey privateKey = credential.getPrivateKey();
|
||||
X509Certificate certificate = credential.getCertificate();
|
||||
Set<org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType> credentialTypes = new HashSet<>();
|
||||
if (credential.isSigningCredential()) {
|
||||
credentialTypes.add(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.SIGNING);
|
||||
}
|
||||
if (credential.isVerificationCredential()) {
|
||||
credentialTypes.add(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.VERIFICATION);
|
||||
}
|
||||
if (credential.isEncryptionCredential()) {
|
||||
credentialTypes.add(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.ENCRYPTION);
|
||||
}
|
||||
if (credential.isDecryptionCredential()) {
|
||||
credentialTypes.add(
|
||||
org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.DECRYPTION);
|
||||
}
|
||||
return new org.springframework.security.saml2.credentials.Saml2X509Credential(privateKey, certificate,
|
||||
credentialTypes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user