keys

package
v0.0.0-...-b0b0eab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ApiKeyPrefix      = "e2b_"
	AccessTokenPrefix = "sk_e2b_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HMACSha256Hashing

type HMACSha256Hashing struct {
	// contains filtered or unexported fields
}

func NewHMACSHA256Hashing

func NewHMACSHA256Hashing(key []byte) *HMACSha256Hashing

func (*HMACSha256Hashing) Hash

func (h *HMACSha256Hashing) Hash(content []byte) (string, error)

type Hasher

type Hasher interface {
	Hash(key []byte) string
}

type Key

type Key struct {
	PrefixedRawValue string
	HashedValue      string
	Masked           MaskedIdentifier
}

func GenerateKey

func GenerateKey(prefix string) (Key, error)

type MaskedIdentifier

type MaskedIdentifier struct {
	Prefix            string
	ValueLength       int
	MaskedValuePrefix string
	MaskedValueSuffix string
}

func MaskKey

func MaskKey(prefix, value string) (MaskedIdentifier, error)

MaskKey returns identifier masking properties in accordance to the OpenAPI response spec

type Sha256Hashing

type Sha256Hashing struct{}

func NewSHA256Hashing

func NewSHA256Hashing() *Sha256Hashing

func (*Sha256Hashing) Hash

func (h *Sha256Hashing) Hash(key []byte) string

func (*Sha256Hashing) HashWithoutPrefix

func (h *Sha256Hashing) HashWithoutPrefix(key []byte) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL