Skip to content

Instantly share code, notes, and snippets.

@schaabs
Created April 7, 2019 07:49
Show Gist options
  • Save schaabs/8ace888064db8151f9b40facdf9c6e6c to your computer and use it in GitHub Desktop.
Save schaabs/8ace888064db8151f9b40facdf9c6e6c to your computer and use it in GitHub Desktop.
Secret interface refactoring
export interface Secret extends SecretAttributes
{
/**
* @member {string} [value] The secret value.
*/
value?: string;
}
export interface SecretAttributes extends ParsedKeyVaultEntityIdentifier {
/**
* @member {string} [id] The secret id.
*/
id?: string;
/**
* @member {string} [contentType] The content type of the secret.
*/
contentType?: string;
/**
* @member {boolean} [enabled] Determines whether the object is enabled.
*/
enabled?: boolean;
/**
* @member {Date} [notBefore] Not before date in UTC.
*/
notBefore?: Date;
/**
* @member {Date} [expires] Expiry date in UTC.
*/
expires?: Date;
/**
* @member {Date} [created] Creation time in UTC.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly created?: Date;
/**
* @member {Date} [updated] Last updated time in UTC.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly updated?: Date;
/**
* @member {DeletionRecoveryLevel} [recoveryLevel] Reflects the deletion
* recovery level currently in effect for secrets in the current vault. If it
* contains 'Purgeable', the secret can be permanently deleted by a
* privileged user; otherwise, only the system can purge the secret, at the
* end of the retention interval. Possible values include: 'Purgeable',
* 'Recoverable+Purgeable', 'Recoverable',
* 'Recoverable+ProtectedSubscription'
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly recoveryLevel?: DeletionRecoveryLevel;
/**
* @member {{ [propertyName: string]: string }} [tags] Application specific
* metadata in the form of key-value pairs.
*/
tags?: { [propertyName: string]: string };
/**
* @member {string} [keyId] If this is a secret backing a KV certificate, then
* this field specifies the corresponding key backing the KV certificate.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly keyId?: string;
/**
* @member {boolean} [managed] True if the secret's lifetime is managed by
* key vault. If this is a secret backing a certificate, then managed will be
* true.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly managed?: boolean;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment