iam

package
v6.0.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package iam provides access to the Akamai Property APIs

Index

Constants

View Source
const (
	// LostAccessUsers with a userType of lostAccess lose their access to the source group
	LostAccessUsers = "lostAccess"
	// GainAccessUsers with a userType of gainAccess gain their access to the source group
	GainAccessUsers = "gainAccess"
)

Variables

View Source
var (
	// ErrListBlockedProperties is returned when ListBlockedPropertiesRequest fails
	ErrListBlockedProperties = errors.New("list blocked properties")

	// ErrUpdateBlockedProperties is returned when UpdateBlockedPropertiesRequest fails
	ErrUpdateBlockedProperties = errors.New("update blocked properties")
)
View Source
var (
	// ErrCreateGroup is returned when CreateGroup fails
	ErrCreateGroup = errors.New("create group")
	// ErrGetGroup is returned when GetGroup fails
	ErrGetGroup = errors.New("get group")
	// ErrListAffectedUsers is returned when ListAffectedUsers fails
	ErrListAffectedUsers = errors.New("list affected users")
	// ErrListGroups is returned when ListGroups fails
	ErrListGroups = errors.New("list groups")
	// ErrUpdateGroupName is returned when UpdateGroupName fails
	ErrUpdateGroupName = errors.New("update group name")
	// ErrRemoveGroup is returned when RemoveGroup fails
	ErrRemoveGroup = errors.New("remove group")
	// ErrMoveGroup is returned when MoveGroup fails
	ErrMoveGroup = errors.New("move group")
)
View Source
var (
	// ErrCreateRole is returned when CreateRole fails
	ErrCreateRole = errors.New("create a role")
	// ErrGetRole is returned when GetRole fails
	ErrGetRole = errors.New("get a role")
	// ErrUpdateRole is returned when UpdateRole fails
	ErrUpdateRole = errors.New("update a role")
	// ErrDeleteRole is returned when DeleteRole fails
	ErrDeleteRole = errors.New("delete a role")
	// ErrListRoles is returned when ListRoles fails
	ErrListRoles = errors.New("list roles")
	// ErrListGrantableRoles is returned when ListGrantableRoles fails
	ErrListGrantableRoles = errors.New("list grantable roles")
)
View Source
var (
	// ErrListProducts is returned when ListProducts fails
	ErrListProducts = errors.New("list products")

	// ErrListStates is returned when ListStates fails
	ErrListStates = errors.New("list states")

	// ErrListTimeoutPolicies is returned when ListTimeoutPolicies fails
	ErrListTimeoutPolicies = errors.New("list timeout policies")

	// ErrSupportedContactTypes is returned when SupportedContactTypes fails
	ErrSupportedContactTypes = errors.New("supported contact types")

	// ErrSupportedCountries is returned when SupportedCountries fails
	ErrSupportedCountries = errors.New("supported countries")

	// ErrSupportedLanguages is returned when SupportedLanguages fails
	ErrSupportedLanguages = errors.New("supported languages")

	// ErrSupportedTimezones is returned when SupportedTimezones fails
	ErrSupportedTimezones = errors.New("supported timezones")
)
View Source
var (
	// ErrCreateUser is returned when CreateUser fails
	ErrCreateUser = errors.New("create user")

	// ErrGetUser is returned when GetUser fails
	ErrGetUser = errors.New("get user")

	// ErrListUsers is returned when GetUser fails
	ErrListUsers = errors.New("list users")

	// ErrRemoveUser is returned when RemoveUser fails
	ErrRemoveUser = errors.New("remove user")

	// ErrUpdateUserAuthGrants is returned when UpdateUserAuthGrants fails
	ErrUpdateUserAuthGrants = errors.New("update user auth grants")

	// ErrUpdateUserInfo is returned when UpdateUserInfo fails
	ErrUpdateUserInfo = errors.New("update user info")

	// ErrUpdateUserNotifications is returned when UpdateUserNotifications fails
	ErrUpdateUserNotifications = errors.New("update user notifications")

	// ErrUpdateTFA is returned when UpdateTFA fails
	ErrUpdateTFA = errors.New("update user's two-factor authentication")
)
View Source
var (
	// ErrLockUser is returned when LockUser fails
	ErrLockUser = errors.New("lock user")

	// ErrUnlockUser is returned when UnlockUser fails
	ErrUnlockUser = errors.New("unlock user")
)
View Source
var (
	// ErrResetUserPassword is returned when ResetUserPassword fails
	ErrResetUserPassword = errors.New("reset user password")

	// ErrSetUserPassword is returned when SetUserPassword fails
	ErrSetUserPassword = errors.New("set user password")
)
View Source
var (
	// ErrInputValidation is returned when the input parameters failed validation
	ErrInputValidation = errors.New("input validation error")
)
View Source
var (
	// ErrStructValidation is returned when given struct validation failed
	ErrStructValidation = errors.New("struct validation")
)

