gcloak

package module
v0.0.0-...-33b1edd Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: MIT Imports: 8 Imported by: 0

README

gcloak

A GO wrapper for the Keycloak API

It's modeled loosely on the official Java API client.

At the moment it's under heavy development and API's are expected to change.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccessDenied = errors.New("access denied")
	ErrNotFound     = errors.New("not found")
	ErrInvalidId    = errors.New("invalid id")
)

Functions

This section is empty.

Types

type ClientResource

type ClientResource interface {
	GenerateSecret() (*representations.Credential, error)
	ClientSecret() (*representations.Credential, error)
	ServiceAccountUser() (*representations.User, error)
	Roles() RolesResource
}

type ClientsResource

type ClientsResource interface {
	Create(role *representations.Client) (id string, err error)
	Get(id string) (*representations.Client, error)
	Update(id string, role *representations.Client) error
	Delete(id string) error
	Count() (int, error)
	List() ([]*representations.Client, error)
	Resource(id string) ClientResource
}

type GroupsResource

type GroupsResource interface {
}

type Keycloak

type Keycloak interface {
	ServerInfo() (*representations.ServerInfo, error)
	Realm(name string) RealmResource
	CreateRealm(realm *representations.Realm) error
	Realms() ([]*representations.Realm, error)
}

func New

func New(baseUrl string, httpClient *http.Client) Keycloak

type RealmResource

type RealmResource interface {
	Users() UsersResource
	Clients() ClientsResource
	Roles() RolesResource
	Groups() GroupsResource
}

RealmResource handles all the actions relating to one realm.

type RoleMappingResource

type RoleMappingResource interface {
	Client(id string) RoleScopeResource
	All() *representations.Mappings
	Realm() RoleScopeResource
}

type RoleScopeResource

type RoleScopeResource interface {
	Add(roles []*representations.Role) error
	List() ([]*representations.Role, error)
	ListAvailable() ([]*representations.Role, error)
	ListEffective() ([]*representations.Role, error)
	Remove(roles []*representations.Role) error
}

type RolesResource

type RolesResource interface {
	Create(role *representations.Role) (id string, err error)
	Get(name string) (*representations.Role, error)
	Update(name string, role *representations.Role) error
	Delete(name string) error
	Count() (int, error)
	List() ([]*representations.Role, error)
}

type UserResource

type UserResource interface {
	Delete() error
	Roles() RoleMappingResource
	Groups() ([]*representations.Group, error)
	ResetPassword(credential *representations.Credential) error
	// Send an email with a reset password link to the user
	SendVerifyEmail() error
	Update(user *representations.User) error
	Logout() error
	Impersonate()
	JoinGroup(groupId string) error
	LeaveGroup(groupId string) error
	Sessions() ([]*representations.Session, error)
}

type UsersResource

type UsersResource interface {
	Count() (int, error)
	Create(user *representations.User) (id string, err error)
	Get(id string) (*representations.User, error)
	List() ([]*representations.User, error)
	Search(username string) ([]*representations.User, error)
	Resource(id string) UserResource
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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