Package org.refcodes.net
Interface AuthTypeCredentials<T extends AuthTypeCredentials<T,V>,V extends org.refcodes.mixin.Validatable<V>>
-
- Type Parameters:
T
- The implementing type to be e.g. returned by according builder methods and Super-Type of V.V
- The lest common super-type of T which can be used to validate credentials.
- All Superinterfaces:
AuthTypeAccessor
,org.refcodes.mixin.Validatable<V>
- All Known Subinterfaces:
BasicAuthCredentials
,BasicAuthCredentials.BasicAuthCredentialsBuilder
,BearerAuthCredentials
- All Known Implementing Classes:
BasicAuthCredentialsBuilderImpl
,BasicAuthCredentialsImpl
,BeararAuthCredentialsImpl
public interface AuthTypeCredentials<T extends AuthTypeCredentials<T,V>,V extends org.refcodes.mixin.Validatable<V>> extends org.refcodes.mixin.Validatable<V>, AuthTypeAccessor
The Interface AuthTypeCredentials.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.AuthTypeAccessor
AuthTypeAccessor.AuthTypeBuilder<B extends AuthTypeAccessor.AuthTypeBuilder<B>>, AuthTypeAccessor.AuthTypeMutator, AuthTypeAccessor.AuthTypeProperty
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
fromHttpAuthorization(String aHttpAuthorization)
Initializes thisAuthTypeCredentials
instance from theHeaderField.AUTHORIZATION
Header-Fields's value.String
toHttpAuthorization()
Creates aHeaderField.AUTHORIZATION
HTTP Header-Field value from theAuthTypeCredentials
instance.void
validate(V aCredentials)
Validates the providedBasicCredentials
with thisBasicAuthCredentials
viaValidatable.isValid(Object)
.T
withHttpAuthorization(String aHttpAuthorization)
Initializes thisAuthTypeCredentials
instance from theHeaderField.AUTHORIZATION
Header-Fields's value.-
Methods inherited from interface org.refcodes.net.AuthTypeAccessor
getAuthType
-
-
-
-
Method Detail
-
toHttpAuthorization
String toHttpAuthorization()
Creates aHeaderField.AUTHORIZATION
HTTP Header-Field value from theAuthTypeCredentials
instance.- Returns:
- The according HTTP Header-Field's value.
-
fromHttpAuthorization
void fromHttpAuthorization(String aHttpAuthorization) throws IllegalArgumentException
Initializes thisAuthTypeCredentials
instance from theHeaderField.AUTHORIZATION
Header-Fields's value.- Parameters:
aHttpAuthorization
- TheHeaderField.AUTHORIZATION
header field's value- Throws:
IllegalArgumentException
- The value does not conform the the HTTP Authorization Header-Field's Basic-Authentication format.
-
withHttpAuthorization
T withHttpAuthorization(String aHttpAuthorization) throws IllegalArgumentException
Initializes thisAuthTypeCredentials
instance from theHeaderField.AUTHORIZATION
Header-Fields's value.- Parameters:
aHttpAuthorization
- TheHeaderField.AUTHORIZATION
header field's value- Returns:
- the t
- Throws:
IllegalArgumentException
- The value does not conform the the HTTP Authorization Header-Field's Basic-Authentication format.
-
validate
void validate(V aCredentials) throws ForbiddenException
Validates the providedBasicCredentials
with thisBasicAuthCredentials
viaValidatable.isValid(Object)
. In case the providedBasicCredentials
are not valid, then aForbiddenException
is thrown.- Parameters:
aCredentials
- TheBasicCredentials
to be verified.- Throws:
ForbiddenException
- thrown in case the providedBasicCredentials
do not match.
-
-