models

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validator

func Validator() *validator.Validate

Validator builds a custom struct validator.

Types

type GetUserInput

type GetUserInput struct {
	ID *string `json:"id" validate:"required,uuid4"`
}

GetUserInput retrieves a user's information based on id.

Example:

{
    "getUser": {
        "id": "8304cc90-750d-4b8f-9a63-b90a4543c707"
    }
}

type GetUserOutput

type GetUserOutput = User

GetUserOutput returns the Panther user details.

Example:

{
    "createdAt": 1583378248,
    "email": "panther@example.com",
    "familyName": "byers",
    "givenName": "austin",
    "id": "8304cc90-750d-4b8f-9a63-b90a4543c707",
    "status": "FORCE_CHANGE_PASSWORD"
}

type InviteUserInput

type InviteUserInput struct {
	// Which Panther user is making this request?
	RequesterID *string `json:"requesterId" validate:"required,uuid4"`

	GivenName  *string `json:"givenName" validate:"required,min=1,excludesall='<>&\""`
	FamilyName *string `json:"familyName" validate:"required,min=1,excludesall='<>&\""`
	Email      *string `json:"email" validate:"required,email"`

	// RESEND or SUPPRESS the invitation message
	MessageAction *string `json:"messageAction" validate:"omitempty,oneof=RESEND SUPPRESS"`
}

InviteUserInput creates a new user with minimal permissions and sends them an invite.

type InviteUserOutput

type InviteUserOutput = User

InviteUserOutput returns the new user details.

type LambdaInput

type LambdaInput struct {
	GetUser           *GetUserInput           `json:"getUser"`
	InviteUser        *InviteUserInput        `json:"inviteUser"`
	ListUsers         *ListUsersInput         `json:"listUsers"`
	RemoveUser        *RemoveUserInput        `json:"removeUser"`
	ResetUserPassword *ResetUserPasswordInput `json:"resetUserPassword"`
	UpdateUser        *UpdateUserInput        `json:"updateUser"`
}

LambdaInput is the invocation event expected by the Lambda function.

Exactly one action must be specified, see comments below for examples.

type ListUsersInput added in v0.2.0

type ListUsersInput struct {
	// FILTERING (filters are combined with logical AND)
	// Show only users whose name or email contains this substring (case-insensitive)
	Contains *string `json:"contains"`

	// Show only users with this Cognito status
	Status *string `json:"status"`

	// SORTING
	// By default, sort by email ascending
	SortBy  *string `json:"sortBy" validate:"omitempty,oneof=email firstName lastName createdAt"`
	SortDir *string `json:"sortDir" validate:"omitempty,oneof=ascending descending"`
}

ListUsersInput lists all users in Panther.

Example:

{
    "listUsers": {
        "contains": "austin"
    }
}

type ListUsersOutput added in v0.2.0

type ListUsersOutput struct {
	Users []User `json:"users"`
}

ListUsersOutput returns all matching users.

{
    "users": [
        {
            "createdAt": 1583378248,
            "email": "austin.byers@runpanther.io",
            "familyName": "byers",
            "givenName": "austin",
            "id": "8304cc90-750d-4b8f-9a63-b90a4543c707",
            "status": "FORCE_CHANGE_PASSWORD"
        }
   ]
}

type RemoveUserInput added in v0.2.0

type RemoveUserInput struct {
	// Which Panther user is making this request?
	RequesterID *string `json:"requesterId" validate:"required,uuid4"`

	ID *string `json:"id" validate:"required,uuid4"`
}

RemoveUserInput deletes a user.

This will fail if the user is the only one with UserModify permissions.

type RemoveUserOutput added in v1.0.0

type RemoveUserOutput struct {
	ID *string `json:"id"`
}

RemoveUserOutput returns the ID of the deleted user.

type ResetUserPasswordInput

type ResetUserPasswordInput struct {
	// Which Panther user is making this request?
	RequesterID *string `json:"requesterId" validate:"required,uuid4"`

	ID *string `json:"id" validate:"required,uuid4"`
}

ResetUserPasswordInput resets the password for a user.

type ResetUserPasswordOutput added in v1.0.0

type ResetUserPasswordOutput struct {
	ID *string `json:"id"`
}

ResetUserPasswordOutput returns the ID of the reset user.

type UpdateUserInput

type UpdateUserInput struct {
	// Which Panther user is making this request?
	RequesterID *string `json:"requesterId" validate:"required,uuid4"`

	ID *string `json:"id" validate:"required,uuid4"`

	// At least one of the following must be specified:
	GivenName  *string `json:"givenName" validate:"omitempty,min=1,excludesall='<>&\""`
	FamilyName *string `json:"familyName" validate:"omitempty,min=1,excludesall='<>&\""`
	Email      *string `json:"email" validate:"omitempty,min=1"`
}

UpdateUserInput updates user details.

type UpdateUserOutput added in v1.0.0

type UpdateUserOutput = User

UpdateUserOutput returns the new Panther user details.

type User

type User struct {
	CreatedAt  *int64  `json:"createdAt"`
	Email      *string `json:"email"`
	FamilyName *string `json:"familyName"`
	GivenName  *string `json:"givenName"`
	ID         *string `json:"id"`
	Status     *string `json:"status"`
}

User describes a Panther user

Jump to

Keyboard shortcuts

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