users

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModifyUserRequest added in v0.3.0

type ModifyUserRequest struct {
	Role *roletype.RoleType `json:"role,omitempty"`
}

ModifyUserRequest is used to modify a user

type User

type User struct {
	service.Subject

	OrganizationID string           `json:"organizationId"`
	FullName       string           `json:"fullName"`
	Email          string           `json:"email"`
	IsAdmin        bool             `json:"isAdmin"`
	TimeCreated    types.Timestamp  `json:"timeCreated"`
	LastLogin      *types.Timestamp `json:"lastLogin"`
}

User is a BastionZero user belonging to an organization

func (*User) GetSubjectType

func (u *User) GetSubjectType() subjecttype.SubjectType

type UsersService

type UsersService client.Service

UsersService handles communication with the users endpoints of the BastionZero API.

BastionZero API docs: https://cloud.bastionzero.com/api/#tag--Users

func (*UsersService) CloseUserConnections added in v0.3.0

func (s *UsersService) CloseUserConnections(ctx context.Context, id string) (*http.Response, error)

CloseUserConnections closes all connections of the specified user.

BastionZero API docs: https://cloud.bastionzero.com/api/#patch-/api/v2/users/-id-/close-connections

func (*UsersService) DeleteUser added in v0.3.0

func (s *UsersService) DeleteUser(ctx context.Context, id string) (*http.Response, error)

DeleteUser deletes the specified user.

BastionZero API docs: https://cloud.bastionzero.com/api/#delete-/api/v2/users/-id-

func (*UsersService) GetUser

func (s *UsersService) GetUser(ctx context.Context, userIDOrEmail string) (*User, *http.Response, error)

GetUser fetches the specified user by ID or email address.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/users/-id-, https://cloud.bastionzero.com/api/#get-/api/v2/users/-email-

func (*UsersService) ListUsers

func (s *UsersService) ListUsers(ctx context.Context) ([]User, *http.Response, error)

ListUsers lists all users in your organization.

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/users

func (*UsersService) Me added in v0.3.0

func (s *UsersService) Me(ctx context.Context) (*User, *http.Response, error)

Me fetches your user information (current subject).

BastionZero API docs: https://cloud.bastionzero.com/api/#get-/api/v2/users/me

func (*UsersService) ModifyUser added in v0.3.0

func (s *UsersService) ModifyUser(ctx context.Context, id string, request *ModifyUserRequest) (*http.Response, error)

ModifyUser updates the specified user.

BastionZero API docs: https://cloud.bastionzero.com/api/#patch-/api/v2/users/-id-

Jump to

Keyboard shortcuts

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