accesskey

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	ID          string                         `json:"id" sql:"type:uuid;primary_key;default:uuid_generate_v4()"`
	Scope       string                         `json:"scope" gorm:"type:varchar(24)"`
	ScopeId     string                         `json:"scopeId" gorm:"type:varchar(128)"`
	AccessKey   string                         `json:"accessKey" gorm:"size:24;unique;comment:'Access Key ID'"`
	SecretKey   string                         `json:"secretKey" gorm:"size:32;unique;comment:'Secret Key'"`
	Status      pb.StatusEnum_Status           `json:"status" gorm:"comment:'status of access key'"`
	SubjectType pb.SubjectTypeEnum_SubjectType `json:"subjectType" gorm:"comment:'authentication subject type. eg: organization, micro_service, system'"`
	Subject     string                         `json:"subject" gorm:"comment:'authentication subject identifier. eg: id, name or something'"`
	Description string                         `json:"description" gorm:"comment:'description'"`
	CreatedAt   time.Time                      `json:"createdAt" gorm:"comment:'created time'"`
	UpdatedAt   time.Time                      `json:"updatedAt"`
}

store secret key pair

func (*AccessKey) BeforeCreate

func (ak *AccessKey) BeforeCreate(scope *gorm.Scope) error

func (AccessKey) TableName

func (ak AccessKey) TableName() string

type Dao

type Dao interface {
	QueryAccessKey(ctx context.Context, req *pb.QueryAccessKeysRequest) ([]AccessKey, int64, error)
	CreateAccessKey(ctx context.Context, req *pb.CreateAccessKeyRequest) (*AccessKey, error)
	GetAccessKey(ctx context.Context, req *pb.GetAccessKeyRequest) (*AccessKey, error)
	UpdateAccessKey(ctx context.Context, req *pb.UpdateAccessKeyRequest) error
	DeleteAccessKey(ctx context.Context, req *pb.DeleteAccessKeyRequest) error
}

Jump to

Keyboard shortcuts

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