Functions

This section is empty.

Types

type AuthGrant

type AuthGrant struct {
	GroupID         int64       `json:"groupId"`
	GroupName       string      `json:"groupName"`
	IsBlocked       bool        `json:"isBlocked"`
	RoleDescription string      `json:"roleDescription"`
	RoleID          *int        `json:"roleId,omitempty"`
	RoleName        string      `json:"roleName"`
	Subgroups       []AuthGrant `json:"subGroups,omitempty"`
}

AuthGrant is user’s role assignments, per group

func (AuthGrant) Validate

func (r AuthGrant) Validate() error

Validate performs validation on AuthGrant

type AuthGrantRequest

type AuthGrantRequest struct {
	GroupID   int64              `json:"groupId"`
	IsBlocked bool               `json:"isBlocked"`
	RoleID    *int               `json:"roleId,omitempty"`
	Subgroups []AuthGrantRequest `json:"subGroups,omitempty"`
}

AuthGrantRequest is user’s role assignments, per group for the create/update operation

type BlockedProperties

type BlockedProperties interface {
	// ListBlockedProperties returns all properties a user doesn't have access to in a group
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-blocked-properties
	ListBlockedProperties(context.Context, ListBlockedPropertiesRequest) ([]int64, error)

	// UpdateBlockedProperties removes or grant user access to properties
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/put-blocked-properties
	UpdateBlockedProperties(context.Context, UpdateBlockedPropertiesRequest) ([]int64, error)
}

BlockedProperties is the IAM user blocked properties API interface

type ClientFunc

type ClientFunc func(sess session.Session, opts ...Option) IAM

ClientFunc is an IAM client new method, this can be used for mocking

type CreateRoleRequest

type CreateRoleRequest RoleRequest

CreateRoleRequest describes the request parameters of the create role endpoint

func (CreateRoleRequest) Validate

func (r CreateRoleRequest) Validate() error

Validate validates CreateRoleRequest

type CreateUserRequest

type CreateUserRequest struct {
	UserBasicInfo
	AuthGrants    []AuthGrantRequest `json:"authGrants,omitempty"`
	Notifications UserNotifications  `json:"notifications,omitempty"`
	SendEmail     bool               `json:"-"`
}

CreateUserRequest contains the request parameters for the create user endpoint

func (CreateUserRequest) Validate

func (r CreateUserRequest) Validate() error

Validate validates CreateUserRequest

type DeleteRoleRequest

type DeleteRoleRequest struct {
	ID int64
}

DeleteRoleRequest describes the request parameters of the delete role endpoint

func (DeleteRoleRequest) Validate

func (r DeleteRoleRequest) Validate() error

Validate validates DeleteRoleRequest

type Error

type Error struct {
	Type          string          `json:"type"`
	Title         string          `json:"title"`
	Detail        string          `json:"detail"`
	Instance      string          `json:"instance,omitempty"`
	BehaviorName  string          `json:"behaviorName,omitempty"`
	ErrorLocation string          `json:"errorLocation,omitempty"`
	StatusCode    int             `json:"statusCode,omitempty"`
	Errors        json.RawMessage `json:"errors,omitempty"`
	Warnings      json.RawMessage `json:"warnings,omitempty"`
	HTTPStatus    int             `json:"httpStatus,omitempty"`
}

Error is an IAM error interface

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

Is handles error comparisons

type GetGroupRequest

type GetGroupRequest struct {
	GroupID int64
	Actions bool
}

GetGroupRequest describes the request parameters of the get group endpoint

func (GetGroupRequest) Validate

func (r GetGroupRequest) Validate() error

Validate validates GetGroupRequest

type GetRoleRequest

