Version: v0.0.0-...-c6fd817 Latest Latest

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

Go to latest
Published: Nov 28, 2016 License: MIT Imports: 10 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Client

type Client struct {
	Id           string   `json:"id"`
	Name         string   `json:"name"`
	Secret       string   `json:"secret"`
	Type         string   `json:"type"`
	Internal     bool     `json:"internal"`
	RedirectUris []string `json:"redirect_uris"`


func (*Client) GetId

func (c *Client) GetId() string

func (*Client) GetInternal

func (c *Client) GetInternal() bool

func (*Client) GetName

func (c *Client) GetName() string

func (*Client) GetRedirectURIs

func (c *Client) GetRedirectURIs() []string

func (*Client) GetSecret

func (c *Client) GetSecret() string

func (*Client) GetType

func (c *Client) GetType() string

func (*Client) SetId

func (c *Client) SetId(id string)

func (*Client) SetInternal

func (c *Client) SetInternal(internal bool)

func (*Client) SetName

func (c *Client) SetName(name string)

func (*Client) SetRedirectURIs

func (c *Client) SetRedirectURIs(redirectURIs []string)

func (*Client) SetSecret

func (c *Client) SetSecret(secret string)

func (*Client) SetType

func (c *Client) SetType(t string)

type SqlDB

type SqlDB struct {
	Db *sql.DB

func NewSqlDB

func NewSqlDB(db *sql.DB) *SqlDB

func (*SqlDB) CreateClient

func (db *SqlDB) CreateClient(client heimdall.Client) (heimdall.Client, error)

func (*SqlDB) CreateToken

func (db *SqlDB) CreateToken(token heimdall.Token) (heimdall.Token, error)

func (*SqlDB) CreateUser

func (db *SqlDB) CreateUser(user heimdall.User) (heimdall.User, error)

func (*SqlDB) DeleteClient

func (db *SqlDB) DeleteClient(clientId string) error

func (*SqlDB) DeleteToken

func (db *SqlDB) DeleteToken(tokenId string) error

func (*SqlDB) DeleteUser

func (db *SqlDB) DeleteUser(userId string) error

func (*SqlDB) GetClient

func (db *SqlDB) GetClient(clientId string) (heimdall.Client, error)

func (*SqlDB) GetToken

func (db *SqlDB) GetToken(tokenId string) (heimdall.Token, error)

func (*SqlDB) GetUser

func (db *SqlDB) GetUser(userId string) (heimdall.User, error)

func (*SqlDB) InsertOrUpdateRawUser

func (db *SqlDB) InsertOrUpdateRawUser(userId, name string, user map[string]interface{}) (heimdall.User, error)

Not part of the heimdall interface, but this will allow sso entities to create more complex user objects

func (*SqlDB) NewClient

func (db *SqlDB) NewClient() heimdall.Client

func (*SqlDB) NewToken

func (db *SqlDB) NewToken() heimdall.Token

func (*SqlDB) NewUser

func (db *SqlDB) NewUser() heimdall.User

func (*SqlDB) UpdateClient

func (db *SqlDB) UpdateClient(client heimdall.Client) (heimdall.Client, error)

func (*SqlDB) UpdateToken

func (db *SqlDB) UpdateToken(token heimdall.Token) (heimdall.Token, error)

func (*SqlDB) UpdateUser

func (db *SqlDB) UpdateUser(user heimdall.User) (heimdall.User, error)

func (*SqlDB) VerifyClient

func (db *SqlDB) VerifyClient(clientId, clientSecret string) (heimdall.Client, error)

func (*SqlDB) VerifyUser

func (db *SqlDB) VerifyUser(username, password string) (heimdall.User, error)

type Token

type Token struct {
	Id           string    `json:"id"`
	Type         string    `json:"type"`
	UserId       string    `json:"user_id"`
	ClientId     string    `json:"client_id"`
	Expires      time.Time `json:"expires"`
	Scope        []string  `json:"scope"`
	AccessType   string    `json:"access_type"`
	RefreshToken string    `json:"refresh_token"`


func (*Token) GetAccessType

func (t *Token) GetAccessType() string

func (*Token) GetClientId

func (t *Token) GetClientId() string

func (*Token) GetExpires

func (t *Token) GetExpires() time.Time

func (*Token) GetId

func (t *Token) GetId() string

func (*Token) GetRefreshToken

func (t *Token) GetRefreshToken() string

func (*Token) GetScope

func (t *Token) GetScope() []string

func (*Token) GetType

func (t *Token) GetType() string

func (*Token) GetUserId

func (t *Token) GetUserId() string

func (*Token) SetAccessType

func (t *Token) SetAccessType(accessType string)

func (*Token) SetClientId

func (t *Token) SetClientId(clientId string)

func (*Token) SetExpires

func (t *Token) SetExpires(expires time.Time)

func (*Token) SetId

func (t *Token) SetId(id string)

func (*Token) SetRefreshToken

func (t *Token) SetRefreshToken(refreshToken string)

func (*Token) SetScope

func (t *Token) SetScope(scope []string)

func (*Token) SetType

func (t *Token) SetType(tp string)

func (*Token) SetUserId

func (t *Token) SetUserId(userId string)

type User

type User struct {
	Id      string `json:"id"`
	Name    string `json:"displayName"`
	Clients map[string]struct {
		Concents      []string `json:"concents"`
		RefreshTokens []string `json:"refresh_tokens"`
	} `json:"clients"`


func (*User) GetConcents

func (u *User) GetConcents(clientId string) []string

func (*User) GetId

func (u *User) GetId() string

func (*User) GetName

func (u *User) GetName() string

func (*User) GetRefreshTokens

func (u *User) GetRefreshTokens(clientId string) []string

func (*User) SetConcents

func (u *User) SetConcents(clientId string, concents []string)

func (*User) SetId

func (u *User) SetId(id string)

func (*User) SetName

func (u *User) SetName(name string)

func (*User) SetRefreshTokens

func (u *User) SetRefreshTokens(clientId string, refreshTokens []string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL