sidekick_vault 1.4.0
sidekick_vault: ^1.4.0 copied to clipboard
Sidekick plugin managing project secrets stored GPG encrypted in the project/repo
import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_vault/sidekick_vault.dart';
void main() {
final vault = SidekickVault(
location: SidekickContext.projectRoot.directory('vault'),
// environment variable where CIs can inject the vault password
environmentVariableName: 'FLT_VAULT_PASSPHRASE',
);
// define encrypted files in vault
final EncryptedVaultString encrypted = vault.encryptedString('secret.txt');
// access the text prompts the password
print(encrypted.text);
// directly decrypt (prompts password immediately)
final secret = vault.loadText('secret.txt');
print(secret);
}