type GetRoleRequest struct {
	ID           int64
	Actions      bool
	GrantedRoles bool
	Users        bool
}

GetRoleRequest describes the request parameters of the get role endpoint

func (GetRoleRequest) Validate

func (r GetRoleRequest) Validate() error

Validate validates GetRoleRequest

type GetUserRequest

type GetUserRequest struct {
	IdentityID    string
	Actions       bool
	AuthGrants    bool
	Notifications bool
}

GetUserRequest contains the request parameters of the get user endpoint

func (GetUserRequest) Validate

func (r GetUserRequest) Validate() error

Validate validates GetUserRequest

type GrantedRoleID

type GrantedRoleID struct {
	ID int64 `json:"grantedRoleId"`
}

GrantedRoleID describes a unique identifier for a granted role

type Group

type Group struct {
	Actions       *GroupActions `json:"actions,omitempty"`
	CreatedBy     string        `json:"createdBy"`
	CreatedDate   string        `json:"createdDate"`
	GroupID       int64         `json:"groupId"`
	GroupName     string        `json:"groupName"`
	ModifiedBy    string        `json:"modifiedBy"`
	ModifiedDate  string        `json:"modifiedDate"`
	ParentGroupID int64         `json:"parentGroupId"`
	SubGroups     []Group       `json:"subGroups,omitempty"`
}

Group describes the response of the list groups endpoint

type GroupActions

type GroupActions struct {
	Delete bool `json:"delete"`
	Edit   bool `json:"edit"`
}

GroupActions encapsulates permissions available to the user for this group

type GroupRequest

type GroupRequest struct {
	GroupID   int64  `json:"-"`
	GroupName string `json:"groupName"`
}

GroupRequest describes the request and body parameters for creating new group or updating a group name endpoint

func (GroupRequest) Validate

func (r GroupRequest) Validate() error

Validate validates GroupRequest

type GroupUser

type GroupUser struct {
	AccountID     string `json:"accountId"`
	Email         string `json:"email"`
	FirstName     string `json:"firstName"`
	IdentityID    string `json:"uiIdentityId"`
	LastLoginDate string `json:"lastLoginDate"`
	LastName      string `json:"lastName"`
	UserName      string `json:"uiUserName"`
}

GroupUser describes the response of the list affected users endpoint

type Groups

type Groups interface {
	// CreateGroup creates a new group within a parent group_id specified in the request
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-group
	CreateGroup(context.Context, GroupRequest) (*Group, error)

	// GetGroup returns a group's details
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-group
	GetGroup(context.Context, GetGroupRequest) (*Group, error)

	// ListAffectedUsers lists users who are affected when a group is moved
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-move-affected-users
	ListAffectedUsers(context.Context, ListAffectedUsersRequest) ([]GroupUser, error)

	// ListGroups lists all groups in which you have a scope of admin for the current account and contract type
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-groups
	ListGroups(context.Context, ListGroupsRequest) ([]Group, error)

	// RemoveGroup removes a group based on group_id. We can only delete a sub-group, and only if that sub-group doesn't include any users
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/delete-group
	RemoveGroup(context.Context, RemoveGroupRequest) error

	// UpdateGroupName changes the name of the group
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/put-group
	UpdateGroupName(context.Context, GroupRequest) (*Group, error)

	// MoveGroup Move a nested group under another group within the same parent hierarchy
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-groups-move
	MoveGroup(context.Context, MoveGroupRequest) error
}

Groups is the IAM group API interface

type IAM

IAM is the IAM api interface

func Client

func Client(sess session.Session, opts ...Option) IAM

Client returns a new IAM Client instance with the specified controller

type ListAffectedUsersRequest

type ListAffectedUsersRequest struct {
	DestinationGroupID int64
	SourceGroupID      int64
	UserType           string
}

ListAffectedUsersRequest describes the request and body parameters of the list affected users endpoint

func (ListAffectedUsersRequest) Validate

func (r ListAffectedUsersRequest) Validate() error

Validate validates ListAffectedUsersRequest

type ListBlockedPropertiesRequest

type ListBlockedPropertiesRequest struct {
	IdentityID string
	GroupID    int64
}

ListBlockedPropertiesRequest contains the request parameters for the list blocked properties endpoint

func (ListBlockedPropertiesRequest) Validate

func (r ListBlockedPropertiesRequest) Validate() error

