params

package
v0.0.0-...-98ac3e5 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2016 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(code ErrorCode, f string, a ...interface{}) error

NewError returns a new *Error with the given error code and message.

Types

type AgentLogin

type AgentLogin struct {
	Username  Username          `json:"username"`
	PublicKey *bakery.PublicKey `json:"public_key"`
}

AgentLogin contains the claimed identity the agent is attempting to use to log in.

type AgentLoginResponse

type AgentLoginResponse struct {
	AgentLogin bool `json:"agent_login"`
}

AgentLoginResponse contains the response to an agent login attempt.

type Error

type Error struct {
	Message string    `json:"message,omitempty"`
	Code    ErrorCode `json:"code,omitempty"`
}

Error represents an error - it is returned for any response that fails.

func (*Error) Cause

func (e *Error) Cause() error

Cause implements errgo.Causer.Cause.

func (*Error) Error

func (e *Error) Error() string

Error implements error.Error.

func (*Error) ErrorCode

func (e *Error) ErrorCode() string

ErrorCode holds the class of the error in machine readable format.

type ErrorCode

type ErrorCode string

ErrorCode holds the class of an error in machine-readable format. It is also an error in its own right.

const (
	ErrNotFound             ErrorCode = "not found"
	ErrForbidden            ErrorCode = "forbidden"
	ErrBadRequest           ErrorCode = "bad request"
	ErrUnauthorized         ErrorCode = "unauthorized"
	ErrAlreadyExists        ErrorCode = "already exists"
	ErrNoAdminCredsProvided ErrorCode = "no admin credentials provided"
	ErrMethodNotAllowed     ErrorCode = "method not allowed"
	ErrServiceUnavailable   ErrorCode = "service unavailable"
)

func (ErrorCode) Error

func (code ErrorCode) Error() string

func (ErrorCode) ErrorCode

func (code ErrorCode) ErrorCode() ErrorCode

type LoginMethods

type LoginMethods struct {
	// Agent is the endpoint to connect to, if the client wishes to
	// authenticate as an agent.
	Agent string `json:"agent,omitempty"`

	// Interactive is the endpoint to connect to, if the user can
	// interact with the login process.
	Interactive string `json:"interactive,omitempty"`

	// UbuntuSSO OAuth is the endpoint to send a request, signed with
	// UbuntuSSO OAuth credentials, to if the client wishes to use
	// oauth to log in to Identity Manager. Ubuntu SSO uses oauth 1.0.
	UbuntuSSOOAuth string `json:"usso_oauth,omitempty"`

	// Form is the endpoint to GET a schema for a login form which
	// can be presented to the user in an interactive manner. The
	// schema will be returned as an environschema.Fields object. The
	// completed form should be POSTed back to the same endpoint.
	Form string `json:"form,omitempty"`
}

LoginMethods holds the response from the /v1/login endpoint when called with "Accept: application/json". This enumerates the available methods for the client to log in.

type PublicKeyRequest

type PublicKeyRequest struct {
	httprequest.Route `httprequest:"GET /publickey"`
}

PublicKeyRequest documents the /publickey endpoint. As it contains no request information there is no need to ever create one.

type PublicKeyResponse

type PublicKeyResponse struct {
	PublicKey *bakery.PublicKey
}

PublicKeyResponse is the response to a PublicKeyRequest.

type QueryUsersRequest

type QueryUsersRequest struct {
	httprequest.Route `httprequest:"GET /v1/u" bson:",omitempty"`
	ExternalID        string `httprequest:"external_id,form" bson:"external_id,omitempty"`
}

QueryUsersRequest is a request to query the users in the system.

type SetUserExtraInfoItemRequest

type SetUserExtraInfoItemRequest struct {
	httprequest.Route `httprequest:"PUT /v1/u/:username/extra-info/:item"`
	Username          Username    `httprequest:"username,path"`
	Item              string      `httprequest:"item,path"`
	Data              interface{} `httprequest:",body"`
}

SetUserExtraInfoItemRequest is a request to update a single element of the arbitrary extra information stored about the user.

type SetUserExtraInfoRequest

type SetUserExtraInfoRequest struct {
	httprequest.Route `httprequest:"PUT /v1/u/:username/extra-info"`
	Username          Username               `httprequest:"username,path"`
	ExtraInfo         map[string]interface{} `httprequest:",body"`
}

SetUserExtraInfoRequest is a request to updated the arbitrary extra information stored about the user.

type SetUserRequest

type SetUserRequest struct {
	httprequest.Route `httprequest:"PUT /v1/u/:username"`
	Username          Username `httprequest:"username,path"`
	User              `httprequest:",body"`
}

SetUserRequest is request to set the details of a user.

type User

type User struct {
	Username   Username            `json:"username,omitempty"`
	ExternalID string              `json:"external_id"`
	FullName   string              `json:"fullname"`
	Email      string              `json:"email"`
	GravatarID string              `json:"gravatar_id"`
	IDPGroups  []string            `json:"idpgroups"`
	Owner      Username            `json:"owner,omitempty"`
	PublicKeys []*bakery.PublicKey `json:"public_keys"`
}

User represents a user in the system.

type UserExtraInfoItemRequest

type UserExtraInfoItemRequest struct {
	httprequest.Route `httprequest:"GET /v1/u/:username/extra-info/:item"`
	Username          Username `httprequest:"username,path"`
	Item              string   `httprequest:"item,path"`
}

UserExtraInfoItemRequest is a request for a single element of the arbitrary extra information stored about the user.

type UserExtraInfoRequest

type UserExtraInfoRequest struct {
	httprequest.Route `httprequest:"GET /v1/u/:username/extra-info"`
	Username          Username `httprequest:"username,path"`
}

UserExtraInfoRequest is a request for the arbitrary extra information stored about the user.

type UserGroupsRequest

type UserGroupsRequest struct {
	httprequest.Route `httprequest:"GET /v1/u/:username/groups"`
	Username          Username `httprequest:"username,path"`
}

UserGroupsRequest is a request for the list of groups associated with the specified user.

type UserIDPGroupsRequest

type UserIDPGroupsRequest struct {
	httprequest.Route `httprequest:"GET /v1/u/:username/idpgroups"`
	UserGroupsRequest
}

UserIDPGroupsRequest defines the deprecated path for UserGroupsRequest. It should no longer be used.

type UserRequest

type UserRequest struct {
	httprequest.Route `httprequest:"GET /v1/u/:username"`
	Username          Username `httprequest:"username,path"`
}

UserRequest is a request for the user details of the named user.

type UserTokenRequest

type UserTokenRequest struct {
	httprequest.Route `httprequest:"GET /v1/u/:username/macaroon"`
	Username          Username `httprequest:"username,path"`
}

UserTokenRequest is a request for a new token to represent the user.

type Username

type Username string

Username represents the name of a user.

func (*Username) UnmarshalText

func (u *Username) UnmarshalText(b []byte) error

UnmarshalText unmarshals a Username checking it is valid. It implements "encoding".TextUnmarshaler.

type VerifyTokenRequest

type VerifyTokenRequest struct {
	httprequest.Route `httprequest:"POST /v1/verify"`
	Macaroons         macaroon.Slice `httprequest:",body"`
}

VerifyTokenRequest is a request to verify that the provided macaroon.Slice is valid and represents a user from identity.

Jump to

Keyboard shortcuts

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