Documentation
¶
Overview ¶
Package iam provides access to the Akamai Property APIs
Index ¶
- Variables
- type AuthGrant
- type ClientFunc
- type CreateUserRequest
- type Error
- type GetUserRequest
- type Group
- type GroupActions
- type Groups
- type IAM
- type ListGroupsRequest
- type ListRolesRequest
- type ListStatesRequest
- type Option
- type RemoveUserRequest
- type Response
- type Role
- type RoleAction
- type RoleGrantedRole
- type RoleType
- type RoleUser
- type Roles
- type Support
- type TimeoutPolicy
- type Timezone
- type UpdateUserAuthGrantsRequest
- type UpdateUserInfoRequest
- type UpdateUserNotificationsRequest
- type User
- type UserActions
- type UserBasicInfo
- type UserNotificationOptions
- type UserNotifications
- type Users
Constants ¶
This section is empty.
Variables ¶
var ( // ErrStructValidation is returned returned when given struct validation failed ErrStructValidation = errors.New("struct validation") // ErrNotFound is returned when requested resource was not found ErrNotFound = errors.New("resource not found") )
var ( // BaseEndPoint is the IAM basepath BaseEndPoint = "/identity-management/v2" // UserAdminEP is the IAM user-admin endpoint UserAdminEP = path.Join(BaseEndPoint, "user-admin") )
var ( // ErrInputValidation is returned when the input parameters failed validation ErrInputValidation = errors.New("input validation error") )
Functions ¶
This section is empty.
Types ¶
type AuthGrant ¶
type AuthGrant struct { GroupID int `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.
type ClientFunc ¶
ClientFunc is a iam client new method, this can used for mocking
type CreateUserRequest ¶
type CreateUserRequest struct { User UserBasicInfo `json:"user"` Notifications UserNotifications `json:"notifications"` AuthGrants []AuthGrant `json:"authGrants"` SendEmail bool `json:"sendEmail"` }
CreateUserRequest is the input to CreateUser
func (CreateUserRequest) Validate ¶
func (r CreateUserRequest) Validate() error
Validate performs the input validation for CreateUserRequest
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"` }
Error is a iam error interface
type GetUserRequest ¶
type GetUserRequest struct { IdentityID string `json:"uiIdentityId"` Actions bool `json:"actions"` AuthGrants bool `json:"authGrants"` Notifications bool `json:"notificiations"` }
GetUserRequest is the input for GetUser
func (GetUserRequest) Validate ¶
func (r GetUserRequest) Validate() error
Validate performs the input validation for GetUserRequest
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 encapsulates information about a group.
type GroupActions ¶
GroupActions encapsulates permissions available to the user for this group.
type Groups ¶
type Groups interface {
ListGroups(context.Context, ListGroupsRequest) ([]Group, error)
}
Groups is the IAM group management interface
type ListGroupsRequest ¶
type ListGroupsRequest struct {
Actions bool `json:"actions"`
}
ListGroupsRequest is the request for listing groups
type ListRolesRequest ¶
type ListRolesRequest struct { GroupID *int64 `json:"groupId,omitempty"` Actions bool `json:"actions"` IgnoreContext bool `json:"ignoreContext"` Users bool `json:"users"` }
ListRolesRequest is option query parameters for the list roles endpoint
type ListStatesRequest ¶
type ListStatesRequest struct {
Country string `json:"country"`
}
ListStatesRequest specifies the country for the requested states
type RemoveUserRequest ¶
type RemoveUserRequest struct {
IdentityID string `json:"uiIdentityId"`
}
RemoveUserRequest is the input for RemoveUser
func (RemoveUserRequest) Validate ¶
func (r RemoveUserRequest) Validate() error
Validate performs the input validation for RemoveUserRequest
type Response ¶
type Response struct { AccountID string `json:"accountId,omitempty"` ContractID string `json:"contractId,omitempty"` GroupID string `json:"groupId,omitempty"` Etag string `json:"etag,omitempty"` Errors []*Error `json:"errors,omitempty"` Warnings []*Error `json:"warnings,omitempty"` }
Response is a base IAM Response type
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 is a role that includes granted roles.
type RoleAction ¶
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 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 {
ListRoles(context.Context, ListRolesRequest) ([]Role, error)
}
Roles is the iam role management interface
type Support ¶
type Support interface { SupportedCountries(context.Context) ([]string, error) SupportedContactTypes(context.Context) ([]string, error) SupportedLanguages(context.Context) ([]string, error) SupportedTimezones(context.Context) ([]Timezone, error) ListProducts(context.Context) ([]string, error) ListTimeoutPolicies(context.Context) ([]TimeoutPolicy, error) ListStates(context.Context, ListStatesRequest) ([]string, error) }
Support is a list of iam supported object methods
type TimeoutPolicy ¶
TimeoutPolicy specifies session timeout policy options that can be assigned to each user
type Timezone ¶
type Timezone struct { Description string `json:"description"` Offset string `json:"offset"` Posix string `json:"posix"` Timezone string `json:"timezone"` }
Timezone is the object retured by the SupportedTimezones method
type UpdateUserAuthGrantsRequest ¶
type UpdateUserAuthGrantsRequest struct { IdentityID string `json:"uiIdentityId"` AuthGrants []AuthGrant `json:"authGrants,omitempty"` }
UpdateUserAuthGrantsRequest is the input to update user auth grants
func (UpdateUserAuthGrantsRequest) Validate ¶
func (r UpdateUserAuthGrantsRequest) Validate() error
Validate performs the input validation for UpdateUserAuthGrantsRequest
type UpdateUserInfoRequest ¶
type UpdateUserInfoRequest struct { IdentityID string `json:"uiIdentityId"` User UserBasicInfo `json:"user"` }
UpdateUserInfoRequest is the input to UpdateUserInfo
func (UpdateUserInfoRequest) Validate ¶
func (r UpdateUserInfoRequest) Validate() error
Validate performs the input validation for UpdateUserRequest
type UpdateUserNotificationsRequest ¶
type UpdateUserNotificationsRequest struct { IdentityID string `json:"uiIdentityId"` Notifications UserNotifications `json:"notifications,omitempty"` }
UpdateUserNotificationsRequest is the input to update user notifications
func (UpdateUserNotificationsRequest) Validate ¶
func (r UpdateUserNotificationsRequest) Validate() error
Validate performs the input validation for 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 encapsulates information about each user.
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"` }
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 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 Users ¶
type Users interface { CreateUser(context.Context, CreateUserRequest) (*User, error) GetUser(context.Context, GetUserRequest) (*User, error) UpdateUserInfo(context.Context, UpdateUserInfoRequest) (*UserBasicInfo, error) UpdateUserNotifications(context.Context, UpdateUserNotificationsRequest) (*UserNotifications, error) UpdateUserAuthGrants(context.Context, UpdateUserAuthGrantsRequest) ([]AuthGrant, error) RemoveUser(context.Context, RemoveUserRequest) error }
Users is the IAM user identity management interface