Skip to content

security Submodule

Classes

Sops

Static Functions

Name Description
exportDecryptedValues Returns a helper string that can be embedded into jobs to allow exporting values that are decrypted using sops, for example: 'export $(sops -d sops/encrypted_file.env)'.

exportDecryptedValues
1
2
3
import { security } from '@gcix/gcix'

security.Sops.exportDecryptedValues(path: string, installSops?: boolean, downloadUrl?: string)

Returns a helper string that can be embedded into jobs to allow exporting values that are decrypted using sops, for example: 'export $(sops -d sops/encrypted_file.env)'.

This function is useful if you want to use environment variables to authenticate, for instance, with a container registry.

The script has been successfully tested with SOPS version 3.7 and is intentionally NOT COMPATIBLE with SOPS version 3.6. This is due to a bug in the latter version, which wraps the values to be exported in quotes.

pathRequired
  • Type: string

Path to the sops-encrypted file.

The path must be relative to the project directory.


installSopsOptional
  • Type: boolean

Enable downloading sops from the provided download_url.ue.


downloadUrlOptional
  • Type: string

Download URL to acquire sops from.

Defaults to the GitHub Mozilla SOPS releases.