Validate validates ListBlockedPropertiesRequest

type ListGroupsRequest

type ListGroupsRequest struct {
	Actions bool
}

ListGroupsRequest describes the request parameters of the list groups endpoint

type ListRolesRequest

type ListRolesRequest struct {
	GroupID       *int64
	Actions       bool
	IgnoreContext bool
	Users         bool
}

ListRolesRequest describes the request parameters of the list roles endpoint

type ListStatesRequest

type ListStatesRequest struct {
	Country string
}

ListStatesRequest contains the country request parameter for the list states endpoint

func (ListStatesRequest) Validate

func (r ListStatesRequest) Validate() error

Validate validates ListStatesRequest

type ListUsersRequest

type ListUsersRequest struct {
	GroupID    *int64
	AuthGrants bool
	Actions    bool
}

ListUsersRequest contains the request parameters for the list users endpoint

type LockUserRequest

type LockUserRequest struct {
	IdentityID string
}

LockUserRequest contains the request parameters of the lock user endpoint

func (LockUserRequest) Validate

func (r LockUserRequest) Validate() error

Validate validates LockUserRequest

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) CreateGroup

func (m *Mock) CreateGroup(ctx context.Context, request GroupRequest) (*Group, error)

func (*Mock) CreateRole

func (m *Mock) CreateRole(ctx context.Context, request CreateRoleRequest) (*Role, error)

func (*Mock) CreateUser

func (m *Mock) CreateUser(ctx context.Context, request CreateUserRequest) (*User, error)

func (*Mock) DeleteRole

func (m *Mock) DeleteRole(ctx context.Context, request DeleteRoleRequest) error

func (*Mock) GetGroup

func (m *Mock) GetGroup(ctx context.Context, request GetGroupRequest) (*Group, error)

func (*Mock) GetRole

func (m *Mock) GetRole(ctx context.Context, request GetRoleRequest) (*Role, error)

func (*Mock) GetUser

func (m *Mock) GetUser(ctx context.Context, request GetUserRequest) (*User, error)

func (*Mock) ListAffectedUsers

func (m *Mock) ListAffectedUsers(ctx context.Context, request ListAffectedUsersRequest) ([]GroupUser, error)

func (*Mock) ListBlockedProperties

func (m *Mock) ListBlockedProperties(ctx context.Context, request ListBlockedPropertiesRequest) ([]int64, error)

func (*Mock) ListGrantableRoles

func (m *Mock) ListGrantableRoles(ctx context.Context) ([]RoleGrantedRole, error)

func (*Mock) ListGroups

func (m *Mock) ListGroups(ctx context.Context, request ListGroupsRequest) ([]Group, error)

func (*Mock) ListProducts

func (m *Mock) ListProducts(ctx context.Context) ([]string, error)

func (*Mock) ListRoles

func (m *Mock) ListRoles(ctx context.Context, request ListRolesRequest) ([]Role, error)

func (*Mock) ListStates

func (m *Mock) ListStates(ctx context.Context, request ListStatesRequest) ([]string, error)

func (*Mock) ListTimeoutPolicies

func (m *Mock) ListTimeoutPolicies(ctx context.Context) ([]TimeoutPolicy, error)

func (*Mock) ListUsers

func (m *Mock) ListUsers(ctx context.Context, request ListUsersRequest) ([]UserListItem, error)

func (*Mock) LockUser

func (m *Mock) LockUser(ctx context.Context, request LockUserRequest) error

func (*Mock) MoveGroup

func (m *Mock) MoveGroup(ctx context.Context, request MoveGroupRequest) error

func (*Mock) RemoveGroup

func (m *Mock) RemoveGroup(ctx context.Context, request RemoveGroupRequest) error

func (*Mock) RemoveUser

func (m *Mock) RemoveUser(ctx context.Context, request RemoveUserRequest) error

func (*Mock) ResetUserPassword

func (m *Mock) ResetUserPassword(ctx context.Context, request ResetUserPasswordRequest) (*ResetUserPasswordResponse, error)

func (*Mock) SetUserPassword

func (m *Mock) SetUserPassword(ctx context.Context, request SetUserPasswordRequest) error

func (*Mock) SupportedContactTypes

func (m *Mock) SupportedContactTypes(ctx context.Context) ([]string, error)

