iam

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package iam provides access to the Akamai Property APIs

Index

Constants

This section is empty.

Variables

View Source
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")
)
View Source
var (
	// BaseEndPoint is the IAM basepath
	BaseEndPoint = "/identity-management/v2"

	// UserAdminEP is the IAM user-admin endpoint
	UserAdminEP = path.Join(BaseEndPoint, "user-admin")
)
View Source
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.

func (AuthGrant) Validate

func (r AuthGrant) Validate() error

Validate performs validation on AuthGrant

type ClientFunc

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

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

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

Is handles error comparisons

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

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

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 IAM

type IAM interface {
	Groups
	Roles
	Support
	Users
}

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 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 Option

type Option func(*iam)

Option defines a IAM option

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

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 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 {
	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

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

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

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

Users is the IAM user identity management interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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