Dynamic Attribute Function Reference
Extensions to the Go language templating language.
All functions specified by the Go language template specification are supported by the Service Broker. The service broker also defines some application specific functions as documented below.
Arguments described as optional may be specified as nil
.
registry
The registry
function performs a lookup of a value from the registry.
This function will raise an error if the registry is corrupt or an attempt is made to read a protected key.
{{ registry "key" }}
parameter
The parameter
function looks up a user specified parameter provided with an Open Service Broker API request.
{{ parameter "/path" }}
Arguments
- path
-
The path argument is a JSON pointer identifying a value within a JSON object. The path argument is required and must be a string.
snippet
The snippet
function looks up and renders a configuration template snippet.
This function will raise an error if the snippet does not exist or any error occurs while rendering the snippet.
{{ snippet "template" }}
generatePassword
The generatePassword
function generates a cryptographically secure random password.
{{ generatePassword 32 "12345abcde" }}
generatePrivateKey
The generatePrivateKey
function generates a PEM encoded, cryptographic private key.
RSA, ECDSA and ED25519 are all fully supported.
Password protected private keys are not currently supported.
{{ generatePrivateKey "RSA" "PKCS#8" 2048 }}
Arguments
- type
-
This argument is required and must be one of
RSA
,EllipticP224
,EllipticP256
,EllipticP384
,EllipticP521
orED25519
. - encoding
-
This argument is required and must be one of
PKCS1
,PKCS8
orSEC1
. PKCS#1 can only be used with RSA private keys. PKCS#8 can be used with any private key type. SEC 1 can only be used with elliptic private keys. - bits
-
This argument is optional and must be an integer. It is required for RSA private keys and ignored for all other private key types
generateCertificate
The generateCertificate
function generates an X.509 certificate from a PEM encoded private key.
Only RSA and ECDSA private keys are supported.
Certificates specified without a CA will be self-signed, rather than signed by the CA.
{{ generateCertificate (registry "key.pem") "My CA" "720h" "CA" nil nil nil }}
Arguments
- key
-
This argument is required and must be a string.
- cn
-
This argument is required and must be a string.
- lifetime
-
This argument is required and must be a string. The format of lifetime is defined by the golang duration specification.
- usage
-
This argument is required and must be one of
CA
,Server
orClient
. - sans
-
This argument is optional and must be an array of strings. Subject alternative names are defined as
type:name
wheretype
is one ofDNS
orEMAIL
. Thename
is a valid DNS name or E-mail address respectively. - cakey
-
This argument is optional and must be a string.
- cacert
-
This argument is optional and must be a string.