aws

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHttpClientWithoutKeepAlive

func CreateHttpClientWithoutKeepAlive() *awsHttp.BuildableClient

func GetAccounts

func GetAccounts(client *organizations.Client, parentId string) ([]orgTypes.Account, error)

func GetAccountsWithProvisionedPermissionSet

func GetAccountsWithProvisionedPermissionSet(client *ssoadmin.Client, instanceArn string, permissionSetArn string) ([]string, error)

func GetAllAccountsFromOuRecursive added in v0.0.15

func GetAllAccountsFromOuRecursive(ctx context.Context, client *organizations.Client, parentId string) ([]orgTypes.Account, error)

func GetAllOUsFromParent added in v0.0.15

func GetAllOUsFromParent(ctx context.Context, client *organizations.Client, parentId string) ([]orgTypes.OrganizationalUnit, error)

func GetAssignedForPermissionSetInAccount

func GetAssignedForPermissionSetInAccount(client *ssoadmin.Client, ssoInstanceArn string, permissionSetArn string, accountId string) ([]types.AccountAssignment, error)

func GetGroupMemberships

func GetGroupMemberships(client *identitystore.Client, identityStoreArn string, groupId *string) ([]identityTypes.GroupMembership, error)

func GetGroups

func GetGroups(client *identitystore.Client, identityStoreArn string) ([]identityTypes.Group, error)

func GetPermissionSets

func GetPermissionSets(client *ssoadmin.Client, instanceArn string) ([]string, error)

func GetSsoRoles

func GetSsoRoles(accounts []SsoRoleMapping, roleName string) (map[string]SsoRoleMapping, error)

func RemoveAccountPrefix

func RemoveAccountPrefix(prefix string, val string) string

Types

type CapabilitySso

type CapabilitySso struct {
	RootId         string
	AwsAccountId   string
	AwsAccountName string
}

type GetAccountsMissingCapabilityPermissionSetResponse

type GetAccountsMissingCapabilityPermissionSetResponse struct {
	Account *orgTypes.Account
	Group   *identityStoreTypes.Group
}

type GetGroupsNotAssignedToAccountWithPermissionSetResponse

type GetGroupsNotAssignedToAccountWithPermissionSetResponse struct {
	GroupsNotAssigned []*identityStoreTypes.Group
	GroupsAssigned    []*identityStoreTypes.Group
}

type ManageSso

type ManageSso struct {
	AwsAccounts  []*orgTypes.Account
	AwsSsoGroups []*identityStoreTypes.Group
	// contains filtered or unexported fields
}

func InitManageSso

func InitManageSso(cfg aws.Config, identityStoreArn string) (*ManageSso, error)

func (*ManageSso) GetAccountById

func (m *ManageSso) GetAccountById(val string) *orgTypes.Account

func (*ManageSso) GetAccountByName

func (m *ManageSso) GetAccountByName(val string) *orgTypes.Account

func (*ManageSso) GetAccountsMissingCapabilityPermissionSet

func (m *ManageSso) GetAccountsMissingCapabilityPermissionSet(client *ssoadmin.Client, ssoInstanceArn string, capabilityPermissionSetArn string, ssoGroupPrefix string, awsAccountPrefix string) ([]*GetAccountsMissingCapabilityPermissionSetResponse, error)

GetAccountsMissingCapabilityPermissionSet

func (*ManageSso) GetGroupById

func (m *ManageSso) GetGroupById(val string) *identityStoreTypes.Group

func (*ManageSso) GetGroupByName

func (m *ManageSso) GetGroupByName(val string) *identityStoreTypes.Group

func (*ManageSso) GetGroupsNotAssignedToAccountWithPermissionSet

func (m *ManageSso) GetGroupsNotAssignedToAccountWithPermissionSet(client *ssoadmin.Client, ssoInstanceArn string, permissionSetArn string, accountId string, groupPrefix string) (*GetGroupsNotAssignedToAccountWithPermissionSetResponse, error)

type ScimClient added in v0.0.11

type ScimClient struct {
	// contains filtered or unexported fields
}

func CreateScimClient added in v0.0.11

func CreateScimClient(endpoint string, token string) *ScimClient

func (*ScimClient) CreateGroup added in v0.0.11

func (c *ScimClient) CreateGroup(data ScimCreateGroupRequest) error

func (*ScimClient) CreateUser added in v0.0.11

func (c *ScimClient) CreateUser(data ScimCreateUserRequest) error

func (*ScimClient) GetGroupViaDisplayName added in v0.0.11

func (c *ScimClient) GetGroupViaDisplayName(name string) (*ScimGetGroupResponse, error)

func (*ScimClient) GetUserViaExternalId added in v0.0.11

func (c *ScimClient) GetUserViaExternalId(id string) (*ScimGetUserResponse, error)

func (*ScimClient) PatchAddMembersToGroup added in v0.0.11

func (c *ScimClient) PatchAddMembersToGroup(groupId string, members ...string) error

func (*ScimClient) PatchRemoveMembersFromGroup added in v0.0.11

