Encrypted Files API

Updated 4 months ago by Michael Katz

This topic lists sample queries that read and delete Harness secrets that rely on encrypted files:

This API is currently in Beta. It supports only Get and Delete operations. Where a ! character appears at the end of a parameter's name, this indicates a required parameter.

Get a Secret

This sample retrieves an existing file secret by its ID:

query{
secret(secretId:"txZMBymoS5KLTF2vUs2p0Q",secretType:ENCRYPTED_FILE){
... on EncryptedFile{
name
secretManagerId
id
}
}
}

Get a Secret by Name

This sample uses a secretByName query to retrieve an existing file secret by its name:

query{
secretByName(name:"000-azure-b22-",secretType:ENCRYPTED_FILE){
... on EncryptedFile{
name
secretManagerId
id
}
}
}

Delete a Secret

This sample deletes a specified secret. The required DeleteSecretInput input must supply a secretId and a secretType:

mutation($secret: DeleteSecretInput!){
deleteSecret(input: $secret){
clientMutationId
}
}

Query Variables

Here are query variables for the above deleteSecret operation.

{
"secret": {
"secretId": "Cu8ran5nSqOhxvlcfF2V6A",
"secretType": "ENCRYPTED_FILE"
}
}


How did we do?