api

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidEmail = newError("invalid_email", "invalid email.", http.StatusBadRequest)

	ErrorInvalidClient = newError("invalid_client", "invalid email.", http.StatusBadRequest)

	ErrorDuplicateEmail   = newError("duplicate_email", "Email already in use.", http.StatusBadRequest)
	ErrorResourceNotFound = newError("resource_not_found", "Resource could not be found.", http.StatusNotFound)

	ErrorUnauthorized = newError("unauthorized", "The given user and client are not authorized to make this request.", http.StatusUnauthorized)

	ErrorMaxResultsTooHigh = newError("max_results_too_high", fmt.Sprintf("The max number of results per page is %d", maxUsersPerPage), http.StatusBadRequest)

	ErrorInvalidRedirectURL = newError("invalid_redirect_url", "The provided redirect URL is invalid for the given client", http.StatusBadRequest)
)

Functions

This section is empty.

Types

type Creds

type Creds struct {
	ClientID string
	User     user.User
}

type Emailer

type Emailer interface {
	SendInviteEmail(string, url.URL, string) (*url.URL, error)
}

type Error

type Error struct {
	Type string

	// The HTTP Code to return for this type of error.
	Code int

	Desc string

	// The underlying error - not to be consumed by external users.
	Internal error
}

Error is the error type returned by AdminAPI methods.

func (Error) Error

func (e Error) Error() string

type UsersAPI

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

All calls take a Creds object with the ClientID of the calling app and the calling User. It is assumed that the clientID has already validated as an admin app before calling.

func NewUsersAPI

func NewUsersAPI(manager *manager.UserManager, cir client.ClientIdentityRepo, emailer Emailer, localConnectorID string) *UsersAPI

func (*UsersAPI) Authorize

func (u *UsersAPI) Authorize(creds Creds) bool

func (*UsersAPI) CreateUser

func (u *UsersAPI) CreateUser(creds Creds, usr schema.User, redirURL url.URL) (schema.UserCreateResponse, error)

func (*UsersAPI) DisableUser added in v0.2.0

func (u *UsersAPI) DisableUser(creds Creds, userID string, disable bool) (schema.UserDisableResponse, error)

func (*UsersAPI) GetUser

func (u *UsersAPI) GetUser(creds Creds, id string) (schema.User, error)

func (*UsersAPI) ListUsers

func (u *UsersAPI) ListUsers(creds Creds, maxResults int, nextPageToken string) ([]*schema.User, string, error)

Jump to

Keyboard shortcuts

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