Package com.tnsai.enums
Enum Class AuthType
- All Implemented Interfaces:
Serializable,Comparable<AuthType>,Constable
HTTP authentication types for WEB_SERVICE actions.
All credential values are read from environment variables at runtime.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
NO_AUTH
No authentication required. -
BEARER
Bearer Token Authentication (RFC 6750). Sends token in the Authorization header.Format:
Authorization: Bearer {value from authToken env var}Requires:
authToken- Environment variable name for the bearer token
-
BASIC
Basic Authentication (RFC 7617). Sends username:password as Base64 encoded string in Authorization header.Format:
Authorization: Basic {base64(username:password)}Requires:
authUsername- Environment variable name for usernameauthPassword- Environment variable name for password
-
API_KEY
API Key Authentication. Sends the key in a custom request header named by@WebService.apiKeyHeader()(defaults toX-API-Key).Format:
<apiKeyHeader>: {value from authTokenEnv var}Requires:
authTokenEnv- Environment variable name for the API keyapiKeyHeader- (Optional) custom header name; defaults toX-API-Key
Use this when an upstream API expects a header like
X-API-Key: <value>(or any custom name) rather than a standardAuthorization: Bearer …token.- Since:
- 0.8.3
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-