Documentation ¶
Index ¶
- Constants
- Variables
- func IsUnauthorizedError(err error) bool
- 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) Start() error
- func (s *Standard) ValidateTargetUserPermissions(context service.Context, requestUserID string, targetUserID string, ...) error
- func (s *Standard) ValidateUserSession(context service.Context, sessionToken string) (string, error)
- type UnauthorizedError
- type UnexpectedResponseError
Constants ¶
View Source
const ( TidepoolServerNameHeaderName = "x-tidepool-server-name" TidepoolServerSecretHeaderName = "x-tidepool-server-secret" TidepoolUserSessionTokenHeaderName = "x-tidepool-session-token" ServerTokenTimeoutOnFailureFirst = time.Second ServerTokenTimeoutOnFailureLast = 60 * time.Second )
Variables ¶
View Source
var UploadPermissions = Permissions{"upload": {}}
View Source
var ViewPermissions = Permissions{"view": {}}
Functions ¶
func IsUnauthorizedError ¶
Types ¶
type Client ¶
type Client interface { Start() error Close() ValidateUserSession(context service.Context, sessionToken string) (string, error) ValidateTargetUserPermissions(context service.Context, requestUserID string, targetUserID string, targetPermissions Permissions) error GetUserGroupID(context service.Context, userID string) (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 (*Standard) GetUserGroupID ¶
func (*Standard) ValidateTargetUserPermissions ¶
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.