Documentation
¶
Overview ¶
Access Management within StackGuardian allows administrators to control user access levels within the organization.
Access Management provides options to assign roles to users or groups, define custom roles, and manage login methods.
For more details, visit our [Documentation](https://docs.stackguardian.io/docs/organisation_settings/access_management).
Index ¶
- type Client
- func (c *Client) CreateApiAccess(ctx context.Context, org string, request *sgsdkgo.ApiAccess, ...) (*sgsdkgo.ApiAccessCreateResponse, error)
- func (c *Client) CreateRole(ctx context.Context, org string, request *sgsdkgo.Role, ...) (*sgsdkgo.RoleCreateUpdateResponse, error)
- func (c *Client) CreateUser(ctx context.Context, org string, request *sgsdkgo.AddUserToOrganization, ...) (*sgsdkgo.AddUserToOrganizationResponse, error)
- func (c *Client) DeleteApiAccess(ctx context.Context, accessId string, org string, opts ...option.RequestOption) (*sgsdkgo.ApiAccessDeleteResponse, error)
- func (c *Client) DeleteRole(ctx context.Context, org string, role string, opts ...option.RequestOption) error
- func (c *Client) DeleteUser(ctx context.Context, org string, ...) (*sgsdkgo.RemoveUserFromOrganizationResponse, error)
- func (c *Client) ListAllApiAccesses(ctx context.Context, org string, request *sgsdkgo.ListAllApiAccessesRequest, ...) (*sgsdkgo.ApiAccessListResponse, error)
- func (c *Client) ListAllRoles(ctx context.Context, org string, request *sgsdkgo.ListAllRolesRequest, ...) error
- func (c *Client) ListAllUsers(ctx context.Context, org string, request *sgsdkgo.ListAllUsersRequest, ...) (*sgsdkgo.ListAllUsersInOrganizationResponse, error)
- func (c *Client) ReadApiAccess(ctx context.Context, accessId string, org string, opts ...option.RequestOption) (*sgsdkgo.ApiAccessGetResponse, error)
- func (c *Client) ReadAuditLogs(ctx context.Context, org string, request *sgsdkgo.ReadAuditLogsRequest, ...) (*sgsdkgo.ReadAuditLogResponse, error)
- func (c *Client) ReadRole(ctx context.Context, org string, role string, opts ...option.RequestOption) (*sgsdkgo.RoleGetResponse, error)
- func (c *Client) ReadUser(ctx context.Context, org string, ...) (*sgsdkgo.RemoveUserFromOrganizationResponse, error)
- func (c *Client) RegenerateApiKey(ctx context.Context, accessId string, org string, ...) (*sgsdkgo.ApiAccessRegenerateResponse, error)
- func (c *Client) UpdateApiAccess(ctx context.Context, accessId string, org string, ...) (*sgsdkgo.ApiAccessUpdateResponse, error)
- func (c *Client) UpdateRole(ctx context.Context, org string, role string, request *sgsdkgo.PatchedRole, ...) (*sgsdkgo.RoleCreateUpdateResponse, error)
- func (c *Client) UpdateUser(ctx context.Context, org string, request *sgsdkgo.AddUserToOrganization, ...) (*sgsdkgo.AddUserToOrganizationResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...option.RequestOption) *Client
func (*Client) CreateApiAccess ¶ added in v1.2.0
func (c *Client) CreateApiAccess( ctx context.Context, org string, request *sgsdkgo.ApiAccess, opts ...option.RequestOption, ) (*sgsdkgo.ApiAccessCreateResponse, error)
Create a new API access (API Key or OIDC) inside an Organization.
func (*Client) CreateRole ¶
func (c *Client) CreateRole( ctx context.Context, org string, request *sgsdkgo.Role, opts ...option.RequestOption, ) (*sgsdkgo.RoleCreateUpdateResponse, error)
Create a new Role inside an Organization.
**Role Format Versions:**
Roles support two format versions with different path interpretation behaviors:
**V4 (Recommended - One-to-One Mapping):** - Performs direct one-to-one mapping of path elements - Requires all path arrays to have the same number of elements - Example: `<wfGrp>: ["wfgrp1", "wfgrp2"]` and `<wf>: ["wf1", "wf2"]` - Results in 2 mappings: wfgrp1/wf1, wfgrp2/wf2
**V3.BETA (Deprecated - Cartesian Product):** - Creates all possible combinations of the provided paths - Example: If paths contain `<wfGrp>: ["wfgrp1", "wfgrp2"]` and `<wf>: ["wf1", "wf2"]` - Results in 4 combinations: wfgrp1/wf1, wfgrp1/wf2, wfgrp2/wf1, wfgrp2/wf2 - Allows different number of elements in path arrays
**Migration from V3.BETA to V4:** To achieve V3.BETA behavior in V4 format, combine values using regex alternation: - Instead of: `["wfgrp1", "wfgrp2"]` and `["wf1", "wf2"]` - Use: `["wfgrp1|wfgrp2"]` and `["wf1|wf2"]`
func (*Client) CreateUser ¶
func (c *Client) CreateUser( ctx context.Context, org string, request *sgsdkgo.AddUserToOrganization, opts ...option.RequestOption, ) (*sgsdkgo.AddUserToOrganizationResponse, error)
Invite users or SSO groups to an Organization.
func (*Client) DeleteApiAccess ¶ added in v1.2.0
func (c *Client) DeleteApiAccess( ctx context.Context, accessId string, org string, opts ...option.RequestOption, ) (*sgsdkgo.ApiAccessDeleteResponse, error)
Delete the specified API access from the Organization.
func (*Client) DeleteRole ¶
func (c *Client) DeleteRole( ctx context.Context, org string, role string, opts ...option.RequestOption, ) error
Delete the specified Role from the Organization.
func (*Client) DeleteUser ¶
func (c *Client) DeleteUser( ctx context.Context, org string, request *sgsdkgo.GetorRemoveUserFromOrganization, opts ...option.RequestOption, ) (*sgsdkgo.RemoveUserFromOrganizationResponse, error)
Delete an existing user or SSO group from an Organization.
func (*Client) ListAllApiAccesses ¶ added in v1.2.0
func (c *Client) ListAllApiAccesses( ctx context.Context, org string, request *sgsdkgo.ListAllApiAccessesRequest, opts ...option.RequestOption, ) (*sgsdkgo.ApiAccessListResponse, error)
List all the API accesses inside an Organization. Supports pagination and filtering.
func (*Client) ListAllRoles ¶
func (c *Client) ListAllRoles( ctx context.Context, org string, request *sgsdkgo.ListAllRolesRequest, opts ...option.RequestOption, ) error
List all the Roles inside an Organization. This List All endpoint does not support pagination at the moment.
func (*Client) ListAllUsers ¶ added in v1.2.0
func (c *Client) ListAllUsers( ctx context.Context, org string, request *sgsdkgo.ListAllUsersRequest, opts ...option.RequestOption, ) (*sgsdkgo.ListAllUsersInOrganizationResponse, error)
List all users within an Organization.
func (*Client) ReadApiAccess ¶ added in v1.2.0
func (c *Client) ReadApiAccess( ctx context.Context, accessId string, org string, opts ...option.RequestOption, ) (*sgsdkgo.ApiAccessGetResponse, error)
Retrieve the details of an existing API access.
func (*Client) ReadAuditLogs ¶ added in v1.2.0
func (c *Client) ReadAuditLogs( ctx context.Context, org string, request *sgsdkgo.ReadAuditLogsRequest, opts ...option.RequestOption, ) (*sgsdkgo.ReadAuditLogResponse, error)
Retrieve the audit logs of an Organization. To filter logs via query parameters, start and end time must be provided in Unix timestamp format (milliseconds).
func (*Client) ReadRole ¶
func (c *Client) ReadRole( ctx context.Context, org string, role string, opts ...option.RequestOption, ) (*sgsdkgo.RoleGetResponse, error)
Retrieve the details of an existing Role.
func (*Client) ReadUser ¶
func (c *Client) ReadUser( ctx context.Context, org string, request *sgsdkgo.GetorRemoveUserFromOrganization, opts ...option.RequestOption, ) (*sgsdkgo.RemoveUserFromOrganizationResponse, error)
Retrieve the details of an user or SSO group within an Organization.
func (*Client) RegenerateApiKey ¶ added in v1.2.0
func (c *Client) RegenerateApiKey( ctx context.Context, accessId string, org string, request *sgsdkgo.ApiAccessRegenerate, opts ...option.RequestOption, ) (*sgsdkgo.ApiAccessRegenerateResponse, error)
Regenerate the API key for an existing API access. Only works for APIKEY access type. A new expiration date must be provided.
func (*Client) UpdateApiAccess ¶ added in v1.2.0
func (c *Client) UpdateApiAccess( ctx context.Context, accessId string, org string, request *sgsdkgo.PatchedApiAccessPatch, opts ...option.RequestOption, ) (*sgsdkgo.ApiAccessUpdateResponse, error)
Update an existing API access. Note: ResourceName and AccessType cannot be changed.
func (*Client) UpdateRole ¶
func (c *Client) UpdateRole( ctx context.Context, org string, role string, request *sgsdkgo.PatchedRole, opts ...option.RequestOption, ) (*sgsdkgo.RoleCreateUpdateResponse, error)
Update an existing Role.
**Role Format Versions:**
Roles support two format versions with different path interpretation behaviors:
**V4 (Recommended - One-to-One Mapping):** - Performs direct one-to-one mapping of path elements - Requires all path arrays to have the same number of elements - Example: `<wfGrp>: ["wfgrp1", "wfgrp2"]` and `<wf>: ["wf1", "wf2"]` - Results in 2 mappings: wfgrp1/wf1, wfgrp2/wf2
**V3.BETA (Deprecated - Cartesian Product):** - Creates all possible combinations of the provided paths - Example: If paths contain `<wfGrp>: ["wfgrp1", "wfgrp2"]` and `<wf>: ["wf1", "wf2"]` - Results in 4 combinations: wfgrp1/wf1, wfgrp1/wf2, wfgrp2/wf1, wfgrp2/wf2 - Allows different number of elements in path arrays
**Migration from V3.BETA to V4:** To achieve V3.BETA behavior in V4 format, combine values using regex alternation: - Instead of: `["wfgrp1", "wfgrp2"]` and `["wf1", "wf2"]` - Use: `["wfgrp1|wfgrp2"]` and `["wf1|wf2"]`
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser( ctx context.Context, org string, request *sgsdkgo.AddUserToOrganization, opts ...option.RequestOption, ) (*sgsdkgo.AddUserToOrganizationResponse, error)
Update an existing user or SSO group within an Organization.