Documentation
¶
Overview ¶
Package testusers holds the tagged structs the encrypt tests encrypt through the generated API: a record in separate columns, an opaque struct, and a probe struct with one field of each scalar type for the term ordering tests. The *_stash.go files beside them are what stashgen writes from the tags; `go generate ./...` rewrites them, and CI fails when that changes a file.
Index ¶
- Variables
- func DecryptMember(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedMember) ([]testmember.Member, error)
- type Account
- type AccountEmailField
- type AgeField
- func (f AgeField) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint32) (EncryptedUserAge, error)
- func (f AgeField) Equality(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.EqualityTerm, error)
- func (f AgeField) Ore(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error)
- type Blob
- type Contact
- type ContactEmailField
- type ContactNotesField
- type Document
- type Email
- type EmailField
- func (f EmailField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedUserEmail, error)
- func (f EmailField) Equality(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.EqualityTerm, error)
- func (f EmailField) Match(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.MatchTerm, error)
- type EncryptedAccount
- type EncryptedAccountEmail
- type EncryptedContact
- type EncryptedContactNotes
- type EncryptedDocument
- type EncryptedEverything
- type EncryptedKinds
- type EncryptedKindsBl
- type EncryptedKindsBo
- type EncryptedKindsBy
- type EncryptedKindsD
- type EncryptedKindsE
- type EncryptedKindsF32
- type EncryptedKindsF64
- type EncryptedKindsI
- type EncryptedKindsI8
- type EncryptedKindsI16
- type EncryptedKindsI32
- type EncryptedKindsI64
- type EncryptedKindsS
- type EncryptedKindsSc
- type EncryptedKindsSt
- type EncryptedKindsU
- type EncryptedKindsU8
- type EncryptedKindsU16
- type EncryptedKindsU32
- type EncryptedKindsU64
- type EncryptedLookup
- type EncryptedLookupCode
- type EncryptedLookupEmail
- type EncryptedLookupScore
- type EncryptedMember
- type EncryptedMemberAge
- type EncryptedMemberEmail
- type EncryptedMemberNotes
- type EncryptedNote
- type EncryptedNoteText
- type EncryptedProbe
- type EncryptedProbeB
- type EncryptedProbeI64
- type EncryptedProbeS
- type EncryptedProbeU32
- type EncryptedProbeU64
- type EncryptedProfile
- type EncryptedSecret
- type EncryptedSecretValue
- type EncryptedUser
- type EncryptedUserAge
- type EncryptedUserEmail
- type EncryptedUserNotes
- type Everything
- type Inner
- type Kinds
- type KindsBlField
- type KindsBoField
- type KindsByField
- type KindsDField
- type KindsEField
- func (f KindsEField) Encrypt(ctx context.Context, c *encrypt.Cipher, v Email) (EncryptedKindsE, error)
- func (f KindsEField) Equality(ctx context.Context, c *encrypt.Cipher, v Email) (encrypt.EqualityTerm, error)
- func (f KindsEField) Match(ctx context.Context, c *encrypt.Cipher, v Email) (encrypt.MatchTerm, error)
- func (f KindsEField) Ore(ctx context.Context, c *encrypt.Cipher, v Email) (encrypt.OreTerm, error)
- type KindsF32Field
- type KindsF64Field
- type KindsI8Field
- func (f KindsI8Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v int8) (EncryptedKindsI8, error)
- func (f KindsI8Field) Equality(ctx context.Context, c *encrypt.Cipher, v int8) (encrypt.EqualityTerm, error)
- func (f KindsI8Field) Ore(ctx context.Context, c *encrypt.Cipher, v int8) (encrypt.OreTerm, error)
- type KindsI16Field
- type KindsI32Field
- type KindsI64Field
- type KindsIField
- type KindsSField
- func (f KindsSField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedKindsS, error)
- func (f KindsSField) Equality(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.EqualityTerm, error)
- func (f KindsSField) Match(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.MatchTerm, error)
- type KindsScField
- type KindsStField
- type KindsU8Field
- type KindsU16Field
- type KindsU32Field
- func (f KindsU32Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint32) (EncryptedKindsU32, error)
- func (f KindsU32Field) Equality(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.EqualityTerm, error)
- func (f KindsU32Field) Ore(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error)
- type KindsU64Field
- type KindsUField
- type Lookup
- type LookupCodeField
- type LookupEmailField
- type LookupScoreField
- type MemberAgeField
- func (f MemberAgeField) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint32) (EncryptedMemberAge, error)
- func (f MemberAgeField) Equality(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.EqualityTerm, error)
- func (f MemberAgeField) Ore(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error)
- type MemberEmailField
- func (f MemberEmailField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedMemberEmail, error)
- func (f MemberEmailField) Equality(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.EqualityTerm, error)
- func (f MemberEmailField) Match(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.MatchTerm, error)
- type MemberNotesField
- type Note
- type NoteTextField
- type NotesField
- type Probe
- type ProbeBField
- func (f ProbeBField) Encrypt(ctx context.Context, c *encrypt.Cipher, v []byte) (EncryptedProbeB, error)
- func (f ProbeBField) Ope(ctx context.Context, c *encrypt.Cipher, v []byte) (encrypt.OpeTerm, error)
- func (f ProbeBField) Ore(ctx context.Context, c *encrypt.Cipher, v []byte) (encrypt.OreTerm, error)
- type ProbeI64Field
- func (f ProbeI64Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v int64) (EncryptedProbeI64, error)
- func (f ProbeI64Field) Ope(ctx context.Context, c *encrypt.Cipher, v int64) (encrypt.OpeTerm, error)
- func (f ProbeI64Field) Ore(ctx context.Context, c *encrypt.Cipher, v int64) (encrypt.OreTerm, error)
- type ProbeSField
- func (f ProbeSField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedProbeS, error)
- func (f ProbeSField) Ope(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.OpeTerm, error)
- func (f ProbeSField) Ore(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.OreTerm, error)
- type ProbeU32Field
- func (f ProbeU32Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint32) (EncryptedProbeU32, error)
- func (f ProbeU32Field) Ope(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OpeTerm, error)
- func (f ProbeU32Field) Ore(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error)
- type ProbeU64Field
- func (f ProbeU64Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint64) (EncryptedProbeU64, error)
- func (f ProbeU64Field) Ope(ctx context.Context, c *encrypt.Cipher, v uint64) (encrypt.OpeTerm, error)
- func (f ProbeU64Field) Ore(ctx context.Context, c *encrypt.Cipher, v uint64) (encrypt.OreTerm, error)
- type Profile
- type ProfileActiveField
- type ProfileBalanceField
- type ProfileNameField
- type ProfileNoteField
- type ProfileRatioField
- type ProfileScoreField
- type ProfileVisitsField
- type Score
- type Secret
- type SecretValueField
- type Status
- type User
- type UserRow
Constants ¶
This section is empty.
Variables ¶
var AccountFields = struct { Email AccountEmailField }{ Email: AccountEmailField{gensupport.NewField[string](accountDeclaration, "email")}, }
var ContactFields = struct { Email ContactEmailField Notes ContactNotesField }{ Email: ContactEmailField{gensupport.NewField[string](contactDeclaration, "email")}, Notes: ContactNotesField{gensupport.NewField[string](contactDeclaration, "notes")}, }
var Fields = struct { Age AgeField Email EmailField Notes NotesField }{ Age: AgeField{gensupport.NewField[uint32](declaration, "age")}, Email: EmailField{gensupport.NewField[string](declaration, "email")}, Notes: NotesField{gensupport.NewField[string](declaration, "notes")}, }
var KindsFields = struct { S KindsSField E KindsEField Bo KindsBoField I8 KindsI8Field I16 KindsI16Field I32 KindsI32Field I KindsIField I64 KindsI64Field U8 KindsU8Field U16 KindsU16Field U32 KindsU32Field U KindsUField U64 KindsU64Field F32 KindsF32Field F64 KindsF64Field By KindsByField Bl KindsBlField Sc KindsScField St KindsStField D KindsDField }{ S: KindsSField{gensupport.NewField[string](kindsDeclaration, "s")}, E: KindsEField{gensupport.NewField[Email](kindsDeclaration, "e")}, Bo: KindsBoField{gensupport.NewField[bool](kindsDeclaration, "bo")}, I8: KindsI8Field{gensupport.NewField[int8](kindsDeclaration, "i8")}, I16: KindsI16Field{gensupport.NewField[int16](kindsDeclaration, "i16")}, I32: KindsI32Field{gensupport.NewField[int32](kindsDeclaration, "i32")}, I: KindsIField{gensupport.NewField[int](kindsDeclaration, "i")}, I64: KindsI64Field{gensupport.NewField[int64](kindsDeclaration, "i64")}, U8: KindsU8Field{gensupport.NewField[uint8](kindsDeclaration, "u8")}, U16: KindsU16Field{gensupport.NewField[uint16](kindsDeclaration, "u16")}, U32: KindsU32Field{gensupport.NewField[uint32](kindsDeclaration, "u32")}, U: KindsUField{gensupport.NewField[uint](kindsDeclaration, "u")}, U64: KindsU64Field{gensupport.NewField[uint64](kindsDeclaration, "u64")}, F32: KindsF32Field{gensupport.NewField[float32](kindsDeclaration, "f32")}, F64: KindsF64Field{gensupport.NewField[float64](kindsDeclaration, "f64")}, By: KindsByField{gensupport.NewField[[]byte](kindsDeclaration, "by")}, Bl: KindsBlField{gensupport.NewField[Blob](kindsDeclaration, "bl")}, Sc: KindsScField{gensupport.NewField[Score](kindsDeclaration, "sc")}, St: KindsStField{gensupport.NewField[Status](kindsDeclaration, "st")}, D: KindsDField{gensupport.NewField[time.Duration](kindsDeclaration, "d")}, }
var LookupFields = struct { Email LookupEmailField Score LookupScoreField Code LookupCodeField }{ Email: LookupEmailField{gensupport.NewField[string](lookupDeclaration, "email")}, Score: LookupScoreField{gensupport.NewField[int32](lookupDeclaration, "score")}, Code: LookupCodeField{gensupport.NewField[Status](lookupDeclaration, "code")}, }
var MemberFields = struct { Age MemberAgeField Email MemberEmailField Notes MemberNotesField }{ Age: MemberAgeField{gensupport.NewField[uint32](memberDeclaration, "age")}, Email: MemberEmailField{gensupport.NewField[string](memberDeclaration, "email")}, Notes: MemberNotesField{gensupport.NewField[string](memberDeclaration, "notes")}, }
var NoteFields = struct { Text NoteTextField }{ Text: NoteTextField{gensupport.NewField[string](noteDeclaration, "text")}, }
var ProbeFields = struct { U32 ProbeU32Field U64 ProbeU64Field I64 ProbeI64Field S ProbeSField B ProbeBField }{ U32: ProbeU32Field{gensupport.NewField[uint32](probeDeclaration, "u32")}, U64: ProbeU64Field{gensupport.NewField[uint64](probeDeclaration, "u64")}, I64: ProbeI64Field{gensupport.NewField[int64](probeDeclaration, "i64")}, S: ProbeSField{gensupport.NewField[string](probeDeclaration, "s")}, B: ProbeBField{gensupport.NewField[[]byte](probeDeclaration, "b")}, }
var ProfileFields = struct { Visits ProfileVisitsField Balance ProfileBalanceField Active ProfileActiveField Ratio ProfileRatioField Score ProfileScoreField Note ProfileNoteField Name ProfileNameField }{ Visits: ProfileVisitsField{gensupport.NewField[int32](profileDeclaration, "visits")}, Balance: ProfileBalanceField{gensupport.NewField[int64](profileDeclaration, "balance")}, Active: ProfileActiveField{gensupport.NewField[bool](profileDeclaration, "active")}, Ratio: ProfileRatioField{gensupport.NewField[float32](profileDeclaration, "ratio")}, Score: ProfileScoreField{gensupport.NewField[float64](profileDeclaration, "score")}, Note: ProfileNoteField{gensupport.NewField[string](profileDeclaration, "note")}, Name: ProfileNameField{gensupport.NewField[string](profileDeclaration, "name")}, }
var SecretFields = struct { Value SecretValueField }{ Value: SecretValueField{gensupport.NewField[string](secretDeclaration, "value")}, }
Functions ¶
func DecryptMember ¶
func DecryptMember(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedMember) ([]testmember.Member, error)
DecryptMember opens each EncryptedMember, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
Types ¶
type Account ¶
type Account struct {
ID uint `stash:"id,passthrough"`
CreatedAt time.Time `stash:"created_at,passthrough"`
DeletedAt sql.NullTime `stash:"deleted_at,passthrough"`
Email string `stash:"email,encrypt,index=equality"`
// contains filtered or unexported fields
}
Account is the shape of the plan's accounts example: passthrough fields whose types the FFI codec cannot carry (a time.Time, a driver.Valuer), kept on the host and returned as they are.
func DecryptAccount ¶
func DecryptAccount(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedAccount) ([]Account, error)
DecryptAccount opens each EncryptedAccount, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type AccountEmailField ¶
type AccountEmailField struct {
// contains filtered or unexported fields
}
func (AccountEmailField) Encrypt ¶
func (f AccountEmailField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedAccountEmail, error)
type AgeField ¶
type AgeField struct {
// contains filtered or unexported fields
}
type Blob ¶
type Blob []byte
Defined types over scalars: the engine returns the underlying type and the generated code converts.
type Contact ¶
type Contact struct {
ID int64 `stash:"id,passthrough"`
Email string `stash:"email,encrypt_into=TextEq"`
Notes string `stash:"notes,encrypt"`
// contains filtered or unexported fields
}
Contact is one row with an email stored as an EQL value, the shape the cross-language fixture packages/eql/tests/encryption/fixtures/text_eq_query.json is derived under (table users, column email). Its generated file imports encrypt/eql, so the encrypt test binary links the guest build with the EQL types; the tests that want the build without them load it by name.
func DecryptContact ¶
func DecryptContact(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedContact) ([]Contact, error)
DecryptContact opens each EncryptedContact, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type ContactEmailField ¶
type ContactEmailField struct {
// contains filtered or unexported fields
}
type ContactNotesField ¶
type ContactNotesField struct {
// contains filtered or unexported fields
}
func (ContactNotesField) Encrypt ¶
func (f ContactNotesField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedContactNotes, error)
type Document ¶
type Document struct {
Title string
Body string
Tags []string
// contains filtered or unexported fields
}
Document is sealed as one value.
func DecryptDocument ¶
func DecryptDocument(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedDocument) ([]Document, error)
DecryptDocument opens each EncryptedDocument, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type Email ¶
type Email string
Defined types over scalars: the engine returns the underlying type and the generated code converts.
type EmailField ¶
type EmailField struct {
// contains filtered or unexported fields
}
func (EmailField) Encrypt ¶
func (f EmailField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedUserEmail, error)
type EncryptedAccount ¶
type EncryptedAccount struct {
ID uint
CreatedAt time.Time
DeletedAt sql.NullTime
Email EncryptedAccountEmail
}
func EncryptAccount ¶
func EncryptAccount(ctx context.Context, cipher *encrypt.Cipher, values []Account) ([]EncryptedAccount, error)
EncryptAccount seals each Account, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedAccount) LogValue ¶
func (e EncryptedAccount) LogValue() slog.Value
func (EncryptedAccount) String ¶
func (e EncryptedAccount) String() string
type EncryptedAccountEmail ¶
type EncryptedAccountEmail struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
}
type EncryptedContact ¶
type EncryptedContact struct {
ID int64
Email eql.TextEq
Notes EncryptedContactNotes
}
func EncryptContact ¶
func EncryptContact(ctx context.Context, cipher *encrypt.Cipher, values []Contact) ([]EncryptedContact, error)
EncryptContact seals each Contact, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedContact) LogValue ¶
func (e EncryptedContact) LogValue() slog.Value
func (EncryptedContact) String ¶
func (e EncryptedContact) String() string
type EncryptedContactNotes ¶
type EncryptedContactNotes struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedDocument ¶
type EncryptedDocument struct {
Sealed encrypt.Ciphertext
}
func EncryptDocument ¶
func EncryptDocument(ctx context.Context, cipher *encrypt.Cipher, values []Document) ([]EncryptedDocument, error)
EncryptDocument seals each Document, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedDocument) LogValue ¶
func (e EncryptedDocument) LogValue() slog.Value
func (EncryptedDocument) String ¶
func (e EncryptedDocument) String() string
type EncryptedEverything ¶
type EncryptedEverything struct {
Sealed encrypt.Ciphertext
}
func EncryptEverything ¶
func EncryptEverything(ctx context.Context, cipher *encrypt.Cipher, values []Everything) ([]EncryptedEverything, error)
EncryptEverything seals each Everything, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedEverything) LogValue ¶
func (e EncryptedEverything) LogValue() slog.Value
func (EncryptedEverything) String ¶
func (e EncryptedEverything) String() string
type EncryptedKinds ¶
type EncryptedKinds struct {
S EncryptedKindsS
E EncryptedKindsE
Bo EncryptedKindsBo
I8 EncryptedKindsI8
I16 EncryptedKindsI16
I32 EncryptedKindsI32
I EncryptedKindsI
I64 EncryptedKindsI64
U8 EncryptedKindsU8
U16 EncryptedKindsU16
U32 EncryptedKindsU32
U EncryptedKindsU
U64 EncryptedKindsU64
F32 EncryptedKindsF32
F64 EncryptedKindsF64
By EncryptedKindsBy
Bl EncryptedKindsBl
Sc EncryptedKindsSc
St EncryptedKindsSt
D EncryptedKindsD
P *int
M map[string]string
T time.Time
N sql.NullTime
In Inner
Sk []Inner
A any
Er error
}
func EncryptKinds ¶
func EncryptKinds(ctx context.Context, cipher *encrypt.Cipher, values []Kinds) ([]EncryptedKinds, error)
EncryptKinds seals each Kinds, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedKinds) LogValue ¶
func (e EncryptedKinds) LogValue() slog.Value
func (EncryptedKinds) String ¶
func (e EncryptedKinds) String() string
type EncryptedKindsBl ¶
type EncryptedKindsBl struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedKindsBo ¶
type EncryptedKindsBo struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedKindsBy ¶
type EncryptedKindsBy struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
}
type EncryptedKindsD ¶
type EncryptedKindsD struct {
Ciphertext encrypt.Ciphertext
Ore encrypt.OreTerm
}
type EncryptedKindsE ¶
type EncryptedKindsE struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
Match encrypt.MatchTerm
Ore encrypt.OreTerm
}
type EncryptedKindsF32 ¶
type EncryptedKindsF32 struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedKindsF64 ¶
type EncryptedKindsF64 struct {
Ciphertext encrypt.Ciphertext
Ore encrypt.OreTerm
}
type EncryptedKindsI ¶
type EncryptedKindsI struct {
Ciphertext encrypt.Ciphertext
Ore encrypt.OreTerm
}
type EncryptedKindsI8 ¶
type EncryptedKindsI8 struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
Ore encrypt.OreTerm
}
type EncryptedKindsI16 ¶
type EncryptedKindsI16 struct {
Ciphertext encrypt.Ciphertext
Ope encrypt.OpeTerm
}
type EncryptedKindsI32 ¶
type EncryptedKindsI32 struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
}
type EncryptedKindsI64 ¶
type EncryptedKindsI64 struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedKindsS ¶
type EncryptedKindsS struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
Match encrypt.MatchTerm
}
type EncryptedKindsSc ¶
type EncryptedKindsSc struct {
Ciphertext encrypt.Ciphertext
Ore encrypt.OreTerm
}
type EncryptedKindsSt ¶
type EncryptedKindsSt struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
}
type EncryptedKindsU ¶
type EncryptedKindsU struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedKindsU8 ¶
type EncryptedKindsU8 struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
}
type EncryptedKindsU16 ¶
type EncryptedKindsU16 struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedKindsU32 ¶
type EncryptedKindsU32 struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
Ore encrypt.OreTerm
}
type EncryptedKindsU64 ¶
type EncryptedKindsU64 struct {
Ciphertext encrypt.Ciphertext
Ope encrypt.OpeTerm
}
type EncryptedLookup ¶
type EncryptedLookup struct {
ID int64
Email EncryptedLookupEmail
Score EncryptedLookupScore
Code EncryptedLookupCode
}
func EncryptLookup ¶
func EncryptLookup(ctx context.Context, cipher *encrypt.Cipher, values []Lookup) ([]EncryptedLookup, error)
EncryptLookup seals each Lookup, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedLookup) LogValue ¶
func (e EncryptedLookup) LogValue() slog.Value
func (EncryptedLookup) String ¶
func (e EncryptedLookup) String() string
type EncryptedLookupCode ¶
type EncryptedLookupCode struct {
Equality encrypt.EqualityTerm
}
type EncryptedLookupEmail ¶
type EncryptedLookupEmail struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedLookupScore ¶
type EncryptedMember ¶
type EncryptedMember struct {
ID int64
Age EncryptedMemberAge
Email EncryptedMemberEmail
Notes EncryptedMemberNotes
}
func EncryptMember ¶
func EncryptMember(ctx context.Context, cipher *encrypt.Cipher, values []testmember.Member) ([]EncryptedMember, error)
EncryptMember seals each testmember.Member, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedMember) LogValue ¶
func (e EncryptedMember) LogValue() slog.Value
func (EncryptedMember) String ¶
func (e EncryptedMember) String() string
type EncryptedMemberAge ¶
type EncryptedMemberAge struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
Ore encrypt.OreTerm
}
type EncryptedMemberEmail ¶
type EncryptedMemberEmail struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
Match encrypt.MatchTerm
}
type EncryptedMemberNotes ¶
type EncryptedMemberNotes struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedNote ¶
type EncryptedNote struct {
Tenant string
Text EncryptedNoteText
ID uint32
}
func EncryptNote ¶
func EncryptNote(ctx context.Context, cipher *encrypt.Cipher, values []Note) ([]EncryptedNote, error)
EncryptNote seals each Note, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedNote) LogValue ¶
func (e EncryptedNote) LogValue() slog.Value
func (EncryptedNote) String ¶
func (e EncryptedNote) String() string
type EncryptedNoteText ¶
type EncryptedNoteText struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
}
type EncryptedProbe ¶
type EncryptedProbe struct {
U32 EncryptedProbeU32
U64 EncryptedProbeU64
I64 EncryptedProbeI64
S EncryptedProbeS
B EncryptedProbeB
}
func EncryptProbe ¶
func EncryptProbe(ctx context.Context, cipher *encrypt.Cipher, values []Probe) ([]EncryptedProbe, error)
EncryptProbe seals each Probe, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedProbe) LogValue ¶
func (e EncryptedProbe) LogValue() slog.Value
func (EncryptedProbe) String ¶
func (e EncryptedProbe) String() string
type EncryptedProbeB ¶
type EncryptedProbeI64 ¶
type EncryptedProbeS ¶
type EncryptedProbeU32 ¶
type EncryptedProbeU64 ¶
type EncryptedProfile ¶
type EncryptedProfile struct {
ID int64
Visits eql.Integer
Balance eql.Bigint
Active eql.Boolean
Ratio eql.Real
Score eql.Double
Note eql.Text
Name eql.TextMatch
}
func EncryptProfile ¶
func EncryptProfile(ctx context.Context, cipher *encrypt.Cipher, values []Profile) ([]EncryptedProfile, error)
EncryptProfile seals each Profile, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedProfile) LogValue ¶
func (e EncryptedProfile) LogValue() slog.Value
func (EncryptedProfile) String ¶
func (e EncryptedProfile) String() string
type EncryptedSecret ¶
type EncryptedSecret struct {
ID int64
Value EncryptedSecretValue
}
func EncryptSecret ¶
func EncryptSecret(ctx context.Context, cipher *encrypt.Cipher, values []Secret) ([]EncryptedSecret, error)
EncryptSecret seals each Secret, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedSecret) LogValue ¶
func (e EncryptedSecret) LogValue() slog.Value
func (EncryptedSecret) String ¶
func (e EncryptedSecret) String() string
type EncryptedSecretValue ¶
type EncryptedSecretValue struct {
Ciphertext encrypt.Ciphertext
}
type EncryptedUser ¶
type EncryptedUser struct {
ID int64
Age EncryptedUserAge
Email EncryptedUserEmail
Notes EncryptedUserNotes
}
func Encrypt ¶
func Encrypt(ctx context.Context, cipher *encrypt.Cipher, testusers []User) ([]EncryptedUser, error)
Encrypt seals each User, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used. The result has one element for each input, in the same order.
func (EncryptedUser) LogValue ¶
func (e EncryptedUser) LogValue() slog.Value
func (EncryptedUser) String ¶
func (e EncryptedUser) String() string
type EncryptedUserAge ¶
type EncryptedUserAge struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
Ore encrypt.OreTerm
}
type EncryptedUserEmail ¶
type EncryptedUserEmail struct {
Ciphertext encrypt.Ciphertext
Equality encrypt.EqualityTerm
Match encrypt.MatchTerm
}
type EncryptedUserNotes ¶
type EncryptedUserNotes struct {
Ciphertext encrypt.Ciphertext
}
type Everything ¶
type Everything struct {
S string
E Email
Bo bool
I8 int8
I int
U64 uint64
F32 float32
F64 float64
By []byte
Bl Blob
Sc Score
Tags []string
Ints []int
F32s []float32
St Status
D time.Duration
Emails []Email
Counts map[string]int
Labels map[string]string
ByKey map[int]string
In Inner
Ins []Inner
P *string
PI *Inner
T time.Time
N sql.NullTime
Nested [][]byte
Arr [2]uint8
// contains filtered or unexported fields
}
Everything is an opaque struct with a field of every type JSON carries both ways. It crosses as one document and comes back as it was.
func DecryptEverything ¶
func DecryptEverything(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedEverything) ([]Everything, error)
DecryptEverything opens each EncryptedEverything, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type Kinds ¶
type Kinds struct {
S string `stash:"s,encrypt,index=equality;match"`
E Email `stash:"e,encrypt,index=equality;match;ore"`
Bo bool `stash:"bo,encrypt"`
I8 int8 `stash:"i8,encrypt,index=equality;ore"`
I16 int16 `stash:"i16,encrypt,index=ope"`
I32 int32 `stash:"i32,encrypt,index=equality"`
I int `stash:"i,encrypt,index=ore"`
I64 int64 `stash:"i64,encrypt"`
U8 uint8 `stash:"u8,encrypt,index=equality"`
U16 uint16 `stash:"u16,encrypt"`
U32 uint32 `stash:"u32,encrypt,index=equality;ore"`
U uint `stash:"u,encrypt"`
U64 uint64 `stash:"u64,encrypt,index=ope"`
F32 float32 `stash:"f32,encrypt"`
F64 float64 `stash:"f64,encrypt,index=ore"`
By []byte `stash:"by,encrypt,index=equality"`
Bl Blob `stash:"bl,encrypt"`
Sc Score `stash:"sc,encrypt,index=ore"`
St Status `stash:"st,encrypt,index=equality"`
D time.Duration `stash:"d,encrypt,index=ore"`
P *int `stash:"p,passthrough"`
M map[string]string `stash:"m,passthrough"`
T time.Time `stash:"t,passthrough"`
N sql.NullTime `stash:"n,passthrough"`
In Inner `stash:"in,passthrough"`
Sk []Inner `stash:"sk,passthrough"`
A any `stash:"a,passthrough"`
Er error `stash:"er,passthrough"`
// contains filtered or unexported fields
}
Kinds has one sealed field of every scalar kind stashgen accepts outside an opaque struct, with defined types among them, and passthrough fields of types the codec cannot carry. Everything it accepts round-trips.
func DecryptKinds ¶
func DecryptKinds(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedKinds) ([]Kinds, error)
DecryptKinds opens each EncryptedKinds, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type KindsBlField ¶
type KindsBlField struct {
// contains filtered or unexported fields
}
func (KindsBlField) Encrypt ¶
func (f KindsBlField) Encrypt(ctx context.Context, c *encrypt.Cipher, v Blob) (EncryptedKindsBl, error)
type KindsBoField ¶
type KindsBoField struct {
// contains filtered or unexported fields
}
func (KindsBoField) Encrypt ¶
func (f KindsBoField) Encrypt(ctx context.Context, c *encrypt.Cipher, v bool) (EncryptedKindsBo, error)
type KindsByField ¶
type KindsByField struct {
// contains filtered or unexported fields
}
func (KindsByField) Encrypt ¶
func (f KindsByField) Encrypt(ctx context.Context, c *encrypt.Cipher, v []byte) (EncryptedKindsBy, error)
type KindsDField ¶
type KindsDField struct {
// contains filtered or unexported fields
}
type KindsEField ¶
type KindsEField struct {
// contains filtered or unexported fields
}
func (KindsEField) Encrypt ¶
func (f KindsEField) Encrypt(ctx context.Context, c *encrypt.Cipher, v Email) (EncryptedKindsE, error)
func (KindsEField) Equality ¶
func (f KindsEField) Equality(ctx context.Context, c *encrypt.Cipher, v Email) (encrypt.EqualityTerm, error)
type KindsF32Field ¶
type KindsF32Field struct {
// contains filtered or unexported fields
}
func (KindsF32Field) Encrypt ¶
func (f KindsF32Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v float32) (EncryptedKindsF32, error)
type KindsF64Field ¶
type KindsF64Field struct {
// contains filtered or unexported fields
}
func (KindsF64Field) Encrypt ¶
func (f KindsF64Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v float64) (EncryptedKindsF64, error)
type KindsI8Field ¶
type KindsI8Field struct {
// contains filtered or unexported fields
}
func (KindsI8Field) Encrypt ¶
func (f KindsI8Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v int8) (EncryptedKindsI8, error)
type KindsI16Field ¶
type KindsI16Field struct {
// contains filtered or unexported fields
}
func (KindsI16Field) Encrypt ¶
func (f KindsI16Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v int16) (EncryptedKindsI16, error)
type KindsI32Field ¶
type KindsI32Field struct {
// contains filtered or unexported fields
}
func (KindsI32Field) Encrypt ¶
func (f KindsI32Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v int32) (EncryptedKindsI32, error)
type KindsI64Field ¶
type KindsI64Field struct {
// contains filtered or unexported fields
}
func (KindsI64Field) Encrypt ¶
func (f KindsI64Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v int64) (EncryptedKindsI64, error)
type KindsIField ¶
type KindsIField struct {
// contains filtered or unexported fields
}
func (KindsIField) Encrypt ¶
func (f KindsIField) Encrypt(ctx context.Context, c *encrypt.Cipher, v int) (EncryptedKindsI, error)
type KindsSField ¶
type KindsSField struct {
// contains filtered or unexported fields
}
func (KindsSField) Encrypt ¶
func (f KindsSField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedKindsS, error)
type KindsScField ¶
type KindsScField struct {
// contains filtered or unexported fields
}
func (KindsScField) Encrypt ¶
func (f KindsScField) Encrypt(ctx context.Context, c *encrypt.Cipher, v Score) (EncryptedKindsSc, error)
type KindsStField ¶
type KindsStField struct {
// contains filtered or unexported fields
}
func (KindsStField) Encrypt ¶
func (f KindsStField) Encrypt(ctx context.Context, c *encrypt.Cipher, v Status) (EncryptedKindsSt, error)
type KindsU8Field ¶
type KindsU8Field struct {
// contains filtered or unexported fields
}
func (KindsU8Field) Encrypt ¶
func (f KindsU8Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint8) (EncryptedKindsU8, error)
type KindsU16Field ¶
type KindsU16Field struct {
// contains filtered or unexported fields
}
func (KindsU16Field) Encrypt ¶
func (f KindsU16Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint16) (EncryptedKindsU16, error)
type KindsU32Field ¶
type KindsU32Field struct {
// contains filtered or unexported fields
}
func (KindsU32Field) Encrypt ¶
func (f KindsU32Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint32) (EncryptedKindsU32, error)
type KindsU64Field ¶
type KindsU64Field struct {
// contains filtered or unexported fields
}
func (KindsU64Field) Encrypt ¶
func (f KindsU64Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint64) (EncryptedKindsU64, error)
type KindsUField ¶
type KindsUField struct {
// contains filtered or unexported fields
}
func (KindsUField) Encrypt ¶
func (f KindsUField) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint) (EncryptedKindsU, error)
type Lookup ¶
type Lookup struct {
ID int64 `stash:"id,passthrough"`
Email string `stash:"email,encrypt"`
Score int32 `stash:"score,index=ore"`
Code Status `stash:"code,index=equality"`
// contains filtered or unexported fields
}
Lookup has index-only fields: each stores its terms and no ciphertext, so Decrypt leaves it at its zero value and still opens the sealed field.
func DecryptLookup ¶
func DecryptLookup(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedLookup) ([]Lookup, error)
DecryptLookup opens each EncryptedLookup, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
DecryptLookup leaves Score and Code at the zero value: an index-only field stores no ciphertext, so nothing opens for it. Do not pass a decrypted value back to EncryptLookup to update its row, because EncryptLookup would then store the term for zero. Derive the index-only terms again from the real values through LookupFields.
type LookupCodeField ¶
type LookupCodeField struct {
// contains filtered or unexported fields
}
func (LookupCodeField) Encrypt ¶
func (f LookupCodeField) Encrypt(ctx context.Context, c *encrypt.Cipher, v Status) (EncryptedLookupCode, error)
type LookupEmailField ¶
type LookupEmailField struct {
// contains filtered or unexported fields
}
func (LookupEmailField) Encrypt ¶
func (f LookupEmailField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedLookupEmail, error)
type LookupScoreField ¶
type LookupScoreField struct {
// contains filtered or unexported fields
}
func (LookupScoreField) Encrypt ¶
func (f LookupScoreField) Encrypt(ctx context.Context, c *encrypt.Cipher, v int32) (EncryptedLookupScore, error)
type MemberAgeField ¶
type MemberAgeField struct {
// contains filtered or unexported fields
}
func (MemberAgeField) Encrypt ¶
func (f MemberAgeField) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint32) (EncryptedMemberAge, error)
type MemberEmailField ¶
type MemberEmailField struct {
// contains filtered or unexported fields
}
func (MemberEmailField) Encrypt ¶
func (f MemberEmailField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedMemberEmail, error)
type MemberNotesField ¶
type MemberNotesField struct {
// contains filtered or unexported fields
}
func (MemberNotesField) Encrypt ¶
func (f MemberNotesField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedMemberNotes, error)
type Note ¶
type Note struct {
Tenant string `stash:"tenant,context_field"`
Text string `stash:"text,encrypt,index=equality"`
ID uint32 `stash:"id,passthrough"`
}
Note takes its context from its own Tenant field, as the Rust record fixture's context-field case does (the `context_field` key of packages/stack-encrypt/tests/fixtures/record_lowering.json): the same field names, kinds and index, so the fixture's records open through the generated code and its term compares.
func DecryptNote ¶
func DecryptNote(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedNote) ([]Note, error)
DecryptNote opens each EncryptedNote, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type NoteTextField ¶
type NoteTextField struct {
// contains filtered or unexported fields
}
func (NoteTextField) Encrypt ¶
func (f NoteTextField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedNoteText, error)
type NotesField ¶
type NotesField struct {
// contains filtered or unexported fields
}
func (NotesField) Encrypt ¶
func (f NotesField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedUserNotes, error)
type Probe ¶
type Probe struct {
U32 uint32 `stash:"u32,encrypt,index=ore;ope"`
U64 uint64 `stash:"u64,encrypt,index=ore;ope"`
I64 int64 `stash:"i64,encrypt,index=ore;ope"`
S string `stash:"s,encrypt,index=ore;ope"`
B []byte `stash:"b,encrypt,index=ore;ope"`
// contains filtered or unexported fields
}
Probe has one field of each scalar type the ORE and OPE indexes order, for the property tests of term ordering.
func DecryptProbe ¶
func DecryptProbe(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedProbe) ([]Probe, error)
DecryptProbe opens each EncryptedProbe, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type ProbeBField ¶
type ProbeBField struct {
// contains filtered or unexported fields
}
func (ProbeBField) Encrypt ¶
func (f ProbeBField) Encrypt(ctx context.Context, c *encrypt.Cipher, v []byte) (EncryptedProbeB, error)
type ProbeI64Field ¶
type ProbeI64Field struct {
// contains filtered or unexported fields
}
func (ProbeI64Field) Encrypt ¶
func (f ProbeI64Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v int64) (EncryptedProbeI64, error)
type ProbeSField ¶
type ProbeSField struct {
// contains filtered or unexported fields
}
func (ProbeSField) Encrypt ¶
func (f ProbeSField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedProbeS, error)
type ProbeU32Field ¶
type ProbeU32Field struct {
// contains filtered or unexported fields
}
func (ProbeU32Field) Encrypt ¶
func (f ProbeU32Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint32) (EncryptedProbeU32, error)
type ProbeU64Field ¶
type ProbeU64Field struct {
// contains filtered or unexported fields
}
func (ProbeU64Field) Encrypt ¶
func (f ProbeU64Field) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint64) (EncryptedProbeU64, error)
type Profile ¶
type Profile struct {
ID int64 `stash:"id,passthrough"`
Visits int32 `stash:"visits,encrypt_into=Integer"`
Balance int64 `stash:"balance,encrypt_into=Bigint"`
Active bool `stash:"active,encrypt_into=Boolean"`
Ratio float32 `stash:"ratio,encrypt_into=Real"`
Score float64 `stash:"score,encrypt_into=Double"`
Note string `stash:"note,encrypt_into=Text"`
Name string `stash:"name,encrypt_into=TextMatch"`
// contains filtered or unexported fields
}
Profile stores one field in each EQL v4 type the engine produces besides TextEq, the shape the cross-language fixtures under packages/eql/tests/encryption/fixtures (v4_queries.json, v4_rows.json) are derived under (table profiles).
func DecryptProfile ¶
func DecryptProfile(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedProfile) ([]Profile, error)
DecryptProfile opens each EncryptedProfile, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type ProfileActiveField ¶
type ProfileActiveField struct {
// contains filtered or unexported fields
}
type ProfileBalanceField ¶
type ProfileBalanceField struct {
// contains filtered or unexported fields
}
type ProfileNameField ¶
type ProfileNameField struct {
// contains filtered or unexported fields
}
type ProfileNoteField ¶
type ProfileNoteField struct {
// contains filtered or unexported fields
}
type ProfileRatioField ¶
type ProfileRatioField struct {
// contains filtered or unexported fields
}
type ProfileScoreField ¶
type ProfileScoreField struct {
// contains filtered or unexported fields
}
type ProfileVisitsField ¶
type ProfileVisitsField struct {
// contains filtered or unexported fields
}
type Score ¶
type Score int16
Defined types over scalars: the engine returns the underlying type and the generated code converts.
type Secret ¶
type Secret struct {
ID int64 `stash:"id,passthrough"`
Value string `stash:"value,encrypt"`
// contains filtered or unexported fields
}
Secret is generated with -redact, so it prints no sealed field.
func DecryptSecret ¶
func DecryptSecret(ctx context.Context, d encrypt.Decrypter, encrypted []EncryptedSecret) ([]Secret, error)
DecryptSecret opens each EncryptedSecret, with one ZeroKMS request for each 500 sealed values, plus one the first time a keyset is used.
type SecretValueField ¶
type SecretValueField struct {
// contains filtered or unexported fields
}
func (SecretValueField) Encrypt ¶
func (f SecretValueField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (EncryptedSecretValue, error)
type Status ¶
type Status string
Defined types over scalars: the engine returns the underlying type and the generated code converts.
type User ¶
type User struct {
ID int64 `stash:"id,passthrough"`
Age uint32 `stash:"age,encrypt,index=equality;ore"`
Email string `stash:"email,encrypt,index=equality;match"`
Notes string `stash:"notes,encrypt"`
Internal string `stash:"-"`
// contains filtered or unexported fields
}
User is the record of the Rust record fixture (packages/stack-encrypt/tests/fixtures/record_lowering.json): the same context, identities, kinds and indexes, so the fixture's records open through the generated code and its terms compare.
type UserRow ¶
type UserRow struct {
ID int64 `stash:"id"`
Age encrypt.Ciphertext `stash:"age"`
AgeEq encrypt.EqualityTerm `stash:"age,equality"`
AgeOre encrypt.OreTerm `stash:"age,ore"`
Email encrypt.Ciphertext `stash:"email"`
EmailEq encrypt.EqualityTerm `stash:"email,equality"`
EmailMatch encrypt.MatchTerm `stash:"email,match"`
Notes encrypt.Ciphertext `stash:"notes"`
}
UserRow is a model for User in separate columns: one field for each output, each tagged with the output it holds, for a library that maps one struct field to one column.