func (*Mock) SupportedCountries

func (m *Mock) SupportedCountries(ctx context.Context) ([]string, error)

func (*Mock) SupportedLanguages

func (m *Mock) SupportedLanguages(ctx context.Context) ([]string, error)

func (*Mock) SupportedTimezones

func (m *Mock) SupportedTimezones(ctx context.Context) ([]Timezone, error)

func (*Mock) UnlockUser

func (m *Mock) UnlockUser(ctx context.Context, request UnlockUserRequest) error

func (*Mock) UpdateBlockedProperties

func (m *Mock) UpdateBlockedProperties(ctx context.Context, request UpdateBlockedPropertiesRequest) ([]int64, error)

func (*Mock) UpdateGroupName

func (m *Mock) UpdateGroupName(ctx context.Context, request GroupRequest) (*Group, error)

func (*Mock) UpdateRole

func (m *Mock) UpdateRole(ctx context.Context, request UpdateRoleRequest) (*Role, error)

func (*Mock) UpdateTFA

func (m *Mock) UpdateTFA(ctx context.Context, request UpdateTFARequest) error

func (*Mock) UpdateUserAuthGrants

func (m *Mock) UpdateUserAuthGrants(ctx context.Context, request UpdateUserAuthGrantsRequest) ([]AuthGrant, error)

func (*Mock) UpdateUserInfo

func (m *Mock) UpdateUserInfo(ctx context.Context, request UpdateUserInfoRequest) (*UserBasicInfo, error)

func (*Mock) UpdateUserNotifications

func (m *Mock) UpdateUserNotifications(ctx context.Context, request UpdateUserNotificationsRequest) (*UserNotifications, error)

type MoveGroupRequest

type MoveGroupRequest struct {
	SourceGroupID      int64 `json:"sourceGroupId"`
	DestinationGroupID int64 `json:"destinationGroupId"`
}

MoveGroupRequest describes the request body to move a group under another group

func (MoveGroupRequest) Validate

func (r MoveGroupRequest) Validate() error

Validate validates MoveGroupRequest

type Option

type Option func(*iam)

Option defines a IAM option

type RemoveGroupRequest

type RemoveGroupRequest struct {
	GroupID int64
}

RemoveGroupRequest describes the request parameter for removing a group

func (RemoveGroupRequest) Validate

func (r RemoveGroupRequest) Validate() error

Validate validates RemoveGroupRequest

type RemoveUserRequest

type RemoveUserRequest struct {
	IdentityID string
}

RemoveUserRequest contains the request parameters of the remove user endpoint

func (RemoveUserRequest) Validate

func (r RemoveUserRequest) Validate() error

Validate validates RemoveUserRequest

type ResetUserPasswordRequest

type ResetUserPasswordRequest struct {
	IdentityID string
	SendEmail  bool
}

ResetUserPasswordRequest contains the request parameters of the reset user password endpoint

func (ResetUserPasswordRequest) Validate

func (r ResetUserPasswordRequest) Validate() error

Validate validates ResetUserPasswordRequest

type ResetUserPasswordResponse

type ResetUserPasswordResponse struct {
	NewPassword string `json:"newPassword"`
}

ResetUserPasswordResponse contains the response from the reset user password endpoint

type Role

type Role struct {
	Actions         *RoleAction       `json:"actions,omitempty"`
	CreatedBy       string            `json:"createdBy"`
	CreatedDate     string            `json:"createdDate"`
	GrantedRoles    []RoleGrantedRole `json:"grantedRoles,omitempty"`
	ModifiedBy      string            `json:"modifiedBy"`
	ModifiedDate    string            `json:"modifiedDate"`
	RoleDescription string            `json:"roleDescription"`
	RoleID          int64             `json:"roleId"`
	RoleName        string            `json:"roleName"`
	Users           []RoleUser        `json:"users,omitempty"`
	RoleType        RoleType          `json:"type"`
}

Role encapsulates the response of the list roles endpoint

type RoleAction

type RoleAction struct {
	Delete bool `json:"delete"`
	Edit   bool `json:"edit"`
}

RoleAction encapsulates permissions available to the user for this role

type RoleGrantedRole

type RoleGrantedRole struct {
	Description string `json:"grantedRoleDescription,omitempty"`
	RoleID      int64  `json:"grantedRoleId"`
	RoleName    string `json:"grantedRoleName"`
}

