responses

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInternalServerError = &ErrResponse{Schemas: errorSchema, HTTPStatusCode: 500, Details: "Internal server error"}

Functions

func ErrBadFilter

func ErrBadFilter(err error) render.Renderer

func ErrBadValue

func ErrBadValue(err error) render.Renderer

func ErrNotFound

func ErrNotFound(id string) render.Renderer

Types

type ErrResponse

type ErrResponse struct {
	Schemas        []string `json:"schemas"`
	Details        string   `json:"details"`
	HTTPStatusCode int      `json:"status"`
	ScimType       string   `json:"scimType,omitempty"`
}

func (*ErrResponse) Render

func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error

type ScimGroupListResponseInput

type ScimGroupListResponseInput struct {
	TotalResults int
	StartIndex   int
	ItemsPerPage int
}

type ScimGroupResponse

type ScimGroupResponse struct {
	Schemas     []string            `json:"schemas,omitempty"`
	ID          string              `json:"id"`
	DisplayName string              `json:"displayName"`
	Members     []map[string]string `json:"members"`
	Meta        map[string]string   `json:"meta"`
}

func NewScimGroupResponse

func NewScimGroupResponse(
	bridge *bridge.Bridge,
	group database.Group,
	members []database.GroupMembership,
) *ScimGroupResponse

func (*ScimGroupResponse) Render

type ScimListGroupsResponse

type ScimListGroupsResponse struct {
	Schemas      []string             `json:"schemas"`
	ItemsPerPage int                  `json:"itemsPerPage"`
	StartIndex   int                  `json:"startIndex"`
	TotalResults int                  `json:"totalResults"`
	Resources    []*ScimGroupResponse `json:"Resources"`
}

func NewScimGroupListResponse

func NewScimGroupListResponse(
	bridge *bridge.Bridge,
	groups []database.Group,
	input ScimGroupListResponseInput,
) *ScimListGroupsResponse

func (*ScimListGroupsResponse) Render

type ScimListUsersResponse

type ScimListUsersResponse struct {
	Schemas      []string            `json:"schemas"`
	ItemsPerPage int                 `json:"itemsPerPage"`
	StartIndex   int                 `json:"startIndex"`
	TotalResults int                 `json:"totalResults"`
	Resources    []*ScimUserResponse `json:"Resources"`
}

func NewScimUserListResponse

func NewScimUserListResponse(
	bridge *openfga_scim_bridge.Bridge,
	users []database.User,
	input ScimUserListResponseInput,
) *ScimListUsersResponse

func (*ScimListUsersResponse) Render

type ScimUserListResponseInput

type ScimUserListResponseInput struct {
	TotalResults int
	StartIndex   int
	ItemsPerPage int
}

type ScimUserResponse

type ScimUserResponse struct {
	Schemas  []string             `json:"schemas,omitempty"`
	UserName string               `json:"userName"`
	ID       string               `json:"id"`
	Name     map[string]string    `json:"name,omitempty"`
	Emails   []payloads.UserEmail `json:"emails,omitempty"`
	Active   bool                 `json:"active"`
	Meta     map[string]string    `json:"meta"`
}

func NewScimUserResponse

func NewScimUserResponse(bridge *openfga_scim_bridge.Bridge, user database.User) *ScimUserResponse

func (*ScimUserResponse) Render

Jump to

Keyboard shortcuts

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