database

package
v0.0.0-...-1f56e41 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddUserParams

type AddUserParams struct {
	Subject       string    `json:"subject"`
	Email         string    `json:"email"`
	EmailVerified bool      `json:"email_verified"`
	Roles         string    `json:"roles"`
	Userinfo      string    `json:"userinfo"`
	UpdatedAt     time.Time `json:"updated_at"`
	Active        bool      `json:"active"`
}

type ClientStore

type ClientStore struct {
	Subject string `json:"subject"`
	Name    string `json:"name"`
	Secret  string `json:"secret"`
	Domain  string `json:"domain"`
	Owner   string `json:"owner"`
	Perms   string `json:"perms"`
	Public  bool   `json:"public"`
	Sso     bool   `json:"sso"`
	Active  bool   `json:"active"`
}

func (*ClientStore) GetDomain

func (c *ClientStore) GetDomain() string

func (*ClientStore) GetID

func (c *ClientStore) GetID() string

func (*ClientStore) GetName

func (c *ClientStore) GetName() string

GetName is an extra field for the oauth handler to display the application name

func (*ClientStore) GetSecret

func (c *ClientStore) GetSecret() string

func (*ClientStore) GetUserID

func (c *ClientStore) GetUserID() string

func (*ClientStore) IsActive

func (c *ClientStore) IsActive() bool

IsActive is an extra field for the app manager to get the active state

func (*ClientStore) IsPublic

func (c *ClientStore) IsPublic() bool

func (*ClientStore) IsSSO

func (c *ClientStore) IsSSO() bool

IsSSO is an extra field for the oauth handler to skip the user input stage this is for trusted applications to get permissions without asking the user

func (*ClientStore) UsePerms

func (c *ClientStore) UsePerms() string

UsePerms is an extra field for the userinfo handler to return user permissions matching the requested values

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetAppListParams

type GetAppListParams struct {
	Owner   string      `json:"owner"`
	Column2 interface{} `json:"column_2"`
	Offset  int64       `json:"offset"`
}

type GetAppListRow

type GetAppListRow struct {
	Subject string `json:"subject"`
	Name    string `json:"name"`
	Domain  string `json:"domain"`
	Owner   string `json:"owner"`
	Perms   string `json:"perms"`
	Public  bool   `json:"public"`
	Sso     bool   `json:"sso"`
	Active  bool   `json:"active"`
}

type GetUserListRow

type GetUserListRow struct {
	Subject       string    `json:"subject"`
	Email         string    `json:"email"`
	EmailVerified bool      `json:"email_verified"`
	Roles         string    `json:"roles"`
	UpdatedAt     time.Time `json:"updated_at"`
	Active        bool      `json:"active"`
}

type GetUserTokenRow

type GetUserTokenRow struct {
	AccessToken  sql.NullString `json:"access_token"`
	RefreshToken sql.NullString `json:"refresh_token"`
	Expiry       sql.NullTime   `json:"expiry"`
}

type InsertClientAppParams

type InsertClientAppParams struct {
	Subject string `json:"subject"`
	Name    string `json:"name"`
	Secret  string `json:"secret"`
	Domain  string `json:"domain"`
	Owner   string `json:"owner"`
	Perms   string `json:"perms"`
	Public  bool   `json:"public"`
	Sso     bool   `json:"sso"`
	Active  bool   `json:"active"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddUser

func (q *Queries) AddUser(ctx context.Context, arg AddUserParams) error

func (*Queries) GetAppList

func (q *Queries) GetAppList(ctx context.Context, arg GetAppListParams) ([]GetAppListRow, error)

func (*Queries) GetClientInfo

func (q *Queries) GetClientInfo(ctx context.Context, subject string) (ClientStore, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, subject string) (User, error)

func (*Queries) GetUserEmail

func (q *Queries) GetUserEmail(ctx context.Context, subject string) (string, error)

func (*Queries) GetUserList

func (q *Queries) GetUserList(ctx context.Context, offset int64) ([]GetUserListRow, error)

func (*Queries) GetUserRoles

func (q *Queries) GetUserRoles(ctx context.Context, subject string) (string, error)

func (*Queries) GetUserToken

func (q *Queries) GetUserToken(ctx context.Context, subject string) (GetUserTokenRow, error)

func (*Queries) HasUser

func (q *Queries) HasUser(ctx context.Context) (bool, error)

func (*Queries) InsertClientApp

func (q *Queries) InsertClientApp(ctx context.Context, arg InsertClientAppParams) error

func (*Queries) ResetClientAppSecret

func (q *Queries) ResetClientAppSecret(ctx context.Context, arg ResetClientAppSecretParams) error

func (*Queries) UpdateClientApp

func (q *Queries) UpdateClientApp(ctx context.Context, arg UpdateClientAppParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error

func (*Queries) UpdateUserInfo

func (q *Queries) UpdateUserInfo(ctx context.Context, arg UpdateUserInfoParams) error

func (*Queries) UpdateUserToken

func (q *Queries) UpdateUserToken(ctx context.Context, arg UpdateUserTokenParams) error

func (*Queries) UserEmailExists

func (q *Queries) UserEmailExists(ctx context.Context, email string) (bool, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type ResetClientAppSecretParams

type ResetClientAppSecretParams struct {
	Secret  string `json:"secret"`
	Subject string `json:"subject"`
	Owner   string `json:"owner"`
}

type UpdateClientAppParams

type UpdateClientAppParams struct {
	Name    string `json:"name"`
	Domain  string `json:"domain"`
	Column3 bool   `json:"column_3"`
	Perms   string `json:"perms"`
	Public  bool   `json:"public"`
	Sso     bool   `json:"sso"`
	Active  bool   `json:"active"`
	Subject string `json:"subject"`
	Owner   string `json:"owner"`
}

type UpdateUserInfoParams

type UpdateUserInfoParams struct {
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Userinfo      string `json:"userinfo"`
	Subject       string `json:"subject"`
}

type UpdateUserParams

type UpdateUserParams struct {
	Active  bool   `json:"active"`
	Roles   string `json:"roles"`
	Subject string `json:"subject"`
}

type UpdateUserTokenParams

type UpdateUserTokenParams struct {
	AccessToken  sql.NullString `json:"access_token"`
	RefreshToken sql.NullString `json:"refresh_token"`
	Expiry       sql.NullTime   `json:"expiry"`
	Subject      string         `json:"subject"`
}

type User

type User struct {
	Subject       string         `json:"subject"`
	Email         string         `json:"email"`
	EmailVerified bool           `json:"email_verified"`
	Roles         string         `json:"roles"`
	Userinfo      string         `json:"userinfo"`
	AccessToken   sql.NullString `json:"access_token"`
	RefreshToken  sql.NullString `json:"refresh_token"`
	Expiry        sql.NullTime   `json:"expiry"`
	UpdatedAt     time.Time      `json:"updated_at"`
	Active        bool           `json:"active"`
}

Jump to

Keyboard shortcuts

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