RoleGrantedRole is a list of granted roles, giving the user access to objects in a group

type RoleRequest

type RoleRequest struct {
	Name         string          `json:"roleName,omitempty"`
	Description  string          `json:"roleDescription,omitempty"`
	GrantedRoles []GrantedRoleID `json:"grantedRoles,omitempty"`
}

RoleRequest describes request parameters of the create and update role endpoint

type RoleType

type RoleType string

RoleType is an enum of role types

var (
	// RoleTypeStandard is a standard type provided by Akamai
	RoleTypeStandard RoleType = "standard"

	// RoleTypeCustom is a custom role provided by the account
	RoleTypeCustom RoleType = "custom"
)

type RoleUser

type RoleUser struct {
	AccountID     string `json:"accountId"`
	Email         string `json:"email"`
	FirstName     string `json:"firstName"`
	LastLoginDate string `json:"lastLoginDate"`
	LastName      string `json:"lastName"`
	UIIdentityID  string `json:"uiIdentityId"`
}

RoleUser user who shares the same role

type Roles

type Roles interface {
	// CreateRole creates a custom role
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-role
	CreateRole(context.Context, CreateRoleRequest) (*Role, error)

	// GetRole gets details for a specific role
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-role
	GetRole(context.Context, GetRoleRequest) (*Role, error)

	// UpdateRole adds or removes permissions from a role and updates other parameters
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/put-role
	UpdateRole(context.Context, UpdateRoleRequest) (*Role, error)

	// DeleteRole deletes a role. This operation is only allowed if the role isn't assigned to any users.
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/delete-role
	DeleteRole(context.Context, DeleteRoleRequest) error

	// ListRoles lists roles for the current account and contract type
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-roles
	ListRoles(context.Context, ListRolesRequest) ([]Role, error)

	// ListGrantableRoles lists which grantable roles can be included in a new custom role or added to an existing custom role
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-grantable-roles
	ListGrantableRoles(context.Context) ([]RoleGrantedRole, error)
}

Roles is the IAM role API interface

type SetUserPasswordRequest

type SetUserPasswordRequest struct {
	IdentityID  string `json:"-"`
	NewPassword string `json:"newPassword"`
}

SetUserPasswordRequest contains the request parameters of the set user password endpoint

func (SetUserPasswordRequest) Validate

func (r SetUserPasswordRequest) Validate() error

Validate validates SetUserPasswordRequest

type Support

type Support interface {
	// ListProducts lists products a user can subscribe to and receive notifications for on the account
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-common-notification-products
	ListProducts(context.Context) ([]string, error)

	// ListStates lists U.S. states or Canadian provinces
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-common-states
	ListStates(context.Context, ListStatesRequest) ([]string, error)

	// ListTimeoutPolicies lists all the possible session timeout policies
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-common-timeout-policies
	ListTimeoutPolicies(context.Context) ([]TimeoutPolicy, error)

	// SupportedContactTypes lists supported contact types
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-common-contact-types
	SupportedContactTypes(context.Context) ([]string, error)

	// SupportedCountries lists supported countries
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-common-countries
	SupportedCountries(context.Context) ([]string, error)

	// SupportedLanguages lists supported languages
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-common-languages
	SupportedLanguages(context.Context) ([]string, error)

	// SupportedTimezones lists supported timezones
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-common-timezones
	SupportedTimezones(context.Context) ([]Timezone, error)
}

Support is a list of IAM supported objects API interfaces

type TFAActionType

type TFAActionType string

TFAActionType is a type for tfa action constants

const (
	// TFAActionEnable ia an action value to use to enable tfa
	TFAActionEnable TFAActionType = "enable"
	// TFAActionDisable ia an action value to use to disable tfa
	TFAActionDisable TFAActionType = "disable"
	// TFAActionReset ia an action value to use to reset tfa
	TFAActionReset TFAActionType = "reset"
)

type TimeoutPolicy

type TimeoutPolicy struct {
	Name  string `json:"name"`
	Value int64  `json:"value"`
}

TimeoutPolicy encapsulates the response of the list timeout policies endpoint

type Timezone

type Timezone struct {
	Description string `json:"description"`
	Offset      string `json:"offset"`
	Posix       string `json:"posix"`
	Timezone    string `json:"timezone"`
}

