Documentation ¶
Index ¶
- Constants
- func IsUnauthorizedError(err error) bool
- type AuthenticationDetails
- type Client
- type Config
- type Permission
- type Permissions
- type Standard
- func (s *Standard) Close()
- func (s *Standard) GetUserGroupID(context service.Context, userID string) (string, error)
- func (s *Standard) GetUserPermissions(context service.Context, requestUserID string, targetUserID string) (Permissions, error)
- func (s *Standard) ServerToken() (string, error)
- func (s *Standard) Start() error
- func (s *Standard) ValidateAuthenticationToken(context service.Context, authenticationToken string) (AuthenticationDetails, error)
- type UnauthorizedError
- type UnexpectedResponseError
Constants ¶
View Source
const ( TidepoolServerNameHeaderName = "X-Tidepool-Server-Name" TidepoolServerSecretHeaderName = "X-Tidepool-Server-Secret" TidepoolAuthenticationTokenHeaderName = "X-Tidepool-Session-Token" ServerTokenTimeoutOnFailureFirst = time.Second ServerTokenTimeoutOnFailureLast = 60 * time.Second )
View Source
const CustodianPermission = "custodian"
View Source
const OwnerPermission = "root"
View Source
const UploadPermission = "upload"
View Source
const ViewPermission = "view"
Variables ¶
This section is empty.
Functions ¶
func IsUnauthorizedError ¶
Types ¶
type AuthenticationDetails ¶ added in v1.0.0
type Client ¶
type Client interface { ValidateAuthenticationToken(context service.Context, authenticationToken string) (AuthenticationDetails, error) GetUserPermissions(context service.Context, requestUserID string, targetUserID string) (Permissions, error) GetUserGroupID(context service.Context, userID string) (string, error) ServerToken() (string, error) }
type Config ¶
type Permission ¶
type Permission map[string]interface{}
type Permissions ¶
type Permissions map[string]Permission
type Standard ¶
type Standard struct {
// contains filtered or unexported fields
}
func NewStandard ¶
func (*Standard) GetUserGroupID ¶
func (*Standard) GetUserPermissions ¶ added in v0.1.0
func (*Standard) ServerToken ¶ added in v1.2.0
func (*Standard) ValidateAuthenticationToken ¶ added in v1.0.0
type UnauthorizedError ¶
type UnauthorizedError struct{}
func NewUnauthorizedError ¶
func NewUnauthorizedError() *UnauthorizedError
func (*UnauthorizedError) Error ¶
func (u *UnauthorizedError) Error() string
type UnexpectedResponseError ¶
func NewUnexpectedResponseError ¶
func NewUnexpectedResponseError(response *http.Response, request *http.Request) *UnexpectedResponseError
func (*UnexpectedResponseError) Error ¶
func (u *UnexpectedResponseError) Error() string
Click to show internal directories.
Click to hide internal directories.