Documentation
¶
Index ¶
Constants ¶
const TableNameAccessToken = "access_tokens"
const TableNameApp = "apps"
const TableNameAuth = "auths"
const TableNameCode = "code"
const TableNameConsent = "consents"
const TableNameDiscord = "discords"
const TableNameIDToken = "id_tokens"
const TableNameOidcAuthorization = "oidc_authorizations"
const TableNameOidcToken = "oidc_tokens"
const TableNameRedirectURI = "redirect_uris"
const TableNameRefreshToken = "refresh_tokens"
const TableNameRole = "roles"
const TableNameSession = "sessions"
const TableNameTokenSet = "token_sets"
const TableNameUser = "users"
const TableNameUserApp = "user_app"
const TableNameUserRole = "user_role"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
Hash string `gorm:"column:hash;not null" json:"hash"`
Type string `gorm:"column:type;not null" json:"type"`
Scope string `gorm:"column:scope;not null" json:"scope"`
IssuedAt time.Time `gorm:"column:issued_at;not null" json:"issued_at"`
Exp time.Time `gorm:"column:exp;not null" json:"exp"`
ClientID string `gorm:"column:client_id;not null;comment:アプリケーションID" json:"client_id"` // アプリケーションID
UserID string `gorm:"column:user_id;not null" json:"user_id"`
Revoked bool `gorm:"column:revoked;not null" json:"revoked"`
}
AccessToken mapped from table <access_tokens>
func (*AccessToken) TableName ¶
func (*AccessToken) TableName() string
TableName AccessToken's table name
type App ¶
type App struct {
ID string `gorm:"column:id;primaryKey" json:"id"`
ClientID string `gorm:"column:client_id;not null" json:"client_id"`
Aud string `gorm:"column:aud;not null" json:"aud"`
ClientSecret string `gorm:"column:client_secret;not null" json:"client_secret"`
Name string `gorm:"column:name;not null" json:"name"`
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
IsEnable bool `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}
App mapped from table <apps>
type Auth ¶
type Auth struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
AuthUserID string `gorm:"column:auth_user_id;not null" json:"auth_user_id"`
AppID string `gorm:"column:app_id;not null" json:"app_id"`
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
IsEnable bool `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}
Auth mapped from table <auths>
type Code ¶
type Code struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
Token string `gorm:"column:token;not null" json:"token"`
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
Exp time.Time `gorm:"column:exp" json:"exp"`
IsEnable bool `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}
Code mapped from table <code>
type Consent ¶
type Consent struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
Scope string `gorm:"column:scope" json:"scope"`
IsEnable bool `gorm:"column:is_enable" json:"is_enable"`
}
Consent mapped from table <consents>
type Discord ¶
type Discord struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
DiscordID string `gorm:"column:discord_id;not null" json:"discord_id"`
UserID string `gorm:"column:user_id;not null" json:"user_id"`
}
Discord mapped from table <discords>
type IDToken ¶
type IDToken struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
Hash string `gorm:"column:hash;not null" json:"hash"`
Type string `gorm:"column:type;not null" json:"type"`
Scope string `gorm:"column:scope;not null" json:"scope"`
IssuedAt time.Time `gorm:"column:issued_at;not null" json:"issued_at"`
Exp time.Time `gorm:"column:exp;not null" json:"exp"`
ClientID string `gorm:"column:client_id;not null;comment:アプリケーションID" json:"client_id"` // アプリケーションID
Aud string `gorm:"column:aud;not null" json:"aud"`
Nonce string `gorm:"column:nonce" json:"nonce"`
AuthTime time.Time `gorm:"column:auth_time" json:"auth_time"`
Acr string `gorm:"column:acr" json:"acr"`
Amr string `gorm:"column:amr" json:"amr"`
Jti string `gorm:"column:jti;not null" json:"jti"`
UserID string `gorm:"column:user_id;not null" json:"user_id"`
Revoked bool `gorm:"column:revoked;not null" json:"revoked"`
}
IDToken mapped from table <id_tokens>
type OidcAuthorization ¶
type OidcAuthorization struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
AuthID int32 `gorm:"column:auth_id;not null" json:"auth_id"`
CodeID int32 `gorm:"column:code_id;not null" json:"code_id"`
ConsentID int32 `gorm:"column:consent_id;not null" json:"consent_id"`
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
}
OidcAuthorization mapped from table <oidc_authorizations>
func (*OidcAuthorization) TableName ¶
func (*OidcAuthorization) TableName() string
TableName OidcAuthorization's table name
type OidcToken ¶
type OidcToken struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
OidcAuthorizationID int32 `gorm:"column:oidc_authorization_id;not null" json:"oidc_authorization_id"`
AccessTokenID int32 `gorm:"column:access_token_id;not null" json:"access_token_id"`
RefreshTokenID int32 `gorm:"column:refresh_token_id;not null" json:"refresh_token_id"`
IsEnable bool `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}
OidcToken mapped from table <oidc_tokens>
type RedirectURI ¶
type RedirectURI struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
AppID string `gorm:"column:app_id;not null" json:"app_id"`
URI string `gorm:"column:uri;not null" json:"uri"`
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
}
RedirectURI mapped from table <redirect_uris>
func (*RedirectURI) TableName ¶
func (*RedirectURI) TableName() string
TableName RedirectURI's table name
type RefreshToken ¶
type RefreshToken struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
Hash string `gorm:"column:hash;not null" json:"hash"`
Type string `gorm:"column:type;not null" json:"type"`
IssuedAt time.Time `gorm:"column:issued_at;not null" json:"issued_at"`
Exp time.Time `gorm:"column:exp;not null" json:"exp"`
ClientID string `gorm:"column:client_id;not null;comment:アプリケーションID" json:"client_id"` // アプリケーションID
UserID string `gorm:"column:user_id;not null" json:"user_id"`
Revoked bool `gorm:"column:revoked;not null" json:"revoked"`
}
RefreshToken mapped from table <refresh_tokens>
func (*RefreshToken) TableName ¶
func (*RefreshToken) TableName() string
TableName RefreshToken's table name
type Role ¶
type Role struct {
ID string `gorm:"column:id;primaryKey" json:"id"`
CustomID string `gorm:"column:custom_id" json:"custom_id"`
Permissions int32 `gorm:"column:permissions;not null" json:"permissions"`
CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
IsEnable bool `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
System bool `gorm:"column:system;not null" json:"system"`
}
Role ロール情報
type Session ¶
type Session struct {
ID string `gorm:"column:id;primaryKey" json:"id"`
UserID string `gorm:"column:user_id;not null" json:"user_id"`
IPAddress string `gorm:"column:ip_address;not null" json:"ip_address"`
UserAgent string `gorm:"column:user_agent;not null" json:"user_agent"`
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
IsEnable bool `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}
Session mapped from table <sessions>
type TokenSet ¶
type TokenSet struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
OidcAuthorizationID int32 `gorm:"column:oidc_authorization_id;not null" json:"oidc_authorization_id"`
AccessTokenID int32 `gorm:"column:access_token_id;not null" json:"access_token_id"`
RefreshTokenID int32 `gorm:"column:refresh_token_id;not null" json:"refresh_token_id"`
IsEnable bool `gorm:"column:is_enable;not null;default:1" json:"is_enable"`
}
TokenSet mapped from table <token_sets>
type User ¶
type User struct {
ID string `gorm:"column:id;primaryKey" json:"id"`
CustomID string `gorm:"column:custom_id" json:"custom_id"`
Name string `gorm:"column:name;not null" json:"name"`
PasswordHash string `gorm:"column:password_hash" json:"password_hash"`
Email string `gorm:"column:email" json:"email"`
ExternalEmail string `gorm:"column:external_email;not null" json:"external_email"`
Period string `gorm:"column:period;not null" json:"period"`
JoinedAt *time.Time `gorm:"column:joined_at" json:"joined_at"`
IsSystem bool `gorm:"column:is_system;not null" json:"is_system"`
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
IsEnable bool `gorm:"column:is_enable;default:1" json:"is_enable"`
}
User mapped from table <users>
type UserApp ¶
type UserApp struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
AppID string `gorm:"column:app_id" json:"app_id"`
UserID string `gorm:"column:user_id" json:"user_id"`
}
UserApp mapped from table <user_app>