Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/proto/teleport/legacy/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5396,6 +5396,10 @@ message OktaImportRuleMatchV1 {
repeated string AppIDs = 1 [(gogoproto.jsontag) = "app_ids,omitempty"];
// GroupIDs is a list of group IDs to match against.
repeated string GroupIDs = 2 [(gogoproto.jsontag) = "group_ids,omitempty"];
// AppNameRegexes is a list of regexes to match against app names.
repeated string AppNameRegexes = 3 [(gogoproto.jsontag) = "app_name_regexes,omitempty"];
// GroupNameRegexes is a list of regexes to match against group names.
repeated string GroupNameRegexes = 4 [(gogoproto.jsontag) = "group_name_regexes,omitempty"];
}

// OktaAssignmentV1 is a representation of an action or set of actions taken by Teleport to assign Okta users to applications or groups.
Expand Down
14 changes: 14 additions & 0 deletions api/types/okta.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ type OktaImportRuleMatch interface {
GetAppIDs() (bool, []string)
// GetGroupIDs returns whether or not this match contains a Group ID match and, if so, the list of app IDs.
GetGroupIDs() (bool, []string)
// GetAppNameRegexes returns whether or not this match contains app name regexes and, if so, the regexes.
GetAppNameRegexes() (bool, []string)
// GetGroupNameRegexes returns whether or not this match contains group name regexes and, if so, the regexes.
GetGroupNameRegexes() (bool, []string)
}

// GetAppIDs returns whether or not this match contains an App ID match and, if so, the list of app IDs.
Expand All @@ -163,6 +167,16 @@ func (o *OktaImportRuleMatchV1) GetGroupIDs() (bool, []string) {
return len(o.GroupIDs) > 0, o.GroupIDs
}

// GetAppNameRegexes returns whether or not this match contains app name regexes and, if so, the regexes.
func (o *OktaImportRuleMatchV1) GetAppNameRegexes() (bool, []string) {
return len(o.AppNameRegexes) > 0, o.AppNameRegexes
}

// GetGroupNameRegexes returns whether or not this match contains group name regexes and, if so, the regexes.
func (o *OktaImportRuleMatchV1) GetGroupNameRegexes() (bool, []string) {
return len(o.GroupNameRegexes) > 0, o.GroupNameRegexes
}

// CheckAndSetDefaults checks and sets default values
func (o *OktaImportRuleMatchV1) CheckAndSetDefaults() error {
if len(o.AppIDs) > 0 && len(o.GroupIDs) > 0 {
Expand Down
Loading