examples

package module
v2.0.0-...-3914946 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MPL-2.0 Imports: 23 Imported by: 0

README

Examples

A set of examples which demonstrate various aspects of the go-kms-wrapping extras/kms package.

cli

An example go-kms-wrapping extras/kms CLI that demonstrates how to incorporate a Kms into a simple CLI application.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalSqliteFS embed.FS

LocalSqliteFS contains the sql for creating additional sqlite tables for examples.

Functions

func GenerateKey

func GenerateKey() string

GenerateKey will generate an example key

func OpenDB

func OpenDB(ctx context.Context, debug bool) (*dbw.RW, error)

OpenDB returns an open db connection with it's migrations already run

func RootWrapperFromConfig

func RootWrapperFromConfig(ctx context.Context, kmsHcl string, useTransit bool) (wrapping.Wrapper, error)

RootWrapperFromConfig returns the root wrapper from the provided kms hcl

Types

type OIDC

type OIDC struct {
	// PrivateId is used to access the root key
	PrivateId string `json:"private_id,omitempty" gorm:"primary_key"`
	// ClientId is the oidc client id
	ClientId string `json:"client_id,omitempty"`
	// CtClientSecret is the ciphertext of the client_secret
	CtClientSecret []byte `json:"-" gorm:"column:client_secret" wrapping:"ct,client_secret"`
	// ClientSecret is the oidc client secret (plaintext)
	ClientSecret string `json:"client_secret,omitempty" wrapping:"pt,client_secret"`
	// KeyVersionId is the key's version id used to encrypt/decrypt the client secret
	KeyVersionId string `json:"key_version_id,omitempty" gorm:"not_null"`
	// CreateTime from the db
	CreateTime time.Time `json:"create_time,omitempty" gorm:"default:current_timestamp"`
}

OIDC represents the client info for an oidc conn

func (*OIDC) TableName

func (_ *OIDC) TableName() string

type Scope

type Scope struct {
	// PrivateId is used to access the root key
	PrivateId string `json:"private_id,omitempty" gorm:"primary_key"`
	// CreateTime from the db
	CreateTime time.Time `json:"create_time,omitempty" gorm:"default:current_timestamp"`
}

Scope represents an application scope like "global" or some unique id for an org or proj.

func (*Scope) TableName

func (_ *Scope) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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