func (s *secretStore) GetSecret(ctx context.Context,
	id [sha256.Size]byte) ([lsat.SecretSize]byte, error) {

	resp, err := s.Get(ctx, idKey(id))
	if err != nil {
		return [lsat.SecretSize]byte{}, err
	}
	if len(resp.Kvs) == 0 {
		return [lsat.SecretSize]byte{}, mint.ErrSecretNotFound
	}
	if len(resp.Kvs[0].Value) != lsat.SecretSize {
		return [lsat.SecretSize]byte{}, fmt.Errorf("invalid secret "+
			"size %v", len(resp.Kvs[0].Value))
	}

	var secret [lsat.SecretSize]byte
	copy(secret[:], resp.Kvs[0].Value)
	return secret, nil
}
// GetSecret returns the cryptographically random secret that corresponds to the
// given hash. If there is no secret, then mint.ErrSecretNotFound is returned.
GetSecret returns the cryptographically random secret that corresponds to the
given hash. If there is no secret, then mint.ErrSecretNotFound is returned.
// GetSecret returns the cryptographically random secret that corresponds to the // given hash . If there is no secret then mint . ErrSecretNotFound is returned .
func (s *secretStore) GetSecret(ctx context.Context,
	id [sha256.Size]byte) ([lsat.SecretSize]byte, error) {
	resp, err := s.Get(ctx, idKey(id))
	if err != nil {
		return [lsat.SecretSize]byte{}, err
	}
	if len(resp.Kvs) == 0 {
		return [lsat.SecretSize]byte{}, mint.ErrSecretNotFound
	}
	if len(resp.Kvs[0].Value) != lsat.SecretSize {
		return [lsat.SecretSize]byte{}, fmt.Errorf("invalid secret "+
			"size %v", len(resp.Kvs[0].Value))
	}
	var secret [lsat.SecretSize]byte
	copy(secret[:], resp.Kvs[0].Value)
	return secret, nil
}
func ( s * secretStore ) GetSecret ( ctx context . Context , id [ sha256 . Size ] byte ) ( [ lsat . SecretSize ] byte , error ) { resp , err := s . Get ( ctx , idKey ( id ) ) if err != nil { return [ lsat . SecretSize ] byte { } , err } if len ( resp . Kvs ) == 0 { return [ lsat . SecretSize ] byte { } , mint . ErrSecretNotFound } if len ( resp . Kvs [ 0 ] . Value ) != lsat . SecretSize { return [ lsat . SecretSize ] byte { } , fmt . Errorf ( " " + " " , len ( resp . Kvs [ 0 ] . Value ) ) } var secret [ lsat . SecretSize ] byte copy ( secret [ : ] , resp . Kvs [ 0 ] . Value ) return secret , nil }
GetSecret returns the cryptographically random secret that corresponds to the
given hash.
GetSecret returns the cryptographically random secret that corresponds to the given hash .