Class SecretConfig
java.lang.Object
com.inductiveautomation.ignition.gateway.secrets.SecretConfig
- Direct Known Subclasses:
SecretConfig.Embedded,SecretConfig.Referenced
public abstract sealed class SecretConfig
extends Object
permits SecretConfig.Embedded, SecretConfig.Referenced
Configuration describing a secret. There are two types:
- Embedded - ciphertext secret is embedded within this config
- Referenced - reference to a named secret in a secret provider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAn EmbeddedSecretConfigwhich encapsulates the ciphertext secret value encrypted using theSystemEncryptionServicestatic classAJsonSerializerandJsonDeserializerimplementation for JSON-serializing and deserializing instances ofSecretConfigusing Gsonstatic final classA ReferencedSecretConfigwhich encapsulates the name of the SecretProvider and the name of the Secret within the Secret Provider where the secret value lives.static enumThe type of SecretConfig: Embedded or Referenced -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SecretConfig.Embeddedembedded(com.inductiveautomation.ignition.common.gson.JsonElement ciphertext) Factory method for creating a new instance of anSecretConfig.Embeddedsecret config given the ciphertext secret retrieved from a call toSystemEncryptionService.encryptToJson(Plaintext).static SecretConfigfromJsonTree(com.inductiveautomation.ignition.common.gson.JsonElement jsonElement) Decode a newSecretConfiginstance from aJsonElementstatic com.inductiveautomation.ignition.common.gson.JsonObjectgetJsonSchema(boolean nullable) abstract SecretConfig.TypegetType()booleanbooleanstatic SecretConfig.Referencedreferenced(String providerName, String secretName) Factory method for creating a new instance of aSecretConfig.Referencedsecret config given the name of the secret provider and the name of the secret stored in the provider.com.inductiveautomation.ignition.common.gson.JsonElement
-
Field Details
-
TYPE
- See Also:
-
DATA
- See Also:
-
PROVIDER_NAME
- See Also:
-
SECRET_NAME
- See Also:
-
-
Constructor Details
-
SecretConfig
public SecretConfig()
-
-
Method Details
-
getType
- Returns:
- the
SecretConfig.Typeof thisSecretConfiginstance. never null.
-
isEmbedded
public boolean isEmbedded()- Returns:
- true if this
SecretConfigis an instance ofSecretConfig.Embedded
-
getAsEmbedded
- Returns:
- this
SecretConfigas an instance ofSecretConfig.Embedded. never null. - Throws:
UnsupportedOperationException- if thisSecretConfigis not an instance ofSecretConfig.Embedded
-
isReferenced
public boolean isReferenced()- Returns:
- true if this
SecretConfigis an instance ofSecretConfig.Referenced
-
getAsReferenced
- Returns:
- this
SecretConfigas an instance ofSecretConfig.Referenced. never null. - Throws:
UnsupportedOperationException- if thisSecretConfigis not an instance ofSecretConfig.Referenced
-
toJsonTree
public com.inductiveautomation.ignition.common.gson.JsonElement toJsonTree()- Returns:
- this
SecretConfigencoded as aJsonElement. never null.
-
fromJsonTree
public static SecretConfig fromJsonTree(com.inductiveautomation.ignition.common.gson.JsonElement jsonElement) Decode a newSecretConfiginstance from aJsonElement- Parameters:
jsonElement- theJsonElementto parse. must not be null.- Returns:
- a new instance of
SecretConfigparsed from the givenJsonElement. never null. - Throws:
com.inductiveautomation.ignition.common.gson.JsonParseException- if the givenJsonElementcould not be parsed into a new instance ofSecretConfigUnsupportedOperationException- if the givenJsonElementcould not be parsed into a new instance ofSecretConfig
-
embedded
public static SecretConfig.Embedded embedded(com.inductiveautomation.ignition.common.gson.JsonElement ciphertext) Factory method for creating a new instance of anSecretConfig.Embeddedsecret config given the ciphertext secret retrieved from a call toSystemEncryptionService.encryptToJson(Plaintext).- Parameters:
ciphertext- the ciphertext secret. cannot be null.- Returns:
- a new instance of an
SecretConfig.Embeddedsecret config with the given ciphertext secret. never null. - Throws:
NullPointerException- if the given ciphertext argument is null
-
referenced
Factory method for creating a new instance of aSecretConfig.Referencedsecret config given the name of the secret provider and the name of the secret stored in the provider.- Parameters:
providerName- the name of the secret provider where the secret is stored. cannot be null.secretName- the name of the secret stored in the secret provider. cannot be null.- Returns:
- a new instance of a
SecretConfig.Referencedsecret config pointing to the target secret provider and secret. never null. - Throws:
NullPointerException- if either the providerName or secretNames arguments are null
-
getJsonSchema
public static com.inductiveautomation.ignition.common.gson.JsonObject getJsonSchema(boolean nullable) - Returns:
- a new copy of the JSON Schema for the
SecretConfig. never null.
-