public class SecurityCredentials extends java.lang.Object implements SecurityCredentialsContainer
Modifier and Type | Field and Description |
---|---|
static SecurityCredentials |
NONE
No credentials given.
|
Constructor and Description |
---|
SecurityCredentials(java.lang.String name,
java.lang.String type,
java.lang.String identifier,
char[] secret)
Creates BasicAuth credentials without a proxy.
|
SecurityCredentials(java.lang.String name,
java.lang.String type,
java.lang.String identifier,
char[] secret,
java.util.Map<java.lang.String,java.lang.Object> properties,
java.net.Proxy proxy)
Creates BasicAuth credentials with a proxy.
|
Modifier and Type | Method and Description |
---|---|
static SecurityCredentials |
basicAuth(java.lang.String identifier,
char[] secret)
Creates BasicAuth credentials.
|
boolean |
equals(java.lang.Object o) |
void |
eraseCredentials()
Get called, if the secret information should be erased.
|
static SecurityCredentials |
fromJson(JsonValue jsonValue)
Creates a SecurityCredentials from a JSON.
|
java.lang.String |
getIdentifier() |
java.lang.String |
getName() |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties() |
boolean |
getPropertyBool(java.lang.String key)
Returns the property as boolean.
|
char[] |
getPropertyChars(java.lang.String key)
Returns the property as characters.
|
java.lang.Number |
getPropertyNum(java.lang.String key)
Returns the property as Number.
|
java.lang.String |
getPropertyStr(java.lang.String key)
Returns the property as String.
|
java.net.Proxy |
getProxy() |
char[] |
getSecret() |
java.lang.String |
getType() |
int |
hashCode() |
public static final SecurityCredentials NONE
public SecurityCredentials(java.lang.String name, java.lang.String type, java.lang.String identifier, char[] secret)
name
- Name of the credentialstype
- The type of authentication and access process (e.g. "basicauth" or "oauth2")identifier
- username, clientId, ...secret
- the secret information to authenticate the client or userpublic SecurityCredentials(java.lang.String name, java.lang.String type, java.lang.String identifier, char[] secret, java.util.Map<java.lang.String,java.lang.Object> properties, java.net.Proxy proxy)
name
- Name of the credentialstype
- The type of authentication and access process (e.g. "basicauth" or "oauth2")identifier
- username, clientId, ...secret
- the secret information to authenticate the client or userproxy
- proxy configurationpublic static SecurityCredentials basicAuth(java.lang.String identifier, char[] secret)
identifier
- the basic auth user name.secret
- passwordpublic static SecurityCredentials fromJson(JsonValue jsonValue)
Example:
{ "name": "jenkins", "identifier": "alice", "secret": "secret", "proxy": { "type": "socket", "address": "192.168.1.250", "port": 8080 } }
jsonValue
- a JSON structurepublic java.lang.String getName()
public java.lang.String getType()
public java.lang.String getIdentifier()
public char[] getSecret()
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
public java.lang.String getPropertyStr(java.lang.String key)
key
- Name of the propertypublic char[] getPropertyChars(java.lang.String key)
key
- Name of the propertypublic boolean getPropertyBool(java.lang.String key)
key
- Name of the propertypublic java.lang.Number getPropertyNum(java.lang.String key)
key
- Name of the propertypublic java.net.Proxy getProxy()
public void eraseCredentials()
SecurityCredentialsContainer
eraseCredentials
in interface SecurityCredentialsContainer
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object