Timezone contains the response of the list supported timezones endpoint

type UnlockUserRequest

type UnlockUserRequest struct {
	IdentityID string
}

UnlockUserRequest contains the request parameters of the unlock user endpoint

func (UnlockUserRequest) Validate

func (r UnlockUserRequest) Validate() error

Validate validates UnlockUserRequest

type UpdateBlockedPropertiesRequest

type UpdateBlockedPropertiesRequest struct {
	IdentityID string
	GroupID    int64
	Properties []int64
}

UpdateBlockedPropertiesRequest contains the request parameters for the update blocked properties endpoint

func (UpdateBlockedPropertiesRequest) Validate

Validate validates UpdateBlockedPropertiesRequest

type UpdateRoleRequest

type UpdateRoleRequest struct {
	ID int64
	RoleRequest
}

UpdateRoleRequest describes the request parameters of the update role endpoint. It works as patch request. You need to provide only fields which you want to update.

func (UpdateRoleRequest) Validate

func (r UpdateRoleRequest) Validate() error

Validate validates UpdateRoleRequest

type UpdateTFARequest

type UpdateTFARequest struct {
	IdentityID string
	Action     TFAActionType
}

UpdateTFARequest contains the request parameters of the tfa user endpoint

func (UpdateTFARequest) Validate

func (r UpdateTFARequest) Validate() error

Validate validates UpdateTFARequest

type UpdateUserAuthGrantsRequest

type UpdateUserAuthGrantsRequest struct {
	IdentityID string
	AuthGrants []AuthGrantRequest
}

UpdateUserAuthGrantsRequest contains the request parameters of the update user auth grants endpoint

func (UpdateUserAuthGrantsRequest) Validate

func (r UpdateUserAuthGrantsRequest) Validate() error

Validate validates UpdateUserAuthGrantsRequest

type UpdateUserInfoRequest

type UpdateUserInfoRequest struct {
	IdentityID string
	User       UserBasicInfo
}

UpdateUserInfoRequest contains the request parameters of the update user endpoint

func (UpdateUserInfoRequest) Validate

func (r UpdateUserInfoRequest) Validate() error

Validate validates UpdateUserInfoRequest

type UpdateUserNotificationsRequest

type UpdateUserNotificationsRequest struct {
	IdentityID    string
	Notifications UserNotifications
}

UpdateUserNotificationsRequest contains the request parameters of the update user notifications endpoint

func (UpdateUserNotificationsRequest) Validate

Validate validates UpdateUserNotificationsRequest

type User

type User struct {
	UserBasicInfo
	IdentityID         string            `json:"uiIdentityId"`
	IsLocked           bool              `json:"isLocked"`
	LastLoginDate      string            `json:"lastLoginDate,omitempty"`
	PasswordExpiryDate string            `json:"passwordExpiryDate,omitempty"`
	TFAConfigured      bool              `json:"tfaConfigured"`
	EmailUpdatePending bool              `json:"emailUpdatePending"`
	AuthGrants         []AuthGrant       `json:"authGrants,omitempty"`
	Notifications      UserNotifications `json:"notifications,omitempty"`
}

User describes the response of the get and create user endpoints

type UserActions

type UserActions struct {
	APIClient        bool `json:"apiClient"`
	Delete           bool `json:"delete"`
	Edit             bool `json:"edit"`
	IsCloneable      bool `json:"isCloneable"`
	ResetPassword    bool `json:"resetPassword"`
	ThirdPartyAccess bool `json:"thirdPartyAccess"`
	CanEditTFA       bool `json:"canEditTFA"`
	EditProfile      bool `json:"editProfile"`
}

UserActions encapsulates permissions available to the user for this group

type UserBasicInfo

type UserBasicInfo struct {
	FirstName         string `json:"firstName"`
	LastName          string `json:"lastName"`
	UserName          string `json:"uiUserName,omitempty"`
	Email             string `json:"email"`
	Phone             string `json:"phone,omitempty"`
	TimeZone          string `json:"timeZone,omitempty"`
	JobTitle          string `json:"jobTitle"`
	TFAEnabled        bool   `json:"tfaEnabled"`
	SecondaryEmail    string `json:"secondaryEmail,omitempty"`
	MobilePhone       string `json:"mobilePhone,omitempty"`
	Address           string `json:"address,omitempty"`
	City              string `json:"city,omitempty"`
	State             string `json:"state,omitempty"`
	ZipCode           string `json:"zipCode,omitempty"`
	Country           string `json:"country"`
	ContactType       string `json:"contactType,omitempty"`
	PreferredLanguage string `json:"preferredLanguage,omitempty"`
	SessionTimeOut    *int   `json:"sessionTimeOut,omitempty"`
}

