Documentation ¶
Index ¶
- type Request
- func (r *Request) AddGroupToUser(c *sa.Client, groupID string, userID string) (*Response, error)
- func (r *Request) AddGroupToUsers(c *sa.Client, groupID string, users []string) (*Response, error)
- func (r *Request) AddUserToGroup(c *sa.Client, userID string, groupID string) (*Response, error)
- func (r *Request) AddUserToGroups(c *sa.Client, userID string, groups []string) (*Response, error)
- func (r *Request) Post(c *sa.Client, endpoint string) (*Response, error)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { UserIds []string `json:"userIds,omitempty"` GroupNames []string `json:"groupNames,omitempty"` }
Request :
Request struct to build the required post parameters.
Fields:
UserIds: usernames of the users you want to add to a single group. GroupNames: names of the groups you want to add a single user to.
func (*Request) AddGroupToUser ¶
AddGroupToUser :
Helper function for making user posts to add a single group to a single single.
Parameters:
[Required] r: should be empty for this call. [Required] c: passing in the client containing authorization and host information. [Required] groupid: the name of the group to add a user to. [Required] userID: the username of the user to add to a group.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) AddGroupToUsers ¶
AddGroupToUsers :
Helper function for making user posts to add a single group to multiple users.
Parameters:
[Required] r: should be empty for this call. [Required] c: passing in the client containing authorization and host information. [Required] groupID: the name of the group to add to each user. [Required] users: a string slice of usernames to add to the group.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) AddUserToGroup ¶
AddUserToGroup :
Helper function for making user posts to add a single user to a single group.
Parameters:
[Required] r: should be empty for this call. [Required] c: passing in the client containing authorization and host information. [Required] userID: the username of the user to add to a group. [Required] groupid: the name of the group to add a user to.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.\
func (*Request) AddUserToGroups ¶
AddUserToGroups :
Helper function for making user posts to add a single user to multiple groups.
Parameters:
[Required] r: should be empty for this call. [Required] c: passing in the client containing authorization and host information. [Required] userID: the username of the user to add to multiple groups. [Required] groups: a string slice of group names to add the user to.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) Post ¶
Post :
Executes a post to the users or groups endpoint.
Parameters:
[Required] r: should have all required fields of the struct populated before using. [Required] c: passing in the client containing authorization and host information. [Required] endpoint: the endpoint perform the post to.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
type Response ¶
type Response struct { Status string `json:"status"` Message string `json:"message"` Failures map[string][]string `json:"failures,omitempty"` RawJSON string `json:"-"` HTTPResponse *http.Response `json:"-"` }
Response :
Response struct that will be populated after the post request.
func (*Response) IsSignatureValid ¶ added in v1.1.0
IsSignatureValid :
Helper function to validate the SecureAuth Response signature in X-SA-SIGNATURE
Parameters:
[Required] r: response struct with HTTPResponse [Required] c: passing in the client with application id and key
Returns:
bool: if true, computed signature matches X-SA-SIGNATURE. if false, computed signature does not match. error: If an error is encountered, bool will be false and the error must be handled.
Click to show internal directories.
Click to hide internal directories.