Documentation ¶
Index ¶
- Constants
- Variables
- func AccountClaimsLookup(ctx context.Context, nc *nats.Conn, accountPublicKey string) (*jwt.AccountClaims, error)
- func AccountClaimsUpdate(ctx context.Context, nc *nats.Conn, operatorKeyPair nkeys.KeyPair, ...) (string, error)
- func AccountJWTUpdate(ctx context.Context, nc *nats.Conn, accJWT string) (string, error)
- type Account
- type AccountReconciler
- type AccountSpec
- type AccountStatus
- type GroupRef
- type Member
- type MemberSpec
- type User
- type UserClaims
- type UserCreateAction
- type UserRef
- type UserSpec
- type UserStatus
Constants ¶
View Source
const ( ObjectKind = "Account" ObjectGroup = "hz-internal" ObjectVersion = "v1" )
Variables ¶
View Source
var ErrAccountNotFound = errors.New("account not found")
Functions ¶
func AccountClaimsLookup ¶
func AccountClaimsUpdate ¶
Types ¶
type Account ¶
type Account struct { hz.ObjectMeta `json:"metadata,omitempty" cue:""` Spec *AccountSpec `json:"spec,omitempty"` Status *AccountStatus `json:"status,omitempty"` }
func (Account) ObjectGroup ¶
func (Account) ObjectKind ¶
func (Account) ObjectVersion ¶
type AccountReconciler ¶
type AccountReconciler struct { hz.Client Conn *nats.Conn OpKeyPair nkeys.KeyPair RootAccountPubKey string }
func (*AccountReconciler) CreateAccount ¶
func (r *AccountReconciler) CreateAccount( name string, ) (*AccountStatus, error)
type AccountSpec ¶
type AccountSpec struct{}
type AccountStatus ¶
type AccountStatus struct { Ready bool `json:"ready"` // ID of the account, which for NATS is the public key of the account // and the subject of the account's JWT. ID string `json:"id,omitempty"` // Seed of the account. // The "seed" can be converted into the account public // and private keys. Seed string `json:"seed,omitempty"` // SigningKeySeed is the seed of the account signing key. // The account signing key should be used for signing all the user JWTs // (credentials) for the account. SigningKeySeed string `json:"signing_key_seed,omitempty"` JWT string `json:"jwt,omitempty" cue:",opt"` }
type Member ¶
type Member struct { hz.ObjectMeta `json:"metadata,omitempty"` Spec MemberSpec `json:"spec,omitempty" cue:""` }
func (Member) ObjectGroup ¶
func (Member) ObjectKind ¶
func (Member) ObjectVersion ¶
type MemberSpec ¶
type User ¶
type User struct { hz.ObjectMeta `json:"metadata"` Spec UserSpec `json:"spec"` Status UserStatus `json:"status"` }
User represents a NATS user.
func (User) ObjectGroup ¶
func (User) ObjectKind ¶
func (User) ObjectVersion ¶
type UserClaims ¶
type UserCreateAction ¶
func (*UserCreateAction) Action ¶
func (a *UserCreateAction) Action() string
Action implements hz.Action.
type UserSpec ¶
type UserSpec struct {
Claims *UserClaims `json:"claims,omitempty" cue:""`
}
type UserStatus ¶
type UserStatus struct { // ID of the user, which for NATS is the public key. ID string `json:"id"` // Seed of the user. // The Seed (or "seed") can be converted into the user public // and private keys. The public key must match the user ID. Seed string `json:"nkey"` // JWT of the user. // The JWT contains the user claims (i.e. name, config, limits, etc.) // and is signed using an account NKey. JWT string `json:"jwt"` }
Click to show internal directories.
Click to hide internal directories.