UserBasicInfo is the user basic info structure

type UserListItem

type UserListItem struct {
	FirstName     string       `json:"firstName"`
	LastName      string       `json:"lastName"`
	UserName      string       `json:"uiUserName,omitempty"`
	Email         string       `json:"email"`
	TFAEnabled    bool         `json:"tfaEnabled"`
	IdentityID    string       `json:"uiIdentityId"`
	IsLocked      bool         `json:"isLocked"`
	LastLoginDate string       `json:"lastLoginDate,omitempty"`
	TFAConfigured bool         `json:"tfaConfigured"`
	AccountID     string       `json:"accountId"`
	Actions       *UserActions `json:"actions,omitempty"`
	AuthGrants    []AuthGrant  `json:"authGrants,omitempty"`
}

UserListItem describes the response of the list endpoint

type UserLock

type UserLock interface {
	// LockUser lock the user
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-ui-identity-lock
	LockUser(context.Context, LockUserRequest) error

	// UnlockUser release the lock on a user's account
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-ui-identity-unlock
	UnlockUser(context.Context, UnlockUserRequest) error
}

UserLock is the IAM user lock/unlock API interface

type UserNotificationOptions

type UserNotificationOptions struct {
	NewUser        bool     `json:"newUserNotification"`
	PasswordExpiry bool     `json:"passwordExpiry"`
	Proactive      []string `json:"proactive"`
	Upgrade        []string `json:"upgrade"`
}

UserNotificationOptions types of notification emails the user receives

type UserNotifications

type UserNotifications struct {
	EnableEmail bool                    `json:"enableEmailNotifications"`
	Options     UserNotificationOptions `json:"options"`
}

UserNotifications types of notification emails the user receives

type UserPassword

type UserPassword interface {
	// ResetUserPassword optionally sends a one-time use password to the user.
	// If you send the email with the password directly to the user, the response for this operation doesn't include that password.
	// If you don't send the password to the user through email, the password is included in the response.
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-reset-password
	ResetUserPassword(context.Context, ResetUserPasswordRequest) (*ResetUserPasswordResponse, error)

	// SetUserPassword sets a specific password for a user
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-set-password
	SetUserPassword(context.Context, SetUserPasswordRequest) error
}

UserPassword is the IAM managing user's password API interface

type Users

type Users interface {
	// CreateUser creates a user in the account specified in your own API client credentials or clone an existing user's role assignments
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-ui-identity
	CreateUser(context.Context, CreateUserRequest) (*User, error)

	// GetUser gets  a specific user's profile
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-ui-identity
	GetUser(context.Context, GetUserRequest) (*User, error)

	// ListUsers returns a list of users who have access on this account
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-ui-identities
	ListUsers(context.Context, ListUsersRequest) ([]UserListItem, error)

	// RemoveUser removes a user identity
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/delete-ui-identity
	RemoveUser(context.Context, RemoveUserRequest) error

	// UpdateUserAuthGrants edits what groups a user has access to, and how the user can interact with the objects in those groups
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/put-ui-uiidentity-auth-grants
	UpdateUserAuthGrants(context.Context, UpdateUserAuthGrantsRequest) ([]AuthGrant, error)

	// UpdateUserInfo updates a user's information
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/put-ui-identity-basic-info
	UpdateUserInfo(context.Context, UpdateUserInfoRequest) (*UserBasicInfo, error)

	// UpdateUserNotifications subscribes or un-subscribe user to product notification emails
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/put-notifications
	UpdateUserNotifications(context.Context, UpdateUserNotificationsRequest) (*UserNotifications, error)

	// UpdateTFA updates a user's two-factor authentication setting and can reset tfa
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/put-ui-identity-tfa
	UpdateTFA(context.Context, UpdateTFARequest) error
}

Users is the IAM user identity API interface

Jump to

Keyboard shortcuts

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