Documentation
¶
Index ¶
- Constants
- Variables
- func GetTokenPassword(ctx context.Context, baseURL, username, password string, useBasicAuth bool) (*oauth2.Token, error)
- func GetTokenRefresh(ctx context.Context, baseURL, refreshToken string) (*oauth2.Token, error)
- type AnalyticsRequest
- type AnalyticsRequestAttributes
- type AnalyticsResponse
- type AnalyticsService
- type ChangePasswordOpts
- type Client
- type ConnectionParamsRESTOpts
- type ConnectionSaveTestOpts
- type ExportPackageOpts
- type GetUserResponse
- type ImportPackageOpts
- type LoginRequest
- type PasswordService
- type TransportObjectsToExport
- type TransportService
- type UserDetails
- type UserLoginAccessDetail
- type UsersService
- type Values
Constants ¶
View Source
const ( AnalyticsLimitDefault = 50 AnalyticsLimitMax = 500 )
View Source
const ( RelURLLogin = "/ECM/api/login" RelOAuthAccessToken = "/ECM/oauth/access_token" // #nosec G101 RelURLECM = "/ECM" RelURLAPI = "/api/v5" RelURLLoginRuntimeControlsData = "/fetchRuntimeControlsDataV2" // API at https://documenter.getpostman.com/view/23973797/2s9XxwutWR#b821cc21-ee7c-49e3-9433-989ed87b2b03 RelURLUserGetAccessDetails = "/getAccessDetailsForUser" RelURLPasswordChange = "/changePassword" RelURLTransportExport = "/exportTransportPackage" RelURLTransportImport = "/importTransportPackage" RelURLUserGet = "/getUser" RelURLUserUpdate = "/updateUser" EnvSaviyntServerURL = "SAVIYNT_SERVER_URL" EnvSaviyntUsername = "SAVIYNT_USERNAME" EnvSaviyntPassword = "SAVIYNT_PASSWORD" )
Variables ¶
View Source
var ( ErrClientNotSet = errors.New("saviynt.Client must be set") ErrSimpleClientNotSet = errors.New("simple client must be set") )
Functions ¶
func GetTokenPassword ¶ added in v0.2.0
Types ¶
type AnalyticsRequest ¶
type AnalyticsRequestAttributes ¶
type AnalyticsRequestAttributes struct {
TimeFrame string `json:"timeFrame"`
}
type AnalyticsResponse ¶ added in v0.2.0
type AnalyticsService ¶ added in v0.5.0
type AnalyticsService struct {
// contains filtered or unexported fields
}
func NewAnalyticsService ¶ added in v0.5.0
func NewAnalyticsService(client *Client) *AnalyticsService
func (*AnalyticsService) FetchRuntimeControlsDataV2 ¶ added in v0.5.0
func (svc *AnalyticsService) FetchRuntimeControlsDataV2(analyticsName, requestor, analyticsID string, attrs map[string]any, limit, offset uint) (*httpsimple.Request, *http.Response, error)
FetchRuntimeControlsDataV2 returns data from the `fetchRuntimeControlsDataV2` API endpoint. `analyticsName` is required. `requestor`, and `analyticsID` are optional.
type ChangePasswordOpts ¶ added in v0.3.0
type ChangePasswordOpts struct { // Username specifies the name of the user for whom you need to change the password. Username string `json:"username"` // Password specifies the new password. Password string `json:"password"` // ChangePasswordAssociatedAccounts specifies whether to create the corresponding Change Password task, if `true`. You can specify `false` to only update the user password. The default value is `true`. ChangePasswordAssociatedAccounts bool `json:"changePasswordAssociatedAccounts"` // Endpoint specifies a list of endpoints (comma-separated) to update the password for // if `ChangePasswordAssociatedAccounts` is set to `true`. Endpoint []string `json:"endpoint"` // SetARSTaskSource specifies whether to set the source column in the `arstasks` // table with the `changeOwnPasswordFromAPI` value. When the source column in `arstasks` // table is set to the `changeOwnPasswordFromAPI` value then the `pwdLastSet` parameter is // not set to `0“ for Active Directory (AD). The default value is `false`. Note: If your // AD password has expired (pwdLastSet = 0), you are forced to choose a new password in EIC // on the next login. SetARSTaskSource bool `json:"setarstasksource"` // UpdateUserPassword specifies whether to update the user password when // `ChangePasswordAssociatedAccounts` is set to `true`. Setting this to `true` specifies // when `ChangePasswordAssociatedAccounts` is `true` updates the user password and creates // the corresponding Change Password task. When set to `false“, only the Change Password // task is created. The default value is true. UpdateUserPassword bool `json:"updateUserPassword"` // ValidateAgainstPolicy specifies whether the new password conforms to the USER scope // password policy. If you do not want to apply the password policy, then specify `N`. // The default value is `Y`. ValidateAgainstPolicy bool `json:"validateagainstpolicy"` }
func (ChangePasswordOpts) Values ¶ added in v0.3.0
func (opts ChangePasswordOpts) Values() url.Values
type Client ¶
type Client struct { BaseURL string Path string HTTPClient *http.Client SimpleClient *httpsimple.Client Token *oauth2.Token AnalyticsAPI *AnalyticsService PasswordAPI *PasswordService TransportAPI *TransportService UsersAPI *UsersService }
func (Client) ConnectionSaveTest ¶ added in v0.2.0
func (c Client) ConnectionSaveTest()
func (*Client) GetTokenPassword ¶ added in v0.2.0
type ConnectionParamsRESTOpts ¶ added in v0.2.0
func (*ConnectionParamsRESTOpts) TrimSpace ¶ added in v0.2.0
func (opts *ConnectionParamsRESTOpts) TrimSpace()
func (*ConnectionParamsRESTOpts) Values ¶ added in v0.2.0
func (opts *ConnectionParamsRESTOpts) Values() url.Values
type ConnectionSaveTestOpts ¶ added in v0.2.0
type ConnectionSaveTestOpts struct { ConnectionType string SaveConnection bool ConnectionName string Params Values }
func (ConnectionSaveTestOpts) Values ¶ added in v0.2.0
func (opts ConnectionSaveTestOpts) Values() url.Values
type ExportPackageOpts ¶ added in v0.6.0
type ExportPackageOpts struct { // ExportOnline (MANDATORY) ExportOnline bool `json:"exportonline"` // ExportPath (MANDATORY if ExportOnline is `false`) ExportPath string `json:"exportpath,omitempty"` // EnvironmentName (MANDATORY if ExportOnline is `true`) EnvironmentName string `json:"environmentname,omitempty"` // UpdateUser specifies the username of the user exporting the package UpdateUser string `json:"updateuser,omitempty"` BusinessJustification string `json:"businessjustification,omitempty"` ObjectsToExport TransportObjectsToExport `json:"objectstoexport,omitempty"` // TransportOwner is an option option to transport owners for selected object TransportOwner bool `json:"transportowner"` TransportMembers bool `json:"transportmembers"` }
type GetUserResponse ¶ added in v0.2.0
type GetUserResponse struct { Msg string `json:"msg"` DisplayCount string `json:"displaycount"` TotalCount string `json:"totalcount"` ErrorCode string `json:"errorCode"` UserDetails UserDetails `json:"userdetails"` }
type ImportPackageOpts ¶ added in v0.6.0
type ImportPackageOpts struct { // PackageToImport (MANDATORY) specifies the local filepath of the package to import. PackageToImport string `json:"packagetoimport"` // UpdateUser (OPTIOAL) specifies the username of the user importing the package, UpdateUser string `json:"updateuser,omitempty"` BusinessJustification string `json:"businessjustification,omitempty"` }
type LoginRequest ¶
type PasswordService ¶ added in v0.3.0
type PasswordService struct {
// contains filtered or unexported fields
}
func NewPasswordService ¶ added in v0.3.0
func NewPasswordService(client *Client) *PasswordService
func (*PasswordService) ChangePassword ¶ added in v0.3.0
func (svc *PasswordService) ChangePassword(opts ChangePasswordOpts) (*http.Response, error)
type TransportObjectsToExport ¶ added in v0.6.0
type TransportObjectsToExport struct { SAVRoles []string `json:"savRoles,omitempty"` EmailTemplate []string `json:"emailTemplate,omitempty"` Roles []string `json:"roles,omitempty"` AnalyticsV1 []string `json:"analyticsV1,omitempty"` AnalyticsV2 []string `json:"analyticsV2,omitempty"` GlobalConfig []string `json:"globalConfig,omitempty"` Workflows []string `json:"workflows,omitempty"` Connection []string `json:"connection,omitempty"` AppOnboarding []string `json:"appOnboarding,omitempty"` UserGroups []string `json:"userGroups,omitempty"` ScanRules []string `json:"scanRules,omitempty"` Organizations []string `json:"organizations,omitempty"` SecuritySystems []string `json:"securitySystems,omitempty"` }
type TransportService ¶ added in v0.6.0
type TransportService struct {
// contains filtered or unexported fields
}
func NewTransportService ¶ added in v0.6.0
func NewTransportService(client *Client) *TransportService
func (*TransportService) ExportPackage ¶ added in v0.6.0
func (svc *TransportService) ExportPackage(opts ExportPackageOpts) (*httpsimple.Request, *http.Response, error)
func (*TransportService) ImportPackage ¶ added in v0.6.0
func (svc *TransportService) ImportPackage(opts ImportPackageOpts) (*httpsimple.Request, *http.Response, error)
type UserDetails ¶ added in v0.2.0
type UserLoginAccessDetail ¶ added in v0.2.0
type UsersService ¶ added in v0.4.0
type UsersService struct {
// contains filtered or unexported fields
}
func NewUsersService ¶ added in v0.4.0
func NewUsersService(client *Client) *UsersService
func (*UsersService) GetUserAccessDetails ¶ added in v0.4.0
func (svc *UsersService) GetUserAccessDetails()
func (*UsersService) GetUserByUsername ¶ added in v0.4.0
func (svc *UsersService) GetUserByUsername(username string) (*GetUserResponse, []byte, *http.Response, error)
func (*UsersService) UpdateUsers ¶ added in v0.4.0
func (svc *UsersService) UpdateUsers(matchField, matchValue string, attrs map[string]any) (*httpsimple.Request, *http.Response, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.