1
0
mirror of synced 2026-05-22 13:23:17 +00:00

Change interface with constants to final class

Closes gh-10960
This commit is contained in:
Joe Grandja
2022-07-13 12:29:53 -04:00
parent 92d4f1237d
commit 7b18336c6a
14 changed files with 197 additions and 171 deletions
@@ -21,7 +21,7 @@ package org.springframework.security.saml2.core;
*
* @since 5.2
*/
public interface Saml2ErrorCodes {
public final class Saml2ErrorCodes {
/**
* SAML Data does not represent a SAML 2 Response object. A valid XML object was
@@ -29,34 +29,34 @@ public interface Saml2ErrorCodes {
* {@code ResponseType} per specification
* https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf#page=46
*/
String UNKNOWN_RESPONSE_CLASS = "unknown_response_class";
public static final String UNKNOWN_RESPONSE_CLASS = "unknown_response_class";
/**
* The serialized AuthNRequest could not be deserialized correctly.
*
* @since 5.7
*/
String MALFORMED_REQUEST_DATA = "malformed_request_data";
public static final String MALFORMED_REQUEST_DATA = "malformed_request_data";
/**
* The response data is malformed or incomplete. An invalid XML object was received,
* and XML unmarshalling failed.
*/
String MALFORMED_RESPONSE_DATA = "malformed_response_data";
public static final String MALFORMED_RESPONSE_DATA = "malformed_response_data";
/**
* Request is invalid in a general way.
*
* @since 5.6
*/
String INVALID_REQUEST = "invalid_request";
public static final String INVALID_REQUEST = "invalid_request";
/**
* Response is invalid in a general way.
*
* @since 5.5
*/
String INVALID_RESPONSE = "invalid_response";
public static final String INVALID_RESPONSE = "invalid_response";
/**
* Response destination does not match the request URL. A SAML 2 response object was
@@ -64,20 +64,20 @@ public interface Saml2ErrorCodes {
* attribute in the Response object.
* https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf#page=38
*/
String INVALID_DESTINATION = "invalid_destination";
public static final String INVALID_DESTINATION = "invalid_destination";
/**
* The assertion was not valid. The assertion used for authentication failed
* validation. Details around the failure will be present in the error description.
*/
String INVALID_ASSERTION = "invalid_assertion";
public static final String INVALID_ASSERTION = "invalid_assertion";
/**
* The signature of response or assertion was invalid. Either the response or the
* assertion was missing a signature or the signature could not be verified using the
* system's configured credentials. Most commonly the IDP's X509 certificate.
*/
String INVALID_SIGNATURE = "invalid_signature";
public static final String INVALID_SIGNATURE = "invalid_signature";
/**
* The assertion did not contain a subject element. The subject element, type
@@ -86,7 +86,7 @@ public interface Saml2ErrorCodes {
*
* https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf#page=18
*/
String SUBJECT_NOT_FOUND = "subject_not_found";
public static final String SUBJECT_NOT_FOUND = "subject_not_found";
/**
* The subject did not contain a user identifier The assertion contained a subject
@@ -95,7 +95,7 @@ public interface Saml2ErrorCodes {
*
* https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf#page=18
*/
String USERNAME_NOT_FOUND = "username_not_found";
public static final String USERNAME_NOT_FOUND = "username_not_found";
/**
* The system failed to decrypt an assertion or a name identifier. This error code
@@ -103,31 +103,34 @@ public interface Saml2ErrorCodes {
* {@code EncryptedID} fails.
* https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf#page=17
*/
String DECRYPTION_ERROR = "decryption_error";
public static final String DECRYPTION_ERROR = "decryption_error";
/**
* An Issuer element contained a value that didn't
* https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf#page=15
*/
String INVALID_ISSUER = "invalid_issuer";
public static final String INVALID_ISSUER = "invalid_issuer";
/**
* An error happened during validation. Used when internal, non classified, errors are
* caught during the authentication process.
*/
String INTERNAL_VALIDATION_ERROR = "internal_validation_error";
public static final String INTERNAL_VALIDATION_ERROR = "internal_validation_error";
/**
* The relying party registration was not found. The registration ID did not
* correspond to any relying party registration.
*/
String RELYING_PARTY_REGISTRATION_NOT_FOUND = "relying_party_registration_not_found";
public static final String RELYING_PARTY_REGISTRATION_NOT_FOUND = "relying_party_registration_not_found";
/**
* The InResponseTo content of the response does not match the ID of the AuthNRequest.
*
* @since 5.7
*/
String INVALID_IN_RESPONSE_TO = "invalid_in_response_to";
public static final String INVALID_IN_RESPONSE_TO = "invalid_in_response_to";
private Saml2ErrorCodes() {
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,17 +27,17 @@ package org.springframework.security.saml2.core;
* "https://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf">SAML 2.0
* Bindings</a>
*/
public interface Saml2ParameterNames {
public final class Saml2ParameterNames {
/**
* {@code SAMLRequest} - used to request authentication or request logout
*/
String SAML_REQUEST = "SAMLRequest";
public static final String SAML_REQUEST = "SAMLRequest";
/**
* {@code SAMLResponse} - used to respond to an authentication or logout request
*/
String SAML_RESPONSE = "SAMLResponse";
public static final String SAML_RESPONSE = "SAMLResponse";
/**
* {@code RelayState} - used to communicate shared state between the relying and
@@ -46,17 +46,20 @@ public interface Saml2ParameterNames {
* "https://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf#page=8">3.1.1
* Use of RelayState</a>
*/
String RELAY_STATE = "RelayState";
public static final String RELAY_STATE = "RelayState";
/**
* {@code SigAlg} - used to communicate which signature algorithm to use to verify
* signature
*/
String SIG_ALG = "SigAlg";
public static final String SIG_ALG = "SigAlg";
/**
* {@code Signature} - used to supply cryptographic signature on any SAML 2.0 payload
*/
String SIGNATURE = "Signature";
public static final String SIGNATURE = "Signature";
private Saml2ParameterNames() {
}
}