Documentation ¶
Index ¶
- type ApprovalMsgObj
- type AuditObject
- type Cloud
- type CloudIdentityManager
- type IdentityData
- type Messenger
- type Repo
- type Service
- func (s *Service) FindExpiredPermissions(accountName, role string, delete bool)
- func (s *Service) FindSelectedCloudResoucesNames(service, accountname string, selected []string) []string
- func (s *Service) GeneratePolicyFromAuditObj(object AuditObject) ([]byte, error)
- func (s *Service) GetActionsWithFilter(service string, filter string) map[string]string
- func (s *Service) GetAuditObj(UserId, RequestID string) (AuditObject, error)
- func (s *Service) GetCloudResourcesForService(filter, service, accountname string) (map[string]string, bool)
- func (s *Service) GetCloudUserId(accountName string, roleName string) (string, error)
- func (s *Service) GetServicesWithFilter(filter string) []string
- func (s *Service) SetAuditObj(object AuditObject) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApprovalMsgObj ¶
type AuditObject ¶
type AuditObject struct { UserId string `json:"userId"` RequestId string `json:"requestId"` Description string `json:"description"` RequestTime time.Time `json:"requestTime"` ApprovingUser string `json:"approvingUser"` ApprovalMessages []ApprovalMsgObj `json:"approvalMessages"` CloudUserId string `json:"cloudUserId"` LoginRole string `json:"loginRole"` AccountRole string `json:"accountRole"` AccountId string `json:"accountId"` Duration string `json:"duration"` Services []string `json:"services"` Actions map[string][]string `json:"actions"` Resources map[string][]string `json:"resources"` }
type CloudIdentityManager ¶
type CloudIdentityManager interface { IsPolicyExpired(policy string) (bool, error) GeneratePolicyFromAuditObj(curTime time.Time, object AuditObject, tmpls, tmplFieldNmaes map[string]string) ([]byte, error) GetCloudUserId(accountName string, roleName string) (string, error) PutPolicy(accountName, roleName, policyName, policy string) error FindPolicysForRole(accountName, roleName string) (map[string]string, error) DeletePolicys(accountName, roleName string, policysNames []string) error }
type IdentityData ¶
type Messenger ¶
type Messenger interface { PostSimpleMessage(channelId string, msgText string, requestId string) error PostBlockMessage(channelId string, msgContents []slack.Block, requestId string) (string, string, error) GetUserIdsFromGroup(groups []string) ([]string, error) UpdateMessageFromMessageObj(requestId string, approvalMsgObj []ApprovalMsgObj, msgContents []slack.Block) error GenerateModal(modalType string, Accounts, LoginRoles []string, hasResourceFinder bool, privateMetadata string, selectedService string) (slack.ModalViewRequest, error) }
type Repo ¶
type Repo interface { QueryAuditObjs(UserID string) ([]AuditObject, error) GetAuditObj(UserID, RequestId string) (AuditObject, error) SetAuditObj(requestObj AuditObject) error UpdateApprovingUser(UserID, RequestId, approvingUser string) error }
type Service ¶
type Service struct { Cloud Cloud Messenger Messenger Repo Repo CloudIdentityManager CloudIdentityManager IdentityData IdentityData }
func NewService ¶
func NewService(cloud Cloud, repo Repo, cim CloudIdentityManager, identitydata IdentityData, messenger Messenger) *Service
func (*Service) FindExpiredPermissions ¶
func (*Service) FindSelectedCloudResoucesNames ¶
func (*Service) GeneratePolicyFromAuditObj ¶
func (s *Service) GeneratePolicyFromAuditObj(object AuditObject) ([]byte, error)
func (*Service) GetActionsWithFilter ¶
GetActionsWithFilter Gets Actions for a selected service with a filter. Returns a map[string]string the key is the service name while the value is a unique id for each action. Will return an empty map[string]string if there is nothing found.
func (*Service) GetAuditObj ¶
func (s *Service) GetAuditObj(UserId, RequestID string) (AuditObject, error)
GetAuditObj Gets the Audit & Message data in the repository based on the inputted UserId and RequestId
func (*Service) GetCloudResourcesForService ¶
func (s *Service) GetCloudResourcesForService(filter, service, accountname string) (map[string]string, bool)
GetCloudResourcesForService Overwrite account used by client in the individuals clients to keep the functions ordered and as simple as possible in the service interface
func (*Service) GetCloudUserId ¶
func (*Service) GetServicesWithFilter ¶
GetServicesWithFilter Gets Services with a filter and returns them as a list. Will return an empty []string if nothing is found.
func (*Service) SetAuditObj ¶
func (s *Service) SetAuditObj(object AuditObject) error
SetAuditObj Sets the Audit & Message data in the repository