Skip to content

Nyoroon/yc-lockbox-unpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yc-lockbox-struct

Library to populate struct fields from Yandex.Cloud Lockbox Secret Payload.

How to use

  1. Define struct:
    type testSecret struct {
        Text   string `secretKey:"testText"`
        Binary []byte `secretKey:"testFile"`
    }
  2. Request secret payload and extract secrets to variable:
    payload, err := sdk.LockboxPayload().Payload().Get(ctx, &lockbox.GetPayloadRequest{SecretId: "mysecretid"})
    if err != nil {
        log.Fatalf("Unable to get secret: %v", err)
    }
    
    secret := testSecret{}
    if err := yc_lockbox_unpack.UnpackPayload(payload, &secret); err != nil {
        log.Fatalf("Unable to unpack secret: %v", err)
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages