data

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenData

type AccessTokenData struct {
	ResultData    map[string]interface{}
	ResultJsonStr string
	// contains filtered or unexported fields
}

func CreateAccessToken

func CreateAccessToken(commonData *JwtCommonInfo, userData *User) *AccessTokenData

func (*AccessTokenData) Init

func (token *AccessTokenData) Init()

func (*AccessTokenData) Valid

func (token *AccessTokenData) Valid() error

type Authentication

type Authentication struct {
	Type       AuthenticationType
	Value      string
	Attributes interface{}
}

type AuthenticationType

type AuthenticationType int
const (
	ClientIdAndSecrets AuthenticationType = 1
)

type Client

type Client struct {
	Type ClientType
	ID   uuid.UUID
	Name string
	Auth Authentication
}

type ClientType

type ClientType string
const (
	Public       ClientType = "public"
	Confidential            = "confidential"
)

type JwtCommonInfo

type JwtCommonInfo struct {
	IssuedAt     time.Time `json:"iat"`
	ExpiredAt    time.Time `json:"exp"`
	JwtId        uuid.UUID `json:"jti"`
	Type         string    `json:"typ"`
	Issuer       string    `json:"iss"`
	Audience     string    `json:"aud"`
	Subject      uuid.UUID `json:"sub"`
	SessionState uuid.UUID `json:"session_state"`
	SessionId    uuid.UUID `json:"sid"`
	Scope        string    `json:"scope"`
}

type KeyCloakUser

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

func (*KeyCloakUser) GetId

func (user *KeyCloakUser) GetId() uuid.UUID

func (*KeyCloakUser) GetPassword

func (user *KeyCloakUser) GetPassword() string

func (*KeyCloakUser) GetUserInfo

func (user *KeyCloakUser) GetUserInfo() interface{}

func (*KeyCloakUser) GetUsername

func (user *KeyCloakUser) GetUsername() string

type OperationError

type OperationError struct {
	Msg         string
	Description string
}

type RawUserInfo

type RawUserInfo interface{}

type Realm

type Realm struct {
	Name                   string        `json:"name"`
	Clients                []Client      `json:"clients"`
	Users                  []interface{} `json:"users"`
	TokenExpiration        int           `json:"token_expiration"`
	RefreshTokenExpiration int           `json:"refresh_expiration"`
}

type ServerData

type ServerData struct {
	Realms []Realm
}

type TokenRefreshData

type TokenRefreshData struct {
	JwtCommonInfo
}

func CreateRefreshToken

func CreateRefreshToken(commonData *JwtCommonInfo) *TokenRefreshData

func (*TokenRefreshData) Valid

func (token *TokenRefreshData) Valid() error

type User

type User interface {
	GetUsername() string
	GetPassword() string
	GetId() uuid.UUID
	GetUserInfo() interface{}
}

func CreateUser

func CreateUser(rawData interface{}) User

type UserSession

type UserSession struct {
	Id              uuid.UUID
	UserId          uuid.UUID
	Started         time.Time
	Expired         time.Time
	RefreshExpired  time.Time
	JwtAccessToken  string
	JwtRefreshToken string
}

Jump to

Keyboard shortcuts

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