示例#1
0
        public static async Task <IKeyStore> CreateVaultStore(VaultStoreConfig cfg)
        {
            // exchange the Auth0 access token for a Vault client token
            var vaultClient = new VaultClient(cfg.Url);
            var resp        = await vaultClient.PutAsync <VaultCreateTokenResponse, VaultCreateTokenRequest>("auth/auth0/create_token",
                                                                                                             new VaultCreateTokenRequest
            {
                AccessToken = cfg.AccessToken
            }
                                                                                                             );

            vaultClient.Token = resp.Auth.ClientToken;
            return(new VaultStore(vaultClient, cfg.VaultPrefix));
        }
示例#2
0
 public VaultStore(VaultClient client, string prefix = "")
 {
     this.client = client;
     this.prefix = "entcubbyhole/" + prefix;
 }