Skip to main content

%Wallet.KeyValue

persistent class %Wallet.KeyValue extends %Wallet.Secret

SQL Table Name: %Wallet.KeyValue

This %Wallet.Secret type defines storage for a set of key value pairs.
  // create a secret named "MySecret" with the given user & password:
  set status = ##class(%Wallet.KeyValue).Create(
  	"KVTest.MySecret", {
  		"RequireTLS":true,
  		"AllowedHosts":["myserver.example.com"],
  		"Secret":{"user":"neal","password":"my_secret_password"},
  		"Usage":"HTTP"
  })
  
  set http = ##class(%Net.HttpRequest).%New()
  set http.SSLConfiguration = "sslconfig"
  set sc = http.UseSecret("KVTest.MySecret", "basic")
  set sc = http.Get("https://myserver.example.com/some/resource/")
  

Property Inventory

Method Inventory

Properties

property AllowedHosts as %List;
If RequireTLS is true (1) then this secret can only be used sent to hosts specified in this list.
Property methods: AllowedHostsGet(), AllowedHostsGetStored(), AllowedHostsIsValid(), AllowedHostsLogicalToOdbc(), AllowedHostsLogicalToXSD(), AllowedHostsOdbcToLogical(), AllowedHostsXSDToLogical()
property RequireTLS as %Boolean [ InitialExpression = 1 ];
If true (1) TLS must be used when transferred using an HTTP request
Property methods: RequireTLSDisplayToLogical(), RequireTLSGet(), RequireTLSGetStored(), RequireTLSIsValid(), RequireTLSLogicalToDisplay(), RequireTLSLogicalToXSD(), RequireTLSNormalize(), RequireTLSSet(), RequireTLSXSDToLogical()
property Usage as %Integer (MAXVAL = "$$$KVUsageAllInt", MINVAL = 0) [ InitialExpression = $$$KVUsageAllInt ];
This property restricts the ways in which this secret can be used. See Create() for details.
Property methods: UsageDisplayToLogical(), UsageGet(), UsageGetStored(), UsageIsValid(), UsageLogicalToDisplay(), UsageNormalize(), UsageXSDToLogical()

Methods

method AllowedHostsSet(val As %String) as %Status
classmethod Create(name As %String, ByRef properties) as %Status
Create a secret based on a set of key value pairs.
  // create a secret named "MySecret" with the given user & password:
  set status = ##class(%Wallet.KeyValue).Create(
  	"KVTest.MySecret", {
  		"RequireTLS":true,
  		"AllowedHosts":["myserver.example.com"],
  		"Secret":{"user":"neal","password":"my_secret_password"},
  		"Usage":["HTTP","SOAP","SQL"]
   })
  
Available properties:
  • Resource required - Defined in %Wallet.Secret: the resource required to use this secret.
  • Secret required - The secret. This should be specified as a %DynamicObject.
  • RequireTLS optional - Boolean value inidicating whether the secret requires a TLS connection for HTTP or SOAP usage. Default is 1 (true).
  • AllowedHosts optional - List of hosts this secret can be used with. This is ignored if RequireTLS is false. If this is specified, then the %Net.HttpRequest object must have SSLCheckServerIdentity set to true.
  • Usage - optional - List of ways this secret can be used. This can be specified as a %DynamicArray or as a comma separated list of strings. Possible values are:
    • HTTP - can be used with %Net.HttpRequest
    • SOAP - can be use with SOAP clients %SOAP.WebClient
    • SQL - can be used with SQL Gateway connections
classmethod GetSecretValue(name As %String) as %String
Returns the value of the stored secret. To succeed, the secret must have "CUSTOM" usage enabled, or the caller must have %Admin_Wallet:USE. If successful, the secret value will be returned. On error an exception will be thrown.
classmethod UpdateSecret(name As %String, value As %DynamicObject) as %Status
Merge the key/value pairs stored by the named secret with the specified values.
method UsageSet(val As %String) as %Status

Inherited Members

Inherited Properties

Inherited Methods

Storage

Gray indicates storage defined by superclasses.

Storage Model: Storage (%Wallet.Secret)

^|$$$SecurityMapWallet|WALLET("SecretD")(ID)
=
%%CLASSNAME
Storage
Collection
Version

Storage Model: Storage (%Wallet.KeyValue)

^|$$$SecurityMapWallet|WALLET("SecretD")(ID,"KeyValue")
=
RequireTLS
AllowedHosts
Usage
FeedbackOpens in a new tab