func (c *ScimClient) PatchRemoveMembersFromGroup(groupId string, members ...string) error

func (*ScimClient) RemoveGroup added in v0.0.11

func (c *ScimClient) RemoveGroup(id string) error

func (*ScimClient) RemoveUser added in v0.0.11

func (c *ScimClient) RemoveUser(id string) error

type ScimCreateGroupRequest added in v0.0.11

type ScimCreateGroupRequest struct {
	DisplayName string `json:"displayName"`
	Externalid  string `json:"externalid"`
}

type ScimCreateUserRequest added in v0.0.11

type ScimCreateUserRequest struct {
	UserName    string `json:"userName"`
	ExternalID  string `json:"externalId"`
	DisplayName string `json:"displayName"`
	Active      bool   `json:"active"`
	Name        struct {
		GivenName  string `json:"givenName"`
		FamilyName string `json:"familyName"`
	} `json:"name"`
}

type ScimGetGroupResponse added in v0.0.11

type ScimGetGroupResponse struct {
	ID         string `json:"id"`
	ExternalID string `json:"externalId"`
	Meta       struct {
		ResourceType string    `json:"resourceType"`
		Created      time.Time `json:"created"`
		LastModified time.Time `json:"lastModified"`
	} `json:"meta"`
	Schemas     []string      `json:"schemas"`
	DisplayName string        `json:"displayName"`
	Members     []interface{} `json:"members"`
}

type ScimGetGroupsResponse added in v0.0.11

type ScimGetGroupsResponse struct {
	TotalResults int                     `json:"totalResults"`
	ItemsPerPage int                     `json:"itemsPerPage"`
	StartIndex   int                     `json:"startIndex"`
	Schemas      []string                `json:"schemas"`
	Resources    []*ScimGetGroupResponse `json:"Resources"`
}

type ScimGetUserResponse added in v0.0.11

type ScimGetUserResponse struct {
	ID         string `json:"id"`
	ExternalID string `json:"externalId"`
	Meta       struct {
		ResourceType string    `json:"resourceType"`
		Created      time.Time `json:"created"`
		LastModified time.Time `json:"lastModified"`
	} `json:"meta"`
	Schemas  []string `json:"schemas"`
	UserName string   `json:"userName"`
	Name     struct {
		Formatted  string `json:"formatted"`
		FamilyName string `json:"familyName"`
		GivenName  string `json:"givenName"`
	} `json:"name"`
	DisplayName string `json:"displayName"`
	Title       string `json:"title"`
	Active      bool   `json:"active"`
	Emails      []struct {
		Value   string `json:"value"`
		Type    string `json:"type"`
		Primary bool   `json:"primary"`
	} `json:"emails"`
	Addresses []struct {
		StreetAddress string `json:"streetAddress"`
		Locality      string `json:"locality"`
		PostalCode    string `json:"postalCode"`
		Country       string `json:"country"`
		Type          string `json:"type"`
		Primary       bool   `json:"primary"`
	} `json:"addresses"`
	UrnIetfParamsScimSchemasExtensionEnterprise21User struct {
		EmployeeNumber string `json:"employeeNumber"`
		Department     string `json:"department"`
		Manager        struct {
			Value string `json:"value"`
		} `json:"manager"`
	} `json:"urn:ietf:params:scim:schemas:extension:enterprise:2.1:User"`
}

type ScimGetUsersResponse added in v0.0.11

type ScimGetUsersResponse struct {
	TotalResults int                    `json:"totalResults"`
	ItemsPerPage int                    `json:"itemsPerPage"`
	StartIndex   int                    `json:"startIndex"`
	Schemas      []string               `json:"schemas"`
	Resources    []*ScimGetUserResponse `json:"Resources"`
}

type ScimPatchMembersToGroupOperationRequest added in v0.0.11

type ScimPatchMembersToGroupOperationRequest struct {
	Op    string                                         `json:"op"`
	Path  string                                         `json:"path"`
	Value []ScimPatchMembersToGroupOperationValueRequest `json:"value"`
}

type ScimPatchMembersToGroupOperationValueRequest added in v0.0.11

type ScimPatchMembersToGroupOperationValueRequest struct {
	Value string `json:"value"`
}

type ScimPatchMembersToGroupRequest added in v0.0.11

type ScimPatchMembersToGroupRequest struct {
	Schemas    []string                                  `json:"schemas"`
	Operations []ScimPatchMembersToGroupOperationRequest `json:"Operations"`
}

func NewScimPatchAddMembersToGroupRequest added in v0.0.11

func NewScimPatchAddMembersToGroupRequest(members ...string) ScimPatchMembersToGroupRequest

func NewScimPatchRemoveMembersToGroupRequest added in v0.0.11

func NewScimPatchRemoveMembersToGroupRequest(members ...string) ScimPatchMembersToGroupRequest

type SsoRoleMapping

type SsoRoleMapping struct {
	AccountAlias string
	AccountId    string
	RoleName     string
	RoleArn      string
	RootId       string
}

Jump to

Keyboard shortcuts

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