Documentation ¶
Index ¶
- Variables
- func OauthCredClient(clientID, clientSecret, clientAppID, clientURL string) (*oauth2.Token, error)
- func OauthResourceOwner(clientID, clientSecret, clientAppID, clientURL, resourceUsername, ... string) (*oauth2.Token, error)
- type Client
- func (c *Client) Delete(ctx context.Context, path string, v interface{}) error
- func (c *Client) Get(ctx context.Context, path string, v interface{}) error
- func (c *Client) Patch(ctx context.Context, path string, payload interface{}, v interface{}) error
- func (c *Client) Post(ctx context.Context, path string, payload interface{}, v interface{}) error
- func (c *Client) Put(ctx context.Context, path string, payload interface{}, v interface{}) error
- type HTTPClient
- type Options
- type Service
- func (s *Service) AddGroup(ctx context.Context, group types.Group) (*types.Group, error)
- func (s *Service) AddPrivilegedData(ctx context.Context, privilegedData types.PrivilegedData) (*types.PrivilegedData, error)
- func (s *Service) AddSafe(ctx context.Context, safe types.Container) (*types.Container, error)
- func (s *Service) AddSafePermissions(ctx context.Context, safePermission types.ContainerPermission) (*types.ContainerPermission, error)
- func (s *Service) AddUser(ctx context.Context, user types.User) (*types.User, error)
- func (s *Service) DeleteGroup(ctx context.Context, id string) error
- func (s *Service) DeletePrivilegedData(ctx context.Context, id string) error
- func (s *Service) DeleteSafe(ctx context.Context, name string) error
- func (s *Service) DeleteSafePermission(ctx context.Context, safeName string, userOrGroupName string) error
- func (s *Service) DeleteUser(ctx context.Context, id string) error
- func (s *Service) GetGroupByFilter(ctx context.Context, filterType string, filterQuery string) (*types.Group, error)
- func (s *Service) GetGroupById(ctx context.Context, id string) (*types.Group, error)
- func (s *Service) GetGroups(ctx context.Context) (*types.Groups, error)
- func (s *Service) GetGroupsIndex(ctx context.Context, startIndex int, count int) (*types.Groups, error)
- func (s *Service) GetGroupsSort(ctx context.Context, sortBy string, sortOrder string) (*types.Groups, error)
- func (s *Service) GetPrivilegedData(ctx context.Context) (*types.PrivilegedDatas, error)
- func (s *Service) GetPrivilegedDataByFilter(ctx context.Context, filterType string, filterQuery string) (*types.PrivilegedDatas, error)
- func (s *Service) GetPrivilegedDataById(ctx context.Context, id string) (*types.PrivilegedData, error)
- func (s *Service) GetPrivilegedDataIndex(ctx context.Context, startIndex int, count int) (*types.PrivilegedDatas, error)
- func (s *Service) GetPrivilegedDataSort(ctx context.Context, sortBy string, sortOrder string) (*types.PrivilegedDatas, error)
- func (s *Service) GetSafeByFilter(ctx context.Context, filterType string, filterQuery string) (*types.Container, error)
- func (s *Service) GetSafeByName(ctx context.Context, safeName string) (*types.Container, error)
- func (s *Service) GetSafePermissionByFilter(ctx context.Context, filterType string, filterQuery string) (*types.ContainerPermissions, error)
- func (s *Service) GetSafePermissions(ctx context.Context) (*types.ContainerPermissions, error)
- func (s *Service) GetSafePermissionsByName(ctx context.Context, safeName string, userOrGroupName string) (*types.ContainerPermission, error)
- func (s *Service) GetSafePermissionsIndex(ctx context.Context, startIndex int, count int) (*types.ContainerPermissions, error)
- func (s *Service) GetSafePermissionsSort(ctx context.Context, sortBy string, sortOrder string) (*types.ContainerPermissions, error)
- func (s *Service) GetSafes(ctx context.Context) (*types.Containers, error)
- func (s *Service) GetSafesIndex(ctx context.Context, startIndex int, count int) (*types.Containers, error)
- func (s *Service) GetSafesSort(ctx context.Context, sortBy string, sortOrder string) (*types.Containers, error)
- func (s *Service) GetUserByFilter(ctx context.Context, filterType string, filterQuery string) (*types.User, error)
- func (s *Service) GetUserById(ctx context.Context, id string) (*types.User, error)
- func (s *Service) GetUsers(ctx context.Context) (*types.Users, error)
- func (s *Service) GetUsersIndex(ctx context.Context, startIndex int, count int) (*types.Users, error)
- func (s *Service) GetUsersSort(ctx context.Context, sortBy string, sortOrder string) (*types.Users, error)
- func (s *Service) ModifyPrivilegedData(ctx context.Context, privilegedData types.PrivilegedData) (*types.PrivilegedData, error)
- func (s *Service) UpdateGroup(ctx context.Context, group types.Group) (*types.Group, error)
- func (s *Service) UpdatePrivilegedData(ctx context.Context, privilegedData types.PrivilegedData) (*types.PrivilegedData, error)
- func (s *Service) UpdateSafe(ctx context.Context, safe types.Container) (*types.Container, error)
- func (s *Service) UpdateSafePermissions(ctx context.Context, safePermission types.ContainerPermission) (*types.Container, error)
- func (s *Service) UpdateUser(ctx context.Context, user types.User) (*types.User, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrUserAccessDenied = errors.New("you do not have access to the requested resource") ErrNotFound = errors.New("the requested resource not found") ErrTooManyRequests = errors.New("you have exceeded throttle") )
var ( ContainerPermissions types.ContainerPermissions ContainerPermission types.ContainerPermission )
var ( Containers types.Containers Container types.Container )
var ( Groups types.Groups Group types.Group )
var ( PrivilegedDatas types.PrivilegedDatas PrivilegedData types.PrivilegedData )
var ( Users types.Users User types.User )
var FullVersionName = fmt.Sprintf("%s-%s", Version, Tag)
FullVersionName is the user-visible aggregation of version and tag of this codebase
var Tag = "beta"
Tag field denotes the specific build type for the broker. It may be replaced by compile-time variables if needed to provide the git commit information in the final binary.
var Version = "0.0.3"
Version field is a SemVer that should indicate the baked-in version of conceal
Functions ¶
func OauthCredClient ¶
OauthCredClient returns a validated Oauth2 Authentication Token based on the following provided information:
clientID - Username for the SCIM Application (e.g. "identity-privilege-integration-user$@example.com") clientSecret - Password for the SCIM Application clientAppID - ID for the SCIM Application clientURL - URL for the SCIM Application (e.g. "example.my.idaptive.app")
func OauthResourceOwner ¶
func OauthResourceOwner(clientID, clientSecret, clientAppID, clientURL, resourceUsername, resourcePassword string) (*oauth2.Token, error)
OauthResourceOwner returns a validated Oauth2 Authentication Token with Refresh Token based on the following provided information:
clientID - Username for the SCIM Application (e.g. "identity-privilege-integration-user$@example.com") clientSecret - Password for the SCIM Application clientAppID - ID for the SCIM Application clientURL - URL for the SCIM Application (e.g. "example.my.idaptive.app") resourceUsername - Username for the Resource Owner resourcePassword - Password for the Resource Owner
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type HTTPClient ¶
type HTTPClient interface { Get(ctx context.Context, path string, v interface{}) error Post(ctx context.Context, path string, payload interface{}, v interface{}) error Put(ctx context.Context, path string, payload interface{}, v interface{}) error Patch(ctx context.Context, path string, payload interface{}, v interface{}) error Delete(ctx context.Context, path string, v interface{}) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddGroup ¶
AddGroup attempts add a single Group and requires a passed object in the form of types.Group. The response from the SCIM API is returned as the types.Group struct. At a minimum the struct must contain the following:
DisplayName Schemas
Example Usage:
Group := types.Group { DisplayName: "ExampleGroup", Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:Group"}, } addGroup, err := s.AddGroup(context.Background, Group)
func (*Service) AddPrivilegedData ¶
func (s *Service) AddPrivilegedData(ctx context.Context, privilegedData types.PrivilegedData) (*types.PrivilegedData, error)
AddPrivilegedData attempts a "POST" operation to add Privileged Data to the Vault and requires a types.PrivilegedData struct with the desired data. The response from the SCIM API is returned as the types.PrivilegedData struct.
Example Usage:
PrivilegedData := types.PrivilegedData { Name: "NewAccount", Type: "password", Schemas: []string{"urn:ietf:params:scim:schemas:pam:1.0:PrivilegedData", "urn:ietf:params:scim:schemas:cyberark:1.0:PrivilegedData"} UrnIetfParamsScimSchemasCyberark10PrivilegedData: types.UrnIetfParamsScimSchemasCyberark10PrivilegedData { Safe: "safeName", Properties: []types.Properties { { Key: "username" Value: "ExampleUser" }, { Key: "address" Value: "ExampleAddress" }, { Key: "platformId" Value: "ExamplePlatform" }, { Key: "secret" Value: "ExampleSecret" }, }, }, } addPrivilegedData, err := s.AddPrivilegedData(context.Background, PrivilegedData)
func (*Service) AddSafe ¶
AddSafe attempts add a single Safe and requires a types.Container struct with the desired Safe information. The response from the SCIM API is returned as the types.Container struct.
At a minimum the types.Container struct must contain the following:
Name Schemas
Example Usage:
safe := types.Container { Name: "ExampleSafe", Schemas: []string{"urn:ietf:params:scim:schemas:core:1.0:Container"}, } addSafe, err := s.AddSafe(context.Background, safe)
func (*Service) AddSafePermissions ¶
func (s *Service) AddSafePermissions(ctx context.Context, safePermission types.ContainerPermission) (*types.ContainerPermission, error)
AddSafePermissions attempts a "POST" operation to addpermissions to a single Safe for a specific user and requires a types.ContainerPermission struct with the desired User, Safe, and Rights information. The response from the SCIM API is returned as the types.ContainerPermission struct.
Example Usage:
safePermission := types.ContainerPermission { Schemas: []string{"urn:ietf:params:scim:schemas:pam:1.0:ContainerPermission"}, User.Display: "john.smith@example.com", Container.Name: "ExampleContainer", Rights: []string{"UseAccounts","RetrieveAccounts","ListAccounts"}, } addSafePermissions, err := s.AddSafePermissions(context.Background, safePermission)
func (*Service) AddUser ¶
AddUser attempts add a single user and requires a types.User struct with the desired user information. The response from the SCIM API is returned as the types.User struct.
At a minimum the types.User struct must contain the following:
UserName Password Schemas
Example Usage:
user := types.User { UserName: "JohnDoe@example.com", Password: "ExamplePass", Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:User"}, } addUser, err := s.AddUser(context.Background, user)
func (*Service) DeleteGroup ¶
DeleteGroup attempts to perform a "DELETE" operation against a single Group by Group Id via the SCIM API and returns does not return a response is successful. An error will be returned if an attempt is made to delete multiple Groups or if deletion is attempted twice.
Example Usage:
err := s.DeleteGroup(context.Background, "8")
func (*Service) DeletePrivilegedData ¶
DeletePrivilegedData attempts to perform a "DELETE" operation against Privileged Data based on the provided Id. No response is provided if deletion is successful.
An error will be returned if an attempt is made to delete multiple Safes or if deletion is attempted twice.
Example Usage:
err := s.DeletePrivilegedData(context.Background, "62_3")
func (*Service) DeleteSafe ¶
DeleteSafe attempts to perform a "DELETE" operation against a single Safe by Safe Name via the SCIM API and does not return a response is successful. An error will be returned if an attempt is made to delete multiple Safes or if deletion is attempted twice.
Example Usage:
err := s.DeleteSafe(context.Background, "ExampleSafe")
func (*Service) DeleteSafePermission ¶
func (s *Service) DeleteSafePermission(ctx context.Context, safeName string, userOrGroupName string) error
DeleteSafe attempts to perform a "DELETE" operation against a single Safe for a single user or group Safe Name and the User or Group Name.
An error will be returned if an attempt is made to delete multiple Safes or if deletion is attempted twice.
Example Usage:
err := s.DeleteSafePermission(context.Background, "ExampleSafe", "ExampleUser")
func (*Service) DeleteUser ¶
DeleteUser attempts to perform a "DELETE" operation against a single User by User Id via the SCIM API and does not return a response is successful. An error will be returned if an attempt is made to delete multiple Users or if deletion is attempted twice.
Example Usage:
err := s.DeleteUser(context.Background, "8")
func (*Service) GetGroupByFilter ¶
func (s *Service) GetGroupByFilter(ctx context.Context, filterType string, filterQuery string) (*types.Group, error)
GetGroupByFilter retrieves a single Group based on a provided filter. The response from the SCIM API is returned as the types.Group struct. filterType should be displayName filterQuery should be the actual query (e.g. Auditors) The Groups struct response will only contain a single resource.
Example Usage:
getGroupByFilter, err := s.GetGroupByFilter(context.Background, "displayName", "Auditors")
func (*Service) GetGroupById ¶
GetGroupById retrieves a single Group by Group Id via the SCIM API. The response from the SCIM API is returned as the types.Group struct.
Requires PVWA 12.2+
Example Usage:
getGroupById, err := s.GetGroupById(context.Background, "8")
func (*Service) GetGroups ¶
GetGroups retrieves all groups via the SCIM API and returns them in the form of the The response from the SCIM API is returned as the types.Groups struct.
Example Usage:
getGroups, err := s.GetGroups(context.Background)
func (*Service) GetGroupsIndex ¶
func (s *Service) GetGroupsIndex(ctx context.Context, startIndex int, count int) (*types.Groups, error)
GetGroupsIndex retrieves a limited subset of groups based on a starting and count. The response from the SCIM API is returned as the types.Groups struct.
Requires PVWA 12.2+
Example Usage:
getGroupsIndex, err := s.GetGroupsIndex(context.Background, 1, 5)
func (*Service) GetGroupsSort ¶
func (s *Service) GetGroupsSort(ctx context.Context, sortBy string, sortOrder string) (*types.Groups, error)
GetGroupsSort retrieves and sorts all Groups via the SCIM API. The response from the SCIM API is returned as the types.Groups struct. Supported "sortBy" fields are: displayName Supported "sortOrder" fileds are: ascending or descending
Requires PVWA 12.2+
Example Usage:
getGroupsSort, err := s.GetGroupsSort(context.Background, "displayName", "ascending")
func (*Service) GetPrivilegedData ¶
GetPrivilegedData retrieves all Privileged Data (Accounts, SSHKeys, etc...) via the SCIM API. The response from the SCIM API is returned as the types.PrivilegedDatas struct
Example Usage:
getPrivilegedData, err := s.GetPrivilegedData(context.Background)
func (*Service) GetPrivilegedDataByFilter ¶
func (s *Service) GetPrivilegedDataByFilter(ctx context.Context, filterType string, filterQuery string) (*types.PrivilegedDatas, error)
GetPrivilegedDataByFilter retrieves Privileged Data based on a provided filter via the SCIM API. The response from the SCIM API is returned as the types.PrivilegedDatas struct. filterType is the json key (e.g. name, id) filterQuery is the json value (e.g. VaultInternal)
Notes: Filter query is case sensitive
Example Usage:
getPrivilegedDataByFilter, err := s.GetPrivilegedDataByFilter(context.Background, "name", "exampleadmin") getPrivilegedDataByFilter, err := s.GetPrivilegedDataByFilter(context.Background, "id", "92_3")
func (*Service) GetPrivilegedDataById ¶
func (s *Service) GetPrivilegedDataById(ctx context.Context, id string) (*types.PrivilegedData, error)
GetPrivilegedDataById retrieves a data point based on Id via the SCIM API. The response from the SCIM API is returned as the types.PrivilegedData struct.
Requires PVWA 12.2+
Example Usage:
getPrivilegedDataById, err := s.GetPrivilegedDataById(context.Background, "92_2")
func (*Service) GetPrivilegedDataIndex ¶
func (s *Service) GetPrivilegedDataIndex(ctx context.Context, startIndex int, count int) (*types.PrivilegedDatas, error)
GetPrivilegedDataIndex retrieves a limited subset of Privileged Data based on a starting index and count. The response from the SCIM API is returned as the types.PrivilegedDatas struct
Requires PVWA 12.2+
Example Usage:
getPrivielegedDataIndex, err := s.GetPrivilegedDataIndex(context.Background, 10, 5)
func (*Service) GetPrivilegedDataSort ¶
func (s *Service) GetPrivilegedDataSort(ctx context.Context, sortBy string, sortOrder string) (*types.PrivilegedDatas, error)
GetPrivilegedDataSort retrieves and sorts all Safes via the SCIM API based on provided The response from the SCIM API is returned as the types.Containers struct Supported "sortBy" fields: name, id, type, meta.created, meta.lastModified, or meta.location Supported "sortOrder" fileds are: ascending or descending
Requires PVWA 12.2+
Example Usage:
getPrivilegedDataSort, err := s.GetPrivilegedDataSort(context.Background, "name", "ascending")
func (*Service) GetSafeByFilter ¶
func (s *Service) GetSafeByFilter(ctx context.Context, filterType string, filterQuery string) (*types.Container, error)
GetSafeByFilter retrieves a single Safe based on a provided filter via the SCIM API. The response from the SCIM API is returned as the types.Container struct. filterType is the json key (e.g. name, displayName, description, etc...) filterQuery is the json value (e.g. PVWATicketingSystem)
Notes: Filter query is case sensitive
Example Usage:
getSafeByFilter, err := s.GetSafeByFilter(context.Background, "name", "PVWATicketingSystem")
func (*Service) GetSafeByName ¶
GetSafeByName retrieves a single Safe by Safe Name via the SCIM API. The response from the SCIM API is returned as the types.Container struct.
Requires PVWA 12.2+
Example Usage:
getSafeByName, err := s.GetSafeByName(context.Background, "NotificationEngine")
func (*Service) GetSafePermissionByFilter ¶
func (s *Service) GetSafePermissionByFilter(ctx context.Context, filterType string, filterQuery string) (*types.ContainerPermissions, error)
GetSafePermissionsByFilter retrieves a single Safe based on a provided filter via the SCIM API. The response from the SCIM API is returned as the types.ContainerPermissions struct. filterType is the json key (e.g. container.name, container.display, container.value, user.display, user.value, group.value, group.display) filterQuery is the json value (e.g. VaultInternal)
Notes: Filter query is case sensitive
Example Usage:
// Return all permission on a single safe getSafePermissionsByFilter, err := s.GetSafePermissionsByFilter(context.Background, "container.name", "PVWATicketingSystem") // Return specific users permissions on all safes getSafePermissionsByFilter, err := s.GetSafePermissionsByFilter(context.Background, "user.display", "EPMAgent") // Return specific group permissions on all safes getSafePermissionsByFilter, err := s.GetSafePermissionsByFilter(context.Background, "group.value", "18")
func (*Service) GetSafePermissions ¶
GetSafePermissions retrieves all Safes via the SCIM API. The response from the SCIM API is returned as the types.ContainerPermissions struct
Example Usage:
getSafePermissions, err := s.GetSafePermissions(context.Background)
func (*Service) GetSafePermissionsByName ¶
func (s *Service) GetSafePermissionsByName(ctx context.Context, safeName string, userOrGroupName string) (*types.ContainerPermission, error)
GetSafePermissionsByName retrieves a single Safe by Safe Name amd a User or Group Name via the SCIM API. The response from the SCIM API is returned as the types.ContainerPermission struct.
Requires PVWA 12.2+
Example Usage:
getSafePermissionsByName, err := s.GetSafePermissionsByName(context.Background, "VaultInternal", "EPMAgent")
func (*Service) GetSafePermissionsIndex ¶
func (s *Service) GetSafePermissionsIndex(ctx context.Context, startIndex int, count int) (*types.ContainerPermissions, error)
GetSafePermissionsIndex retrieves a limited subset of Safe Permissions based on a starting index and count. The response from the SCIM API is returned as the types.ContainerPermissions struct
Requires PVWA 12.2+
Example Usage:
getSafePermissionsIndex, err := s.GetSafePermissionsIndex(context.Background, 10, 5)
func (*Service) GetSafePermissionsSort ¶
func (s *Service) GetSafePermissionsSort(ctx context.Context, sortBy string, sortOrder string) (*types.ContainerPermissions, error)
GetSafePermissionsSort retrieves and sorts all Safes via the SCIM API based on provided The response from the SCIM API is returned as the types.ContainerPermissions struct Supported "sortBy" fields: id Supported "sortOrder" fileds are: ascending or descending
Requires PVWA 12.2+
Example Usage:
getSafePermissionsSort, err := s.GetSafePermissionsSort(context.Background, "SafeName", "ascending")
func (*Service) GetSafes ¶
GetSafes retrieves all Safes via the SCIM API. The response from the SCIM API is returned as the types.Containers struct
Example Usage:
getSafes, err := s.GetSafes(context.Background)
func (*Service) GetSafesIndex ¶
func (s *Service) GetSafesIndex(ctx context.Context, startIndex int, count int) (*types.Containers, error)
GetSafesIndex retrieves a limited subset of Safes based on a starting index and count. The response from the SCIM API is returned as the types.Containers struct
Requires PVWA 12.2+
Example Usage:
getSafesIndex, err := s.GetSafesIndex(context.Background, 10, 5)
func (*Service) GetSafesSort ¶
func (s *Service) GetSafesSort(ctx context.Context, sortBy string, sortOrder string) (*types.Containers, error)
GetSafesSort retrieves and sorts all Safes via the SCIM API based on provided The response from the SCIM API is returned as the types.Containers struct Supported "sortBy" fields: name, displayName, description, id, meta.created, meta.lastModified, or meta.location Supported "sortOrder" fileds are: ascending or descending
Requires PVWA 12.2+
Example Usage:
getSafesSort, err := s.GetSafesSort(context.Background, "SafeName", "ascending")
func (*Service) GetUserByFilter ¶
func (s *Service) GetUserByFilter(ctx context.Context, filterType string, filterQuery string) (*types.User, error)
GetUserByFilter retrieves a single user based on a provided filter via the SCIM API. The response from the SCIM API is returned as the types.User struct. filterType is the json key (e.g. displayName, name.givenName, name.familyName) filterQuery is the json value (e.g. john.smith@example.com, "John", "Smith")
Notes: Filter query is case sensitive
Example Usage:
getUserByFilter, err := s.GetUserByFilter(context.Background, "userName", "john.smith@example.com") getUserByFilter, err := s.GetUserByFilter(context.Background, "name.familyName", "Smith")
func (*Service) GetUserById ¶
GetUserById retrieves a single user by User Id via the SCIM API. The response from the SCIM API is returned as the types.User struct.
Requires PVWA 12.2+
Example Usage:
getUserById, err := s.GetUserById(context.Background, "1")
func (*Service) GetUsers ¶
GetUsers retrieves all users via the SCIM API. The response from the SCIM API is returned as the types.Users struct
Example Usage:
getUsers, err := s.GetUsers(context.Background)
func (*Service) GetUsersIndex ¶
func (s *Service) GetUsersIndex(ctx context.Context, startIndex int, count int) (*types.Users, error)
GetUsersIndex retrieves a limited subset of Users based on a starting index and count. The response from the SCIM API is returned as the types.Users struct
Requires PVWA 12.2+
Example Usage:
getUsersIndex, err := s.GetUsersIndex(context.Background, 1, 5)
func (*Service) GetUsersSort ¶
func (s *Service) GetUsersSort(ctx context.Context, sortBy string, sortOrder string) (*types.Users, error)
GetUsersSort retrieves and sorts all users via the SCIM API based on provided The response from the SCIM API is returned as the types.Users struct Supported "sortBy" fields: active, userName, displayName, name.givenName, name.familyName, userType, id, meta.created, meta.lastmodified Supported "sortOrder" fileds are: ascending or descending
Requires PVWA 12.2+
Example Usage:
getUsersSort, err := s.GetUsersSort(context.Background, "userName", "ascending")
func (*Service) ModifyPrivilegedData ¶
func (s *Service) ModifyPrivilegedData(ctx context.Context, privilegedData types.PrivilegedData) (*types.PrivilegedData, error)
ModifyPrivilegedData attempts to perform a "PATCH" operation against Privileged Data and requires a types.PrivilegedData struct containing the "operation" substruct with the desired udpates. The PrivilegedData Id must be part of the struct for this function to work properly.
Example Usage:
PrivilegedDataModify := types.PrivilegedData { Id: "62_3" Schemas: []string{"urn:ietf:params:scim:api:messages:2.0:PatchOp"} Operations: []types.Operations { { Op: "replace", Path: "urn:ietf:params:scim:schemas:cyberark:1.0:PrivilegedData.properties", Value: []types.Value { { Key: "address", Value: "newAddress", }, }, }, }, } modifyPrivilegedData, err := s.ModifyPrivilegedData(context.Background, PrivilegedDataModify)
func (*Service) UpdateGroup ¶
UpdateGroup attempts to perform a "PUT" operation against a single Group and requires a passed object in the form of types.Group. The "PUT" operation replaces an existing group with an updated version or creates a new group entirely.
Example Usage:
Group := types.Group { DisplayName: "ExampleGroup", Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:Group"}, } addGroup, err := s.UpdateGroup(context.Background, Group)
func (*Service) UpdatePrivilegedData ¶
func (s *Service) UpdatePrivilegedData(ctx context.Context, privilegedData types.PrivilegedData) (*types.PrivilegedData, error)
UpdatePrivilegedData attempts to perform a "PUT" operation against Privileged Data and requires a types.PrivilegedData struct with the desired udpates. The PrivilegedData Id must be part of the struct for this function to work properly.
Requires PVWA 12.2+
Example Usage:
PrivilegedDataUpdate := types.PrivilegedData { Name: "NewAccount", Id: "62_3" Schemas: []string{"urn:ietf:params:scim:schemas:pam:1.0:PrivilegedData", "urn:ietf:params:scim:schemas:cyberark:1.0:PrivilegedData"} UrnIetfParamsScimSchemasCyberark10PrivilegedData: types.UrnIetfParamsScimSchemasCyberark10PrivilegedData { Safe: "safeName", Properties: []types.Properties { { Key: "username" Value: "ExampleUser" }, { Key: "address" Value: "ExampleAddress" }, { Key: "platformId" Value: "ExampleNewPlatform" }, }, } addPrivilegedData, err := s.AddPrivilegedData(context.Background, PrivilegedData)
func (*Service) UpdateSafe ¶
UpdateSafe attempts to perform a "PUT" operation against a single Safe and requires a passed object in the form of types.Container. Null values are supported enabling the removal of Container attribute values.
Requires PVWA 12.2+
Example Usage:
safe := types.Container { Name: "ExampleSafe, Displayname: "ExampleSafeDisplayName" // Updated name Schemas: []string{"urn:ietf:params:scim:schemas:core:1.0:Container"}, } updateSafe, err := s.UpdateContainer(context.Background, safe)
func (*Service) UpdateSafePermissions ¶
func (s *Service) UpdateSafePermissions(ctx context.Context, safePermission types.ContainerPermission) (*types.Container, error)
UpdateSafePermissions attempts to perform a "PUT" operation against a single Safe and requires a types.ContainerPermission struct with the desired udpates. Null values are supported enabling the removal of Container attribute values.
Requires PVWA 12.2+
Example Usage:
safePermissionUpdate := types.ContainerPermission { Schemas: []string{"urn:ietf:params:scim:schemas:pam:1.0:ContainerPermission"}, User.Display: "john.smith@example.com", Container.Name: "ExampleContainer", Rights: []string{"UseAccounts","RetrieveAccounts","ListAccounts","ManageSafe"}, } updateSafePermissions, err := s.UpdateSafePermissions(context.Background, safePermissionUpdate)
func (*Service) UpdateUser ¶
UpdateUser attempts to perform a "PUT" operation against a single User and requires a passed object in the form of types.User. Null values are supported enabling the removal of user attribute values.
Example Usage:
user := types.User { UserName: "JohnDoe@example.com", Active: false, // Disable User via PUT Schemas: []string{"urn:ietf:params:scim:schemas:core:2.0:User"}, } updateUser, err := s.UpdateUser(context.Background, user)