From 463cb25ab673f0808328bde12945a8de23260ccc Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Thu, 4 Dec 2025 18:17:46 +0000 Subject: [PATCH 01/22] feat: add create / delete team (group) resource actions --- pkg/connector/team.go | 403 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 403 insertions(+) diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 194b0ba2..a55d014a 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -6,7 +6,9 @@ import ( "strconv" "strings" + config "github.com/conductorone/baton-sdk/pb/c1/config/v1" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + "github.com/conductorone/baton-sdk/pkg/actions" "github.com/conductorone/baton-sdk/pkg/annotations" "github.com/conductorone/baton-sdk/pkg/pagination" "github.com/conductorone/baton-sdk/pkg/types/entitlement" @@ -17,6 +19,7 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.uber.org/zap" "google.golang.org/grpc/codes" + "google.golang.org/protobuf/types/known/structpb" ) const ( @@ -362,6 +365,406 @@ func (o *teamResourceType) Revoke(ctx context.Context, grant *v2.Grant) (annotat return nil, nil } +// Create creates a new team in a GitHub organization. +// The resource must have a parent resource ID that references the organization. +// The team name is taken from the resource's DisplayName field. +// Optional profile fields: +// - description: string - Team description +// - privacy: string - "secret" or "closed" (default: "secret") +// - parent_team_id: int64 - ID of the parent team for nested teams +func (o *teamResourceType) Create(ctx context.Context, resource *v2.Resource) (*v2.Resource, annotations.Annotations, error) { + l := ctxzap.Extract(ctx) + + if resource == nil { + return nil, nil, fmt.Errorf("github-connector: resource cannot be nil") + } + + if resource.Id == nil || resource.Id.ResourceType != resourceTypeTeam.Id { + return nil, nil, fmt.Errorf("github-connector: invalid resource type for team creation") + } + + // Get the parent org resource ID + parentResourceID := resource.GetParentResourceId() + if parentResourceID == nil { + return nil, nil, fmt.Errorf("github-connector: parent organization resource ID is required to create a team") + } + + if parentResourceID.ResourceType != resourceTypeOrg.Id { + return nil, nil, fmt.Errorf("github-connector: parent resource must be an organization, got %s", parentResourceID.ResourceType) + } + + // Get the organization name + orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) + if err != nil { + return nil, nil, fmt.Errorf("github-connector: failed to get organization name: %w", err) + } + + // Get team name from display name + teamName := resource.GetDisplayName() + if teamName == "" { + return nil, nil, fmt.Errorf("github-connector: team name (DisplayName) is required") + } + + l.Info("github-connector: creating team", + zap.String("team_name", teamName), + zap.String("org_name", orgName), + ) + + // Build the NewTeam request + newTeam := github.NewTeam{ + Name: teamName, + } + + // Extract optional fields from the group trait profile if available + groupTrait, err := rType.GetGroupTrait(resource) + if err == nil && groupTrait != nil && groupTrait.Profile != nil { + // Get description if provided + if description, ok := rType.GetProfileStringValue(groupTrait.Profile, "description"); ok && description != "" { + newTeam.Description = github.Ptr(description) + } + + // Get privacy setting if provided ("secret" or "closed") + if privacy, ok := rType.GetProfileStringValue(groupTrait.Profile, "privacy"); ok && privacy != "" { + if privacy == "secret" || privacy == "closed" { + newTeam.Privacy = github.Ptr(privacy) + } else { + l.Warn("github-connector: invalid privacy value, using default", + zap.String("provided_privacy", privacy), + ) + } + } + + // Get parent team ID if provided (for nested teams) + if parentTeamID, ok := rType.GetProfileInt64Value(groupTrait.Profile, "parent_team_id"); ok && parentTeamID > 0 { + newTeam.ParentTeamID = github.Ptr(parentTeamID) + } + } + + // Create the team via GitHub API + createdTeam, resp, err := o.client.Teams.CreateTeam(ctx, orgName, newTeam) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("github-connector: failed to create team %s in org %s", teamName, orgName)) + } + + // Extract rate limit data for annotations + var annos annotations.Annotations + if rateLimitData, err := extractRateLimitData(resp); err == nil { + annos.WithRateLimiting(rateLimitData) + } + + l.Info("github-connector: team created successfully", + zap.String("team_name", createdTeam.GetName()), + zap.Int64("team_id", createdTeam.GetID()), + zap.String("team_slug", createdTeam.GetSlug()), + ) + + // Create the resource representation of the newly created team + createdResource, err := teamResource(createdTeam, parentResourceID) + if err != nil { + return nil, annos, fmt.Errorf("github-connector: failed to create resource representation for team: %w", err) + } + + return createdResource, annos, nil +} + +// Delete deletes a team from a GitHub organization. +// The team is identified by its resource ID which contains the GitHub team ID. +func (o *teamResourceType) Delete(ctx context.Context, resourceId *v2.ResourceId) (annotations.Annotations, error) { + l := ctxzap.Extract(ctx) + + if resourceId == nil { + return nil, fmt.Errorf("github-connector: resource ID cannot be nil") + } + + if resourceId.ResourceType != resourceTypeTeam.Id { + return nil, fmt.Errorf("github-connector: invalid resource type %s, expected %s", resourceId.ResourceType, resourceTypeTeam.Id) + } + + // Parse the team ID from the resource + teamID, err := strconv.ParseInt(resourceId.GetResource(), 10, 64) + if err != nil { + return nil, fmt.Errorf("github-connector: invalid team ID %s: %w", resourceId.GetResource(), err) + } + + l.Info("github-connector: deleting team", + zap.Int64("team_id", teamID), + ) + + // We need to find the org that this team belongs to. + // We'll iterate through the organizations in the org cache. + var annos annotations.Annotations + var deleted bool + var lastErr error + var lastResp *github.Response + + // Use the org cache to get the list of organizations + // We need to iterate through the configured organizations + o.orgCache.RLock() + orgIDs := make([]string, 0, len(o.orgCache.orgNames)) + for orgID := range o.orgCache.orgNames { + orgIDs = append(orgIDs, orgID) + } + o.orgCache.RUnlock() + + for _, orgID := range orgIDs { + orgIDInt, err := strconv.ParseInt(orgID, 10, 64) + if err != nil { + continue + } + + // Try to get the team first to verify it exists in this org + _, resp, err := o.client.Teams.GetTeamByID(ctx, orgIDInt, teamID) + if err != nil { + // Team doesn't exist in this org, continue to next + if isNotFoundError(resp) { + continue + } + lastErr = err + lastResp = resp + continue + } + + // Team found in this org, delete it + resp, err = o.client.Teams.DeleteTeamByID(ctx, orgIDInt, teamID) + if err != nil { + lastErr = err + lastResp = resp + continue + } + + // Successfully deleted + deleted = true + if rateLimitData, err := extractRateLimitData(resp); err == nil { + annos.WithRateLimiting(rateLimitData) + } + + l.Info("github-connector: team deleted successfully", + zap.Int64("team_id", teamID), + zap.Int64("org_id", orgIDInt), + ) + break + } + + if !deleted { + if lastErr != nil { + return annos, wrapGitHubError(lastErr, lastResp, fmt.Sprintf("github-connector: failed to delete team %d", teamID)) + } + return annos, fmt.Errorf("github-connector: team %d not found in any accessible organization", teamID) + } + + return annos, nil +} + +// ResourceActions registers the resource actions for the team resource type. +// This implements the ResourceActionProvider interface. +func (o *teamResourceType) ResourceActions(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { + if err := o.registerCreateTeamAction(ctx, registry); err != nil { + return err + } + if err := o.registerDeleteTeamAction(ctx, registry); err != nil { + return err + } + return nil +} + +func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { + return registry.Register(ctx, &v2.ResourceActionSchema{ + Name: "create", + DisplayName: "Create Team", + Description: "Create a new team in a GitHub organization", + ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_CREATE}, + Arguments: []*config.Field{ + { + Name: "name", + DisplayName: "Team Name", + Description: "The name of the team to create", + Field: &config.Field_StringField{}, + IsRequired: true, + }, + { + Name: "parent", + DisplayName: "Parent Organization", + Description: "The organization to create the team in", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + { + Name: "description", + DisplayName: "Description", + Description: "A description of the team", + Field: &config.Field_StringField{}, + }, + { + Name: "privacy", + DisplayName: "Privacy", + Description: "The privacy level: 'secret' or 'closed'", + Field: &config.Field_StringField{}, + }, + }, + ReturnTypes: []*config.Field{ + {Name: "success", Field: &config.Field_BoolField{}}, + {Name: "resource", Field: &config.Field_ResourceField{}}, + }, + }, o.handleCreateTeamAction) +} + +func (o *teamResourceType) registerDeleteTeamAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { + return registry.Register(ctx, &v2.ResourceActionSchema{ + Name: "delete", + DisplayName: "Delete Team", + Description: "Delete a team from a GitHub organization", + ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_DELETE}, + Arguments: []*config.Field{ + { + Name: "resource", + DisplayName: "Team Resource", + Description: "The team resource to delete", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + { + Name: "parent", + DisplayName: "Parent Organization", + Description: "The organization the team belongs to", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + }, + ReturnTypes: []*config.Field{ + {Name: "success", Field: &config.Field_BoolField{}}, + }, + }, o.handleDeleteTeamAction) +} + +func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { + l := ctxzap.Extract(ctx) + + // Extract required arguments using SDK helpers + name, err := actions.RequireStringArg(args, "name") + if err != nil { + return nil, nil, err + } + + parentResourceID, err := actions.RequireResourceIDArg(args, "parent") + if err != nil { + return nil, nil, err + } + + // Get the organization name from the parent resource ID + orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) + if err != nil { + return nil, nil, fmt.Errorf("failed to get organization name: %w", err) + } + + l.Info("github-connector: creating team via action", + zap.String("team_name", name), + zap.String("org_name", orgName), + ) + + // Build the NewTeam request + newTeam := github.NewTeam{ + Name: name, + } + + // Extract optional fields using SDK helpers + if description, ok := actions.GetStringArg(args, "description"); ok && description != "" { + newTeam.Description = github.Ptr(description) + } + + if privacy, ok := actions.GetStringArg(args, "privacy"); ok && privacy != "" { + if privacy == "secret" || privacy == "closed" { + newTeam.Privacy = github.Ptr(privacy) + } else { + l.Warn("github-connector: invalid privacy value, using default", + zap.String("provided_privacy", privacy), + ) + } + } + + // Create the team via GitHub API + createdTeam, resp, err := o.client.Teams.CreateTeam(ctx, orgName, newTeam) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to create team %s in org %s", name, orgName)) + } + + // Extract rate limit data for annotations + var annos annotations.Annotations + if rateLimitData, err := extractRateLimitData(resp); err == nil { + annos.WithRateLimiting(rateLimitData) + } + + l.Info("github-connector: team created successfully via action", + zap.String("team_name", createdTeam.GetName()), + zap.Int64("team_id", createdTeam.GetID()), + zap.String("team_slug", createdTeam.GetSlug()), + ) + + // Create the resource representation of the newly created team + resource, err := teamResource(createdTeam, parentResourceID) + if err != nil { + return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) + } + + // Build return values using SDK helpers + resourceRv, err := actions.NewResourceReturnField("resource", resource) + if err != nil { + return nil, annos, err + } + + return actions.NewReturnValues(true, resourceRv), annos, nil +} + +func (o *teamResourceType) handleDeleteTeamAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { + l := ctxzap.Extract(ctx) + + // Extract the team resource ID using SDK helper + resourceID, err := actions.RequireResourceIDArg(args, "resource") + if err != nil { + return nil, nil, err + } + + // Extract the parent org resource ID using SDK helper + parentResourceID, err := actions.RequireResourceIDArg(args, "parent") + if err != nil { + return nil, nil, err + } + + // Parse the team ID from the resource + teamID, err := strconv.ParseInt(resourceID.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid team ID %s: %w", resourceID.Resource, err) + } + + // Parse the org ID from the parent resource + orgID, err := strconv.ParseInt(parentResourceID.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid org ID %s: %w", parentResourceID.Resource, err) + } + + l.Info("github-connector: deleting team via action", + zap.Int64("team_id", teamID), + zap.Int64("org_id", orgID), + ) + + // Delete the team directly using the provided org ID from parent + resp, err := o.client.Teams.DeleteTeamByID(ctx, orgID, teamID) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to delete team %d in org %d", teamID, orgID)) + } + + var annos annotations.Annotations + if rateLimitData, err := extractRateLimitData(resp); err == nil { + annos.WithRateLimiting(rateLimitData) + } + + l.Info("github-connector: team deleted successfully via action", + zap.Int64("team_id", teamID), + zap.Int64("org_id", orgID), + ) + + return actions.NewReturnValues(true), annos, nil +} + func teamBuilder(client *github.Client, orgCache *orgNameCache) *teamResourceType { return &teamResourceType{ resourceType: resourceTypeTeam, From adfd51d44a5608cace08d111a5d8f60d3d182dde Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Thu, 4 Dec 2025 18:22:48 +0000 Subject: [PATCH 02/22] rm: resource manager funcs --- pkg/connector/team.go | 190 ------------------------------------------ 1 file changed, 190 deletions(-) diff --git a/pkg/connector/team.go b/pkg/connector/team.go index a55d014a..32bbc995 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -365,196 +365,6 @@ func (o *teamResourceType) Revoke(ctx context.Context, grant *v2.Grant) (annotat return nil, nil } -// Create creates a new team in a GitHub organization. -// The resource must have a parent resource ID that references the organization. -// The team name is taken from the resource's DisplayName field. -// Optional profile fields: -// - description: string - Team description -// - privacy: string - "secret" or "closed" (default: "secret") -// - parent_team_id: int64 - ID of the parent team for nested teams -func (o *teamResourceType) Create(ctx context.Context, resource *v2.Resource) (*v2.Resource, annotations.Annotations, error) { - l := ctxzap.Extract(ctx) - - if resource == nil { - return nil, nil, fmt.Errorf("github-connector: resource cannot be nil") - } - - if resource.Id == nil || resource.Id.ResourceType != resourceTypeTeam.Id { - return nil, nil, fmt.Errorf("github-connector: invalid resource type for team creation") - } - - // Get the parent org resource ID - parentResourceID := resource.GetParentResourceId() - if parentResourceID == nil { - return nil, nil, fmt.Errorf("github-connector: parent organization resource ID is required to create a team") - } - - if parentResourceID.ResourceType != resourceTypeOrg.Id { - return nil, nil, fmt.Errorf("github-connector: parent resource must be an organization, got %s", parentResourceID.ResourceType) - } - - // Get the organization name - orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) - if err != nil { - return nil, nil, fmt.Errorf("github-connector: failed to get organization name: %w", err) - } - - // Get team name from display name - teamName := resource.GetDisplayName() - if teamName == "" { - return nil, nil, fmt.Errorf("github-connector: team name (DisplayName) is required") - } - - l.Info("github-connector: creating team", - zap.String("team_name", teamName), - zap.String("org_name", orgName), - ) - - // Build the NewTeam request - newTeam := github.NewTeam{ - Name: teamName, - } - - // Extract optional fields from the group trait profile if available - groupTrait, err := rType.GetGroupTrait(resource) - if err == nil && groupTrait != nil && groupTrait.Profile != nil { - // Get description if provided - if description, ok := rType.GetProfileStringValue(groupTrait.Profile, "description"); ok && description != "" { - newTeam.Description = github.Ptr(description) - } - - // Get privacy setting if provided ("secret" or "closed") - if privacy, ok := rType.GetProfileStringValue(groupTrait.Profile, "privacy"); ok && privacy != "" { - if privacy == "secret" || privacy == "closed" { - newTeam.Privacy = github.Ptr(privacy) - } else { - l.Warn("github-connector: invalid privacy value, using default", - zap.String("provided_privacy", privacy), - ) - } - } - - // Get parent team ID if provided (for nested teams) - if parentTeamID, ok := rType.GetProfileInt64Value(groupTrait.Profile, "parent_team_id"); ok && parentTeamID > 0 { - newTeam.ParentTeamID = github.Ptr(parentTeamID) - } - } - - // Create the team via GitHub API - createdTeam, resp, err := o.client.Teams.CreateTeam(ctx, orgName, newTeam) - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("github-connector: failed to create team %s in org %s", teamName, orgName)) - } - - // Extract rate limit data for annotations - var annos annotations.Annotations - if rateLimitData, err := extractRateLimitData(resp); err == nil { - annos.WithRateLimiting(rateLimitData) - } - - l.Info("github-connector: team created successfully", - zap.String("team_name", createdTeam.GetName()), - zap.Int64("team_id", createdTeam.GetID()), - zap.String("team_slug", createdTeam.GetSlug()), - ) - - // Create the resource representation of the newly created team - createdResource, err := teamResource(createdTeam, parentResourceID) - if err != nil { - return nil, annos, fmt.Errorf("github-connector: failed to create resource representation for team: %w", err) - } - - return createdResource, annos, nil -} - -// Delete deletes a team from a GitHub organization. -// The team is identified by its resource ID which contains the GitHub team ID. -func (o *teamResourceType) Delete(ctx context.Context, resourceId *v2.ResourceId) (annotations.Annotations, error) { - l := ctxzap.Extract(ctx) - - if resourceId == nil { - return nil, fmt.Errorf("github-connector: resource ID cannot be nil") - } - - if resourceId.ResourceType != resourceTypeTeam.Id { - return nil, fmt.Errorf("github-connector: invalid resource type %s, expected %s", resourceId.ResourceType, resourceTypeTeam.Id) - } - - // Parse the team ID from the resource - teamID, err := strconv.ParseInt(resourceId.GetResource(), 10, 64) - if err != nil { - return nil, fmt.Errorf("github-connector: invalid team ID %s: %w", resourceId.GetResource(), err) - } - - l.Info("github-connector: deleting team", - zap.Int64("team_id", teamID), - ) - - // We need to find the org that this team belongs to. - // We'll iterate through the organizations in the org cache. - var annos annotations.Annotations - var deleted bool - var lastErr error - var lastResp *github.Response - - // Use the org cache to get the list of organizations - // We need to iterate through the configured organizations - o.orgCache.RLock() - orgIDs := make([]string, 0, len(o.orgCache.orgNames)) - for orgID := range o.orgCache.orgNames { - orgIDs = append(orgIDs, orgID) - } - o.orgCache.RUnlock() - - for _, orgID := range orgIDs { - orgIDInt, err := strconv.ParseInt(orgID, 10, 64) - if err != nil { - continue - } - - // Try to get the team first to verify it exists in this org - _, resp, err := o.client.Teams.GetTeamByID(ctx, orgIDInt, teamID) - if err != nil { - // Team doesn't exist in this org, continue to next - if isNotFoundError(resp) { - continue - } - lastErr = err - lastResp = resp - continue - } - - // Team found in this org, delete it - resp, err = o.client.Teams.DeleteTeamByID(ctx, orgIDInt, teamID) - if err != nil { - lastErr = err - lastResp = resp - continue - } - - // Successfully deleted - deleted = true - if rateLimitData, err := extractRateLimitData(resp); err == nil { - annos.WithRateLimiting(rateLimitData) - } - - l.Info("github-connector: team deleted successfully", - zap.Int64("team_id", teamID), - zap.Int64("org_id", orgIDInt), - ) - break - } - - if !deleted { - if lastErr != nil { - return annos, wrapGitHubError(lastErr, lastResp, fmt.Sprintf("github-connector: failed to delete team %d", teamID)) - } - return annos, fmt.Errorf("github-connector: team %d not found in any accessible organization", teamID) - } - - return annos, nil -} - // ResourceActions registers the resource actions for the team resource type. // This implements the ResourceActionProvider interface. func (o *teamResourceType) ResourceActions(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { From edeaaca69bf82345fdc803563409c14f007b70e3 Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Fri, 5 Dec 2025 01:00:05 +0000 Subject: [PATCH 03/22] feat: add create / delete repository action --- pkg/connector/repository.go | 363 ++++++++++++++++++++++++++++++++++++ 1 file changed, 363 insertions(+) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index 550acd4d..179cd9b0 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -7,7 +7,9 @@ import ( "strconv" "strings" + config "github.com/conductorone/baton-sdk/pb/c1/config/v1" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + "github.com/conductorone/baton-sdk/pkg/actions" "github.com/conductorone/baton-sdk/pkg/annotations" "github.com/conductorone/baton-sdk/pkg/pagination" "github.com/conductorone/baton-sdk/pkg/types/entitlement" @@ -18,6 +20,7 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.uber.org/zap" "google.golang.org/grpc/codes" + "google.golang.org/protobuf/types/known/structpb" ) // outside collaborators are given one of these roles too. @@ -433,3 +436,363 @@ func skipGrantsForResourceType(bag *pagination.Bag) (string, error) { } return pageToken, nil } + +// ResourceActions registers the resource actions for the repository resource type. +// This implements the ResourceActionProvider interface. +func (o *repositoryResourceType) ResourceActions(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { + if err := o.registerCreateRepositoryAction(ctx, registry); err != nil { + return err + } + if err := o.registerDeleteRepositoryAction(ctx, registry); err != nil { + return err + } + return nil +} + +func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { + return registry.Register(ctx, &v2.ResourceActionSchema{ + Name: "create", + DisplayName: "Create Repository", + Description: "Create a new repository in a GitHub organization", + ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_CREATE}, + Arguments: []*config.Field{ + { + Name: "name", + DisplayName: "Repository Name", + Description: "The name of the repository to create", + Field: &config.Field_StringField{}, + IsRequired: true, + }, + { + Name: "parent", + DisplayName: "Parent Organization", + Description: "The organization to create the repository in", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + { + Name: "description", + DisplayName: "Description", + Description: "A description of the repository", + Field: &config.Field_StringField{}, + }, + { + Name: "private", + DisplayName: "Private", + Description: "Whether the repository should be private (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "visibility", + DisplayName: "Visibility", + Description: "The visibility level: 'public', 'private', or 'internal'", + Field: &config.Field_StringField{}, + }, + { + Name: "has_issues", + DisplayName: "Has Issues", + Description: "Enable issues for this repository (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "has_projects", + DisplayName: "Has Projects", + Description: "Enable projects for this repository (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "has_wiki", + DisplayName: "Has Wiki", + Description: "Enable wiki for this repository (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "has_discussions", + DisplayName: "Has Discussions", + Description: "Enable discussions for this repository (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "auto_init", + DisplayName: "Auto Initialize", + Description: "Create an initial commit with empty README (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "gitignore_template", + DisplayName: "Gitignore Template", + Description: "Gitignore template to apply (e.g., 'Go', 'Python', 'Node')", + Field: &config.Field_StringField{}, + }, + { + Name: "license_template", + DisplayName: "License Template", + Description: "License template to apply (e.g., 'mit', 'apache-2.0', 'gpl-3.0')", + Field: &config.Field_StringField{}, + }, + { + Name: "allow_squash_merge", + DisplayName: "Allow Squash Merge", + Description: "Allow squash-merging pull requests (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "allow_merge_commit", + DisplayName: "Allow Merge Commit", + Description: "Allow merging pull requests with a merge commit (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "allow_rebase_merge", + DisplayName: "Allow Rebase Merge", + Description: "Allow rebase-merging pull requests (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "allow_auto_merge", + DisplayName: "Allow Auto Merge", + Description: "Allow auto-merge on pull requests (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "delete_branch_on_merge", + DisplayName: "Delete Branch on Merge", + Description: "Automatically delete head branches after pull requests are merged (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "is_template", + DisplayName: "Is Template", + Description: "Make this repository available as a template (true/false)", + Field: &config.Field_BoolField{}, + }, + }, + ReturnTypes: []*config.Field{ + {Name: "success", Field: &config.Field_BoolField{}}, + {Name: "resource", Field: &config.Field_ResourceField{}}, + }, + }, o.handleCreateRepositoryAction) +} + +func (o *repositoryResourceType) registerDeleteRepositoryAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { + return registry.Register(ctx, &v2.ResourceActionSchema{ + Name: "delete", + DisplayName: "Delete Repository", + Description: "Delete a repository from a GitHub organization", + ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_DELETE}, + Arguments: []*config.Field{ + { + Name: "resource", + DisplayName: "Repository Resource", + Description: "The repository resource to delete", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + { + Name: "parent", + DisplayName: "Parent Organization", + Description: "The organization the repository belongs to", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + }, + ReturnTypes: []*config.Field{ + {Name: "success", Field: &config.Field_BoolField{}}, + }, + }, o.handleDeleteRepositoryAction) +} + +func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { + l := ctxzap.Extract(ctx) + + // Extract required arguments using SDK helpers + name, err := actions.RequireStringArg(args, "name") + if err != nil { + return nil, nil, err + } + + parentResourceID, err := actions.RequireResourceIDArg(args, "parent") + if err != nil { + return nil, nil, err + } + + // Get the organization name from the parent resource ID + orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) + if err != nil { + return nil, nil, fmt.Errorf("failed to get organization name: %w", err) + } + + l.Info("github-connector: creating repository via action", + zap.String("repo_name", name), + zap.String("org_name", orgName), + ) + + // Build the Repository request + newRepo := &github.Repository{ + Name: github.Ptr(name), + } + + // Extract optional fields using SDK helpers + if description, ok := actions.GetStringArg(args, "description"); ok && description != "" { + newRepo.Description = github.Ptr(description) + } + + if private, ok := actions.GetBoolArg(args, "private"); ok { + newRepo.Private = github.Ptr(private) + } + + if visibility, ok := actions.GetStringArg(args, "visibility"); ok && visibility != "" { + if visibility == "public" || visibility == "private" || visibility == "internal" { + newRepo.Visibility = github.Ptr(visibility) + } else { + l.Warn("github-connector: invalid visibility value, using default", + zap.String("provided_visibility", visibility), + ) + } + } + + if hasIssues, ok := actions.GetBoolArg(args, "has_issues"); ok { + newRepo.HasIssues = github.Ptr(hasIssues) + } + + if hasProjects, ok := actions.GetBoolArg(args, "has_projects"); ok { + newRepo.HasProjects = github.Ptr(hasProjects) + } + + if hasWiki, ok := actions.GetBoolArg(args, "has_wiki"); ok { + newRepo.HasWiki = github.Ptr(hasWiki) + } + + if hasDiscussions, ok := actions.GetBoolArg(args, "has_discussions"); ok { + newRepo.HasDiscussions = github.Ptr(hasDiscussions) + } + + if autoInit, ok := actions.GetBoolArg(args, "auto_init"); ok { + newRepo.AutoInit = github.Ptr(autoInit) + } + + if gitignoreTemplate, ok := actions.GetStringArg(args, "gitignore_template"); ok && gitignoreTemplate != "" { + newRepo.GitignoreTemplate = github.Ptr(gitignoreTemplate) + } + + if licenseTemplate, ok := actions.GetStringArg(args, "license_template"); ok && licenseTemplate != "" { + newRepo.LicenseTemplate = github.Ptr(licenseTemplate) + } + + if allowSquashMerge, ok := actions.GetBoolArg(args, "allow_squash_merge"); ok { + newRepo.AllowSquashMerge = github.Ptr(allowSquashMerge) + } + + if allowMergeCommit, ok := actions.GetBoolArg(args, "allow_merge_commit"); ok { + newRepo.AllowMergeCommit = github.Ptr(allowMergeCommit) + } + + if allowRebaseMerge, ok := actions.GetBoolArg(args, "allow_rebase_merge"); ok { + newRepo.AllowRebaseMerge = github.Ptr(allowRebaseMerge) + } + + if allowAutoMerge, ok := actions.GetBoolArg(args, "allow_auto_merge"); ok { + newRepo.AllowAutoMerge = github.Ptr(allowAutoMerge) + } + + if deleteBranchOnMerge, ok := actions.GetBoolArg(args, "delete_branch_on_merge"); ok { + newRepo.DeleteBranchOnMerge = github.Ptr(deleteBranchOnMerge) + } + + if isTemplate, ok := actions.GetBoolArg(args, "is_template"); ok { + newRepo.IsTemplate = github.Ptr(isTemplate) + } + + // Create the repository via GitHub API + createdRepo, resp, err := o.client.Repositories.Create(ctx, orgName, newRepo) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to create repository %s in org %s", name, orgName)) + } + + // Extract rate limit data for annotations + var annos annotations.Annotations + if rateLimitData, err := extractRateLimitData(resp); err == nil { + annos.WithRateLimiting(rateLimitData) + } + + l.Info("github-connector: repository created successfully via action", + zap.String("repo_name", createdRepo.GetName()), + zap.Int64("repo_id", createdRepo.GetID()), + zap.String("repo_full_name", createdRepo.GetFullName()), + ) + + // Create the resource representation of the newly created repository + repoResource, err := repositoryResource(ctx, createdRepo, parentResourceID) + if err != nil { + return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) + } + + // Build return values using SDK helpers + resourceRv, err := actions.NewResourceReturnField("resource", repoResource) + if err != nil { + return nil, annos, err + } + + return actions.NewReturnValues(true, resourceRv), annos, nil +} + +func (o *repositoryResourceType) handleDeleteRepositoryAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { + l := ctxzap.Extract(ctx) + + // Extract the repository resource ID using SDK helper + resourceID, err := actions.RequireResourceIDArg(args, "resource") + if err != nil { + return nil, nil, err + } + + // Extract the parent org resource ID using SDK helper + parentResourceID, err := actions.RequireResourceIDArg(args, "parent") + if err != nil { + return nil, nil, err + } + + // Parse the repo ID from the resource + repoID, err := strconv.ParseInt(resourceID.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid repository ID %s: %w", resourceID.Resource, err) + } + + // Get the organization name from the parent resource ID + orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) + if err != nil { + return nil, nil, fmt.Errorf("failed to get organization name: %w", err) + } + + // First, get the repository to find its name (needed for deletion) + repo, resp, err := o.client.Repositories.GetByID(ctx, repoID) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get repository %d", repoID)) + } + + repoName := repo.GetName() + + l.Info("github-connector: deleting repository via action", + zap.Int64("repo_id", repoID), + zap.String("repo_name", repoName), + zap.String("org_name", orgName), + ) + + // Delete the repository via GitHub API + resp, err = o.client.Repositories.Delete(ctx, orgName, repoName) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to delete repository %s in org %s", repoName, orgName)) + } + + var annos annotations.Annotations + if rateLimitData, err := extractRateLimitData(resp); err == nil { + annos.WithRateLimiting(rateLimitData) + } + + l.Info("github-connector: repository deleted successfully via action", + zap.Int64("repo_id", repoID), + zap.String("repo_name", repoName), + zap.String("org_name", orgName), + ) + + return actions.NewReturnValues(true), annos, nil +} From fe14b94e0f75b4b33b72f8711af857a201e816db Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Mon, 8 Dec 2025 21:57:45 +0000 Subject: [PATCH 04/22] add: update groups --- pkg/connector/repository.go | 376 +++++++++++++++++++++++++++++++++++- pkg/connector/team.go | 245 ++++++++++++++++++++++- 2 files changed, 606 insertions(+), 15 deletions(-) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index 179cd9b0..199f3aff 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -443,6 +443,9 @@ func (o *repositoryResourceType) ResourceActions(ctx context.Context, registry a if err := o.registerCreateRepositoryAction(ctx, registry); err != nil { return err } + if err := o.registerUpdateRepositoryAction(ctx, registry); err != nil { + return err + } if err := o.registerDeleteRepositoryAction(ctx, registry); err != nil { return err } @@ -450,7 +453,7 @@ func (o *repositoryResourceType) ResourceActions(ctx context.Context, registry a } func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { - return registry.Register(ctx, &v2.ResourceActionSchema{ + return registry.Register(ctx, &v2.BatonActionSchema{ Name: "create", DisplayName: "Create Repository", Description: "Create a new repository in a GitHub organization", @@ -485,8 +488,16 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont { Name: "visibility", DisplayName: "Visibility", - Description: "The visibility level: 'public', 'private', or 'internal'", - Field: &config.Field_StringField{}, + Description: "The visibility level of the repository", + Field: &config.Field_StringField{ + StringField: &config.StringField{ + Options: []*config.StringFieldOption{ + {Value: "public", DisplayName: "Public"}, + {Value: "private", DisplayName: "Private"}, + {Value: "internal", DisplayName: "Internal (Enterprise only)"}, + }, + }, + }, }, { Name: "has_issues", @@ -521,14 +532,48 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont { Name: "gitignore_template", DisplayName: "Gitignore Template", - Description: "Gitignore template to apply (e.g., 'Go', 'Python', 'Node')", - Field: &config.Field_StringField{}, + Description: "Gitignore template to apply", + Field: &config.Field_StringField{ + StringField: &config.StringField{ + Options: []*config.StringFieldOption{ + {Value: "", DisplayName: "None"}, + {Value: "Go", DisplayName: "Go"}, + {Value: "Python", DisplayName: "Python"}, + {Value: "Node", DisplayName: "Node"}, + {Value: "Java", DisplayName: "Java"}, + {Value: "Ruby", DisplayName: "Ruby"}, + {Value: "Rust", DisplayName: "Rust"}, + {Value: "C++", DisplayName: "C++"}, + {Value: "C", DisplayName: "C"}, + {Value: "Swift", DisplayName: "Swift"}, + {Value: "Kotlin", DisplayName: "Kotlin"}, + {Value: "Scala", DisplayName: "Scala"}, + {Value: "Terraform", DisplayName: "Terraform"}, + }, + }, + }, }, { Name: "license_template", DisplayName: "License Template", - Description: "License template to apply (e.g., 'mit', 'apache-2.0', 'gpl-3.0')", - Field: &config.Field_StringField{}, + Description: "License template to apply", + Field: &config.Field_StringField{ + StringField: &config.StringField{ + Options: []*config.StringFieldOption{ + {Value: "", DisplayName: "None"}, + {Value: "mit", DisplayName: "MIT License"}, + {Value: "apache-2.0", DisplayName: "Apache License 2.0"}, + {Value: "gpl-3.0", DisplayName: "GNU GPLv3"}, + {Value: "gpl-2.0", DisplayName: "GNU GPLv2"}, + {Value: "lgpl-3.0", DisplayName: "GNU LGPLv3"}, + {Value: "bsd-3-clause", DisplayName: "BSD 3-Clause"}, + {Value: "bsd-2-clause", DisplayName: "BSD 2-Clause"}, + {Value: "mpl-2.0", DisplayName: "Mozilla Public License 2.0"}, + {Value: "unlicense", DisplayName: "The Unlicense"}, + {Value: "agpl-3.0", DisplayName: "GNU AGPLv3"}, + }, + }, + }, }, { Name: "allow_squash_merge", @@ -575,7 +620,7 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont } func (o *repositoryResourceType) registerDeleteRepositoryAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { - return registry.Register(ctx, &v2.ResourceActionSchema{ + return registry.Register(ctx, &v2.BatonActionSchema{ Name: "delete", DisplayName: "Delete Repository", Description: "Delete a repository from a GitHub organization", @@ -602,6 +647,145 @@ func (o *repositoryResourceType) registerDeleteRepositoryAction(ctx context.Cont }, o.handleDeleteRepositoryAction) } +func (o *repositoryResourceType) registerUpdateRepositoryAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { + return registry.Register(ctx, &v2.BatonActionSchema{ + Name: "update", + DisplayName: "Update Repository", + Description: "Update an existing repository in a GitHub organization", + ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_MUTATE}, + Arguments: []*config.Field{ + { + Name: "resource", + DisplayName: "Repository Resource", + Description: "The repository resource to update", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + { + Name: "parent", + DisplayName: "Parent Organization", + Description: "The organization the repository belongs to", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + { + Name: "name", + DisplayName: "Repository Name", + Description: "The new name of the repository (leave empty to keep current)", + Field: &config.Field_StringField{}, + }, + { + Name: "description", + DisplayName: "Description", + Description: "A description of the repository", + Field: &config.Field_StringField{}, + }, + { + Name: "homepage", + DisplayName: "Homepage", + Description: "A URL with more information about the repository", + Field: &config.Field_StringField{}, + }, + { + Name: "private", + DisplayName: "Private", + Description: "Whether the repository should be private (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "visibility", + DisplayName: "Visibility", + Description: "The visibility level of the repository", + Field: &config.Field_StringField{ + StringField: &config.StringField{ + Options: []*config.StringFieldOption{ + {Value: "public", DisplayName: "Public"}, + {Value: "private", DisplayName: "Private"}, + {Value: "internal", DisplayName: "Internal (Enterprise only)"}, + }, + }, + }, + }, + { + Name: "has_issues", + DisplayName: "Has Issues", + Description: "Enable issues for this repository (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "has_projects", + DisplayName: "Has Projects", + Description: "Enable projects for this repository (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "has_wiki", + DisplayName: "Has Wiki", + Description: "Enable wiki for this repository (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "has_discussions", + DisplayName: "Has Discussions", + Description: "Enable discussions for this repository (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "default_branch", + DisplayName: "Default Branch", + Description: "The default branch of the repository", + Field: &config.Field_StringField{}, + }, + { + Name: "allow_squash_merge", + DisplayName: "Allow Squash Merge", + Description: "Allow squash-merging pull requests (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "allow_merge_commit", + DisplayName: "Allow Merge Commit", + Description: "Allow merging pull requests with a merge commit (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "allow_rebase_merge", + DisplayName: "Allow Rebase Merge", + Description: "Allow rebase-merging pull requests (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "allow_auto_merge", + DisplayName: "Allow Auto Merge", + Description: "Allow auto-merge on pull requests (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "delete_branch_on_merge", + DisplayName: "Delete Branch on Merge", + Description: "Automatically delete head branches after pull requests are merged (true/false)", + Field: &config.Field_BoolField{}, + }, + { + Name: "archived", + DisplayName: "Archived", + Description: "Archive the repository (true/false). Note: You cannot unarchive repositories through the API", + Field: &config.Field_BoolField{}, + }, + { + Name: "is_template", + DisplayName: "Is Template", + Description: "Make this repository available as a template (true/false)", + Field: &config.Field_BoolField{}, + }, + }, + ReturnTypes: []*config.Field{ + {Name: "success", Field: &config.Field_BoolField{}}, + {Name: "resource", Field: &config.Field_ResourceField{}}, + }, + }, o.handleUpdateRepositoryAction) +} + func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { l := ctxzap.Extract(ctx) @@ -796,3 +980,179 @@ func (o *repositoryResourceType) handleDeleteRepositoryAction(ctx context.Contex return actions.NewReturnValues(true), annos, nil } + +func (o *repositoryResourceType) handleUpdateRepositoryAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { + l := ctxzap.Extract(ctx) + + // Extract the repository resource ID using SDK helper + resourceID, err := actions.RequireResourceIDArg(args, "resource") + if err != nil { + return nil, nil, err + } + + // Extract the parent org resource ID using SDK helper + parentResourceID, err := actions.RequireResourceIDArg(args, "parent") + if err != nil { + return nil, nil, err + } + + // Parse the repo ID from the resource + repoID, err := strconv.ParseInt(resourceID.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid repository ID %s: %w", resourceID.Resource, err) + } + + // Get the organization name from the parent resource ID + orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) + if err != nil { + return nil, nil, fmt.Errorf("failed to get organization name: %w", err) + } + + // First, get the current repository to find its name + repo, resp, err := o.client.Repositories.GetByID(ctx, repoID) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get repository %d", repoID)) + } + + currentRepoName := repo.GetName() + + l.Info("github-connector: updating repository via action", + zap.Int64("repo_id", repoID), + zap.String("repo_name", currentRepoName), + zap.String("org_name", orgName), + ) + + // Build the Repository update request + updateRepo := &github.Repository{} + + // Track if any updates were provided + hasUpdates := false + + // Extract optional fields using SDK helpers + if name, ok := actions.GetStringArg(args, "name"); ok && name != "" { + updateRepo.Name = github.Ptr(name) + hasUpdates = true + } + + if description, ok := actions.GetStringArg(args, "description"); ok { + updateRepo.Description = github.Ptr(description) + hasUpdates = true + } + + if homepage, ok := actions.GetStringArg(args, "homepage"); ok { + updateRepo.Homepage = github.Ptr(homepage) + hasUpdates = true + } + + if private, ok := actions.GetBoolArg(args, "private"); ok { + updateRepo.Private = github.Ptr(private) + hasUpdates = true + } + + if visibility, ok := actions.GetStringArg(args, "visibility"); ok && visibility != "" { + if visibility == "public" || visibility == "private" || visibility == "internal" { + updateRepo.Visibility = github.Ptr(visibility) + hasUpdates = true + } else { + l.Warn("github-connector: invalid visibility value, ignoring", + zap.String("provided_visibility", visibility), + ) + } + } + + if hasIssues, ok := actions.GetBoolArg(args, "has_issues"); ok { + updateRepo.HasIssues = github.Ptr(hasIssues) + hasUpdates = true + } + + if hasProjects, ok := actions.GetBoolArg(args, "has_projects"); ok { + updateRepo.HasProjects = github.Ptr(hasProjects) + hasUpdates = true + } + + if hasWiki, ok := actions.GetBoolArg(args, "has_wiki"); ok { + updateRepo.HasWiki = github.Ptr(hasWiki) + hasUpdates = true + } + + if hasDiscussions, ok := actions.GetBoolArg(args, "has_discussions"); ok { + updateRepo.HasDiscussions = github.Ptr(hasDiscussions) + hasUpdates = true + } + + if defaultBranch, ok := actions.GetStringArg(args, "default_branch"); ok && defaultBranch != "" { + updateRepo.DefaultBranch = github.Ptr(defaultBranch) + hasUpdates = true + } + + if allowSquashMerge, ok := actions.GetBoolArg(args, "allow_squash_merge"); ok { + updateRepo.AllowSquashMerge = github.Ptr(allowSquashMerge) + hasUpdates = true + } + + if allowMergeCommit, ok := actions.GetBoolArg(args, "allow_merge_commit"); ok { + updateRepo.AllowMergeCommit = github.Ptr(allowMergeCommit) + hasUpdates = true + } + + if allowRebaseMerge, ok := actions.GetBoolArg(args, "allow_rebase_merge"); ok { + updateRepo.AllowRebaseMerge = github.Ptr(allowRebaseMerge) + hasUpdates = true + } + + if allowAutoMerge, ok := actions.GetBoolArg(args, "allow_auto_merge"); ok { + updateRepo.AllowAutoMerge = github.Ptr(allowAutoMerge) + hasUpdates = true + } + + if deleteBranchOnMerge, ok := actions.GetBoolArg(args, "delete_branch_on_merge"); ok { + updateRepo.DeleteBranchOnMerge = github.Ptr(deleteBranchOnMerge) + hasUpdates = true + } + + if archived, ok := actions.GetBoolArg(args, "archived"); ok { + updateRepo.Archived = github.Ptr(archived) + hasUpdates = true + } + + if isTemplate, ok := actions.GetBoolArg(args, "is_template"); ok { + updateRepo.IsTemplate = github.Ptr(isTemplate) + hasUpdates = true + } + + if !hasUpdates { + return nil, nil, fmt.Errorf("no update fields provided") + } + + // Update the repository via GitHub API + updatedRepo, resp, err := o.client.Repositories.Edit(ctx, orgName, currentRepoName, updateRepo) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to update repository %s in org %s", currentRepoName, orgName)) + } + + // Extract rate limit data for annotations + var annos annotations.Annotations + if rateLimitData, err := extractRateLimitData(resp); err == nil { + annos.WithRateLimiting(rateLimitData) + } + + l.Info("github-connector: repository updated successfully via action", + zap.Int64("repo_id", updatedRepo.GetID()), + zap.String("repo_name", updatedRepo.GetName()), + zap.String("repo_full_name", updatedRepo.GetFullName()), + ) + + // Create the resource representation of the updated repository + repoResource, err := repositoryResource(ctx, updatedRepo, parentResourceID) + if err != nil { + return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) + } + + // Build return values using SDK helpers + resourceRv, err := actions.NewResourceReturnField("resource", repoResource) + if err != nil { + return nil, annos, err + } + + return actions.NewReturnValues(true, resourceRv), annos, nil +} diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 32bbc995..f315355a 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -371,6 +371,9 @@ func (o *teamResourceType) ResourceActions(ctx context.Context, registry actions if err := o.registerCreateTeamAction(ctx, registry); err != nil { return err } + if err := o.registerUpdateTeamAction(ctx, registry); err != nil { + return err + } if err := o.registerDeleteTeamAction(ctx, registry); err != nil { return err } @@ -378,7 +381,7 @@ func (o *teamResourceType) ResourceActions(ctx context.Context, registry actions } func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { - return registry.Register(ctx, &v2.ResourceActionSchema{ + return registry.Register(ctx, &v2.BatonActionSchema{ Name: "create", DisplayName: "Create Team", Description: "Create a new team in a GitHub organization", @@ -410,6 +413,19 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr Description: "The privacy level: 'secret' or 'closed'", Field: &config.Field_StringField{}, }, + { + Name: "notification_setting", + DisplayName: "Notification Setting", + Description: "The notification setting for the team", + Field: &config.Field_StringField{ + StringField: &config.StringField{ + Options: []*config.StringFieldOption{ + {Value: "notifications_enabled", DisplayName: "Enabled"}, + {Value: "notifications_disabled", DisplayName: "Disabled"}, + }, + }, + }, + }, }, ReturnTypes: []*config.Field{ {Name: "success", Field: &config.Field_BoolField{}}, @@ -419,7 +435,7 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr } func (o *teamResourceType) registerDeleteTeamAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { - return registry.Register(ctx, &v2.ResourceActionSchema{ + return registry.Register(ctx, &v2.BatonActionSchema{ Name: "delete", DisplayName: "Delete Team", Description: "Delete a team from a GitHub organization", @@ -446,6 +462,73 @@ func (o *teamResourceType) registerDeleteTeamAction(ctx context.Context, registr }, o.handleDeleteTeamAction) } +func (o *teamResourceType) registerUpdateTeamAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { + return registry.Register(ctx, &v2.BatonActionSchema{ + Name: "update", + DisplayName: "Update Team", + Description: "Update an existing team in a GitHub organization", + ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_MUTATE}, + Arguments: []*config.Field{ + { + Name: "resource", + DisplayName: "Team Resource", + Description: "The team resource to update", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + { + Name: "parent", + DisplayName: "Parent Organization", + Description: "The organization the team belongs to", + Field: &config.Field_ResourceIdField{}, + IsRequired: true, + }, + { + Name: "name", + DisplayName: "Team Name", + Description: "The new name of the team (leave empty to keep current)", + Field: &config.Field_StringField{}, + }, + { + Name: "description", + DisplayName: "Description", + Description: "A description of the team", + Field: &config.Field_StringField{}, + }, + { + Name: "privacy", + DisplayName: "Privacy", + Description: "The privacy level of the team", + Field: &config.Field_StringField{ + StringField: &config.StringField{ + Options: []*config.StringFieldOption{ + {Value: "secret", DisplayName: "Secret (only visible to org owners and team members)"}, + {Value: "closed", DisplayName: "Closed (visible to all org members)"}, + }, + }, + }, + }, + { + Name: "notification_setting", + DisplayName: "Notification Setting", + Description: "The notification setting for the team", + Field: &config.Field_StringField{ + StringField: &config.StringField{ + Options: []*config.StringFieldOption{ + {Value: "notifications_enabled", DisplayName: "Enabled"}, + {Value: "notifications_disabled", DisplayName: "Disabled"}, + }, + }, + }, + }, + }, + ReturnTypes: []*config.Field{ + {Name: "success", Field: &config.Field_BoolField{}}, + {Name: "resource", Field: &config.Field_ResourceField{}}, + }, + }, o.handleUpdateTeamAction) +} + func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { l := ctxzap.Extract(ctx) @@ -551,15 +634,30 @@ func (o *teamResourceType) handleDeleteTeamAction(ctx context.Context, args *str return nil, nil, fmt.Errorf("invalid org ID %s: %w", parentResourceID.Resource, err) } + // Get the organization name from the cache + orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) + if err != nil { + return nil, nil, fmt.Errorf("failed to get organization name: %w", err) + } + + // Get the team to find its slug + team, resp, err := o.client.Teams.GetTeamByID(ctx, orgID, teamID) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get team %d", teamID)) + } + + teamSlug := team.GetSlug() + l.Info("github-connector: deleting team via action", zap.Int64("team_id", teamID), - zap.Int64("org_id", orgID), + zap.String("team_slug", teamSlug), + zap.String("org_name", orgName), ) - // Delete the team directly using the provided org ID from parent - resp, err := o.client.Teams.DeleteTeamByID(ctx, orgID, teamID) + // Delete the team using slug + resp, err = o.client.Teams.DeleteTeamBySlug(ctx, orgName, teamSlug) if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to delete team %d in org %d", teamID, orgID)) + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to delete team %s in org %s", teamSlug, orgName)) } var annos annotations.Annotations @@ -569,12 +667,145 @@ func (o *teamResourceType) handleDeleteTeamAction(ctx context.Context, args *str l.Info("github-connector: team deleted successfully via action", zap.Int64("team_id", teamID), - zap.Int64("org_id", orgID), + zap.String("team_slug", teamSlug), + zap.String("org_name", orgName), ) return actions.NewReturnValues(true), annos, nil } +func (o *teamResourceType) handleUpdateTeamAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { + l := ctxzap.Extract(ctx) + + // Extract the team resource ID using SDK helper + resourceID, err := actions.RequireResourceIDArg(args, "resource") + if err != nil { + return nil, nil, err + } + + // Extract the parent org resource ID using SDK helper + parentResourceID, err := actions.RequireResourceIDArg(args, "parent") + if err != nil { + return nil, nil, err + } + + // Parse the team ID from the resource + teamID, err := strconv.ParseInt(resourceID.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid team ID %s: %w", resourceID.Resource, err) + } + + // Parse the org ID from the parent resource + orgID, err := strconv.ParseInt(parentResourceID.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid org ID %s: %w", parentResourceID.Resource, err) + } + + // Get the organization name from the cache + orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) + if err != nil { + return nil, nil, fmt.Errorf("failed to get organization name: %w", err) + } + + // Get the team to find its slug + team, resp, err := o.client.Teams.GetTeamByID(ctx, orgID, teamID) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get team %d", teamID)) + } + + teamSlug := team.GetSlug() + + l.Info("github-connector: updating team via action", + zap.Int64("team_id", teamID), + zap.String("team_slug", teamSlug), + zap.String("org_name", orgName), + ) + + // Build the NewTeam update request + // Note: GitHub API uses NewTeam for both create and edit operations + updateTeam := github.NewTeam{} + + // Track if any updates were provided + hasUpdates := false + + // Extract optional fields using SDK helpers + if name, ok := actions.GetStringArg(args, "name"); ok && name != "" { + updateTeam.Name = name + hasUpdates = true + } + + if description, ok := actions.GetStringArg(args, "description"); ok { + updateTeam.Description = github.Ptr(description) + hasUpdates = true + } + + if privacy, ok := actions.GetStringArg(args, "privacy"); ok && privacy != "" { + if privacy == "secret" || privacy == "closed" { + updateTeam.Privacy = github.Ptr(privacy) + hasUpdates = true + } else { + l.Warn("github-connector: invalid privacy value, ignoring", + zap.String("provided_privacy", privacy), + ) + } + } + + if notificationSetting, ok := actions.GetStringArg(args, "notification_setting"); ok && notificationSetting != "" { + if notificationSetting == "notifications_enabled" || notificationSetting == "notifications_disabled" { + updateTeam.NotificationSetting = github.Ptr(notificationSetting) + hasUpdates = true + } else { + l.Warn("github-connector: invalid notification_setting value, ignoring", + zap.String("provided_notification_setting", notificationSetting), + ) + } + } + + if parentTeamID, ok := actions.GetIntArg(args, "parent_team_id"); ok { + if parentTeamID > 0 { + updateTeam.ParentTeamID = github.Ptr(parentTeamID) + hasUpdates = true + } + // Note: Setting to 0 would remove the parent, but GitHub API requires omitting the field entirely + } + + if !hasUpdates { + return nil, nil, fmt.Errorf("no update fields provided") + } + + // Update the team via GitHub API using slug + updatedTeam, resp, err := o.client.Teams.EditTeamBySlug(ctx, orgName, teamSlug, updateTeam, false) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to update team %s in org %s", teamSlug, orgName)) + } + + // Extract rate limit data for annotations + var annos annotations.Annotations + if rateLimitData, err := extractRateLimitData(resp); err == nil { + annos.WithRateLimiting(rateLimitData) + } + + l.Info("github-connector: team updated successfully via action", + zap.Int64("team_id", updatedTeam.GetID()), + zap.String("team_name", updatedTeam.GetName()), + zap.String("team_slug", updatedTeam.GetSlug()), + ) + + // Create the resource representation of the updated team + resource, err := teamResource(updatedTeam, parentResourceID) + if err != nil { + return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) + } + + // Build return values using SDK helpers + resourceRv, err := actions.NewResourceReturnField("resource", resource) + if err != nil { + return nil, annos, err + } + + return actions.NewReturnValues(true, resourceRv), annos, nil +} + func teamBuilder(client *github.Client, orgCache *orgNameCache) *teamResourceType { return &teamResourceType{ resourceType: resourceTypeTeam, From 45753df7ec31b65495ce41f01a41552ffefaabfb Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Thu, 11 Dec 2025 19:46:11 +0000 Subject: [PATCH 05/22] fix: deprecated action --- pkg/connector/repository.go | 8 ++++---- pkg/connector/team.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index 199f3aff..c0432824 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -439,7 +439,7 @@ func skipGrantsForResourceType(bag *pagination.Bag) (string, error) { // ResourceActions registers the resource actions for the repository resource type. // This implements the ResourceActionProvider interface. -func (o *repositoryResourceType) ResourceActions(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { +func (o *repositoryResourceType) ResourceActions(ctx context.Context, registry actions.ActionRegistry) error { if err := o.registerCreateRepositoryAction(ctx, registry); err != nil { return err } @@ -452,7 +452,7 @@ func (o *repositoryResourceType) ResourceActions(ctx context.Context, registry a return nil } -func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { +func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Context, registry actions.ActionRegistry) error { return registry.Register(ctx, &v2.BatonActionSchema{ Name: "create", DisplayName: "Create Repository", @@ -619,7 +619,7 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont }, o.handleCreateRepositoryAction) } -func (o *repositoryResourceType) registerDeleteRepositoryAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { +func (o *repositoryResourceType) registerDeleteRepositoryAction(ctx context.Context, registry actions.ActionRegistry) error { return registry.Register(ctx, &v2.BatonActionSchema{ Name: "delete", DisplayName: "Delete Repository", @@ -647,7 +647,7 @@ func (o *repositoryResourceType) registerDeleteRepositoryAction(ctx context.Cont }, o.handleDeleteRepositoryAction) } -func (o *repositoryResourceType) registerUpdateRepositoryAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { +func (o *repositoryResourceType) registerUpdateRepositoryAction(ctx context.Context, registry actions.ActionRegistry) error { return registry.Register(ctx, &v2.BatonActionSchema{ Name: "update", DisplayName: "Update Repository", diff --git a/pkg/connector/team.go b/pkg/connector/team.go index f315355a..37af7a94 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -367,7 +367,7 @@ func (o *teamResourceType) Revoke(ctx context.Context, grant *v2.Grant) (annotat // ResourceActions registers the resource actions for the team resource type. // This implements the ResourceActionProvider interface. -func (o *teamResourceType) ResourceActions(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { +func (o *teamResourceType) ResourceActions(ctx context.Context, registry actions.ActionRegistry) error { if err := o.registerCreateTeamAction(ctx, registry); err != nil { return err } @@ -380,7 +380,7 @@ func (o *teamResourceType) ResourceActions(ctx context.Context, registry actions return nil } -func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { +func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registry actions.ActionRegistry) error { return registry.Register(ctx, &v2.BatonActionSchema{ Name: "create", DisplayName: "Create Team", @@ -434,7 +434,7 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr }, o.handleCreateTeamAction) } -func (o *teamResourceType) registerDeleteTeamAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { +func (o *teamResourceType) registerDeleteTeamAction(ctx context.Context, registry actions.ActionRegistry) error { return registry.Register(ctx, &v2.BatonActionSchema{ Name: "delete", DisplayName: "Delete Team", @@ -462,7 +462,7 @@ func (o *teamResourceType) registerDeleteTeamAction(ctx context.Context, registr }, o.handleDeleteTeamAction) } -func (o *teamResourceType) registerUpdateTeamAction(ctx context.Context, registry actions.ResourceTypeActionRegistry) error { +func (o *teamResourceType) registerUpdateTeamAction(ctx context.Context, registry actions.ActionRegistry) error { return registry.Register(ctx, &v2.BatonActionSchema{ Name: "update", DisplayName: "Update Team", From 66d13309f9efe97082266e37fb5443442feeec5e Mon Sep 17 00:00:00 2001 From: Justin Gallardo Date: Tue, 30 Dec 2025 09:36:24 -0800 Subject: [PATCH 06/22] Bump baton-sdk to v0.6.9 --- go.mod | 65 +- go.sum | 156 ++-- pkg/config/conf.gen.go | 28 +- pkg/connector/repository.go | 2 +- pkg/connector/team.go | 2 +- .../baton-sdk/pb/c1/config/v1/config.pb.go | 711 ++--------------- .../pb/c1/config/v1/config.pb.validate.go | 725 ------------------ .../pb/c1/config/v1/config_protoopaque.pb.go | 713 ++--------------- .../baton-sdk/pb/c1/config/v1/rules.pb.go | 125 +-- .../pb/c1/config/v1/rules.pb.validate.go | 14 - .../pb/c1/config/v1/rules_protoopaque.pb.go | 126 +-- .../v2/annotation_security_insight.pb.go | 510 ++---------- ...annotation_security_insight.pb.validate.go | 564 +------------- ...otation_security_insight_protoopaque.pb.go | 499 ++---------- .../pb/c1/connector/v2/annotation_trait.pb.go | 396 ++-------- .../v2/annotation_trait_protoopaque.pb.go | 397 ++-------- .../pb/c1/connector/v2/connector.pb.go | 60 +- .../connector/v2/connector_protoopaque.pb.go | 60 +- .../pb/c1/connector/v2/entitlement.pb.go | 10 +- .../v2/entitlement_protoopaque.pb.go | 10 +- .../pb/c1/connector/v2/resource.pb.go | 85 +- .../connector/v2/resource_protoopaque.pb.go | 57 +- .../pb/c1/connectorapi/baton/v1/baton.pb.go | 694 +++++------------ .../baton/v1/baton_protoopaque.pb.go | 696 +++++------------ .../baton-sdk/pkg/actions/actions.go | 122 +-- .../baton-sdk/pkg/actions/args.go | 228 ------ .../conductorone/baton-sdk/pkg/cli/cli.go | 8 +- .../baton-sdk/pkg/cli/commands.go | 96 +-- .../baton-sdk/pkg/cli/lambda_server__added.go | 19 +- .../baton-sdk/pkg/config/config.go | 52 +- .../pkg/connectorbuilder/accounts.go | 63 +- .../baton-sdk/pkg/connectorbuilder/actions.go | 8 +- .../pkg/connectorbuilder/connectorbuilder.go | 24 +- .../pkg/connectorbuilder/credentials.go | 13 +- .../baton-sdk/pkg/connectorbuilder/events.go | 2 +- .../pkg/connectorbuilder/resource_manager.go | 25 +- .../connectorbuilder/resource_provisioner.go | 18 +- .../pkg/connectorbuilder/resource_syncer.go | 76 +- .../baton-sdk/pkg/connectorbuilder/tickets.go | 64 +- .../baton-sdk/pkg/connectorrunner/runner.go | 294 ++----- .../baton-sdk/pkg/dotc1z/c1file.go | 95 +-- .../baton-sdk/pkg/dotc1z/grants.go | 23 + .../baton-sdk/pkg/dotc1z/session_store.go | 6 +- .../baton-sdk/pkg/dotc1z/sql_helpers.go | 20 +- .../baton-sdk/pkg/dotc1z/sync_runs.go | 173 +---- .../pkg/field/default_relationships.go | 4 - .../baton-sdk/pkg/field/defaults.go | 30 - .../baton-sdk/pkg/provisioner/provisioner.go | 33 +- .../conductorone/baton-sdk/pkg/sdk/version.go | 2 +- .../conductorone/baton-sdk/pkg/sync/syncer.go | 131 +--- .../pkg/synccompactor/attached/attached.go | 104 +-- .../baton-sdk/pkg/synccompactor/compactor.go | 310 ++++---- .../pkg/tasks/c1api/create_account.go | 1 - .../baton-sdk/pkg/tasks/local/accounter.go | 26 +- .../conductorone/baton-sdk/pkg/tasks/tasks.go | 8 - .../pkg/types/entitlement/entitlement.go | 23 - .../baton-sdk/pkg/types/grant/grant.go | 3 +- .../baton-sdk/pkg/types/resource/resource.go | 56 +- .../pkg/types/resource/role_trait.go | 22 +- .../types/resource/security_insight_trait.go | 288 +++---- vendor/golang.org/x/sys/cpu/cpu.go | 3 + vendor/golang.org/x/sys/cpu/cpu_arm64.go | 20 +- vendor/golang.org/x/sys/cpu/cpu_arm64.s | 7 + vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 1 + .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 1 + .../golang.org/x/sys/cpu/cpu_netbsd_arm64.go | 2 +- .../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 2 +- vendor/modules.txt | 149 ++-- 68 files changed, 1760 insertions(+), 7600 deletions(-) diff --git a/go.mod b/go.mod index ff36477d..34ae51f5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/conductorone/baton-github go 1.25.2 require ( - github.com/conductorone/baton-sdk v0.7.14 + github.com/conductorone/baton-sdk v0.6.9 github.com/deckarep/golang-set/v2 v2.8.0 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/golang-jwt/jwt/v5 v5.2.2 @@ -13,11 +13,11 @@ require ( github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7 github.com/stretchr/testify v1.11.1 - go.uber.org/zap v1.27.1 - golang.org/x/oauth2 v0.32.0 - golang.org/x/text v0.31.0 - google.golang.org/grpc v1.78.0 - google.golang.org/protobuf v1.36.10 + go.uber.org/zap v1.27.0 + golang.org/x/oauth2 v0.29.0 + golang.org/x/text v0.24.0 + google.golang.org/grpc v1.71.1 + google.golang.org/protobuf v1.36.6 ) require ( @@ -25,7 +25,7 @@ require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/aws/aws-lambda-go v1.47.0 // indirect - github.com/aws/aws-sdk-go-v2 v1.41.0 // indirect + github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect github.com/aws/aws-sdk-go-v2/config v1.29.2 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.17.55 // indirect @@ -44,10 +44,9 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.24.12 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.11 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.33.10 // indirect - github.com/aws/smithy-go v1.24.0 // indirect + github.com/aws/smithy-go v1.22.2 // indirect github.com/benbjohnson/clock v1.3.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/conductorone/dpop v0.2.3 // indirect github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 // indirect github.com/conductorone/dpop/integrations/dpop_oauth2 v0.2.3 // indirect @@ -58,8 +57,8 @@ require ( github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/glebarez/go-sqlite v1.22.0 // indirect - github.com/go-jose/go-jose/v4 v4.1.3 // indirect - github.com/go-logr/logr v1.4.3 // indirect + github.com/go-jose/go-jose/v4 v4.0.5 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -67,7 +66,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jellydator/ttlcache/v3 v3.3.0 // indirect @@ -100,30 +99,30 @@ require ( github.com/tklauser/go-sysconf v0.3.16 // indirect github.com/tklauser/numcpus v0.11.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/bridges/otelzap v0.14.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.15.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 // indirect - go.opentelemetry.io/otel/log v0.15.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/sdk v1.39.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect - go.opentelemetry.io/proto/otlp v1.9.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/bridges/otelzap v0.10.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect + go.opentelemetry.io/otel v1.35.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect + go.opentelemetry.io/otel/log v0.11.0 // indirect + go.opentelemetry.io/otel/metric v1.35.0 // indirect + go.opentelemetry.io/otel/sdk v1.35.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.11.0 // indirect + go.opentelemetry.io/otel/trace v1.35.0 // indirect + go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect - golang.org/x/crypto v0.44.0 // indirect + golang.org/x/crypto v0.34.0 // indirect golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/sync v0.18.0 // indirect - golang.org/x/sys v0.39.0 // indirect - golang.org/x/term v0.37.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.38.0 // indirect + golang.org/x/term v0.33.0 // indirect golang.org/x/time v0.8.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index aeab47b7..65631f28 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1 github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI= github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A= -github.com/aws/aws-sdk-go-v2 v1.41.0 h1:tNvqh1s+v0vFYdA1xq0aOJH+Y5cRyZ5upu6roPgPKd4= -github.com/aws/aws-sdk-go-v2 v1.41.0/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0= +github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM= +github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 h1:zAybnyUQXIZ5mok5Jqwlf58/TFE7uvd3IAsa1aF9cXs= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10/go.mod h1:qqvMj6gHLR/EXWZw4ZbqlPbQUyenf4h82UQUlKc+l14= github.com/aws/aws-sdk-go-v2/config v1.29.2 h1:JuIxOEPcSKpMB0J+khMjznG9LIhIBdmqNiEcPclnwqc= @@ -50,20 +50,18 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.11 h1:mUwIpAvILeKFnRx4h1dEgGE github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.11/go.mod h1:JDJtD+b8HNVv71axz8+S5492KM8wTzHRFpMKQbPlYxw= github.com/aws/aws-sdk-go-v2/service/sts v1.33.10 h1:g9d+TOsu3ac7SgmY2dUf1qMgu/uJVTlQ4VCbH6hRxSw= github.com/aws/aws-sdk-go-v2/service/sts v1.33.10/go.mod h1:WZfNmntu92HO44MVZAubQaz3qCuIdeOdog2sADfU6hU= -github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= -github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= +github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ= +github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= -github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/conductorone/baton-sdk v0.7.14 h1:EwA4LgCOnxVCVfly4Jx2M9sAn9MI5VUYmNcguISudbE= -github.com/conductorone/baton-sdk v0.7.14/go.mod h1:agmFrml6APUw4ZlqMEBrnXYj3aAOGKOJ6gztiNj64h0= +github.com/conductorone/baton-sdk v0.6.9 h1:HckTc+QeoL/K4FAOrvrsTIDb65898ft/m2YIty/YBgk= +github.com/conductorone/baton-sdk v0.6.9/go.mod h1:9S5feBOuIJxlNdGmkv3ObkCNHbVyOHr6foNrIrk+d4Y= github.com/conductorone/dpop v0.2.3 h1:s91U3845GHQ6P6FWrdNr2SEOy1ES/jcFs1JtKSl2S+o= github.com/conductorone/dpop v0.2.3/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s= github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 h1:kLMCNIh0Mo2vbvvkCmJ3ixsPbXEJ6HPcW53Ku9yje3s= @@ -98,13 +96,13 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/ github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ= github.com/glebarez/go-sqlite v1.22.0/go.mod h1:PlBIdHe0+aUEFn+r2/uthrWq4FxbzugL0L8Li6yQJbc= -github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs= -github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= +github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE= +github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -147,8 +145,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -212,8 +210,8 @@ github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4l github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= -github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= @@ -262,40 +260,36 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= -go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/bridges/otelzap v0.14.0 h1:2nKw2ZXZOC0N8RBsBbYwGwfKR7kJWzzyCZ6QfUGW/es= -go.opentelemetry.io/contrib/bridges/otelzap v0.14.0/go.mod h1:kvyVt0WEI5BB6XaIStXPIkCSQ2nSkyd8IZnAHLEXge4= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.15.0 h1:W+m0g+/6v3pa5PgVf2xoFMi5YtNR06WtS7ve5pcvLtM= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.15.0/go.mod h1:JM31r0GGZ/GU94mX8hN4D8v6e40aFlUECSQ48HaLgHM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 h1:in9O8ESIOlwJAEGTkkf34DesGRAc/Pn8qJ7k3r/42LM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0/go.mod h1:Rp0EXBm5tfnv0WL+ARyO/PHBEaEAT8UUHQ6AGJcSq6c= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.39.0 h1:5gn2urDL/FBnK8OkCfD1j3/ER79rUuTYmCvlXBKeYL8= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.39.0/go.mod h1:0fBG6ZJxhqByfFZDwSwpZGzJU671HkwpWaNe2t4VUPI= -go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= -go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= -go.opentelemetry.io/otel/log/logtest v0.15.0 h1:porNFuxAjodl6LhePevOc3n7bo3Wi3JhGXNWe7KP8iU= -go.opentelemetry.io/otel/log/logtest v0.15.0/go.mod h1:c8epqBXGHgS1LiNgmD+LuNYK9lSS3mqvtMdxLsfJgLg= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= -go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= -go.opentelemetry.io/otel/sdk/log/logtest v0.14.0 h1:Ijbtz+JKXl8T2MngiwqBlPaHqc4YCaP/i13Qrow6gAM= -go.opentelemetry.io/otel/sdk/log/logtest v0.14.0/go.mod h1:dCU8aEL6q+L9cYTqcVOk8rM9Tp8WdnHOPLiBgp0SGOA= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= -go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= -go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/bridges/otelzap v0.10.0 h1:ojdSRDvjrnm30beHOmwsSvLpoRF40MlwNCA+Oo93kXU= +go.opentelemetry.io/contrib/bridges/otelzap v0.10.0/go.mod h1:oTTm4g7NEtHSV2i/0FeVdPaPgUIZPfQkFbq0vbzqnv0= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 h1:rgMkmiGfix9vFJDcDi1PK8WEQP4FLQwLDfhp5ZLpFeE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4= +go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= +go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 h1:HMUytBT3uGhPKYY/u/G5MR9itrlSO2SMOsSD3Tk3k7A= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0/go.mod h1:hdDXsiNLmdW/9BF2jQpnHHlhFajpWCEYfM6e5m2OAZg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 h1:/jlt1Y8gXWiHG9FBx6cJaIC5hYx5Fe64nC8w5Cylt/0= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0/go.mod h1:bmToOGOBZ4hA9ghphIc1PAf66VA8KOtsuy3+ScStG20= +go.opentelemetry.io/otel/log v0.11.0 h1:c24Hrlk5WJ8JWcwbQxdBqxZdOK7PcP/LFtOtwpDTe3Y= +go.opentelemetry.io/otel/log v0.11.0/go.mod h1:U/sxQ83FPmT29trrifhQg+Zj2lo1/IPN1PF6RTFqdwc= +go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= +go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= +go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= +go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= +go.opentelemetry.io/otel/sdk/log v0.11.0 h1:7bAOpjpGglWhdEzP8z0VXc4jObOiDEwr3IYbhBnjk2c= +go.opentelemetry.io/otel/sdk/log v0.11.0/go.mod h1:dndLTxZbwBstZoqsJB3kGsRPkpAgaJrWfQg3lhlHFFY= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= +go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= +go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= +go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -308,15 +302,15 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0= go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= -go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU= -golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc= +golang.org/x/crypto v0.34.0 h1:+/C6tk6rf/+t5DhUketUbD1aNGqiSX3j15Z6xuIDlBA= +golang.org/x/crypto v0.34.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= @@ -328,8 +322,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= -golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= +golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= +golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -338,18 +332,18 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= -golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98= +golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= -golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -360,14 +354,14 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= -golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= -golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= +golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -379,32 +373,30 @@ golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= +golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= -google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= -google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= -google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= -google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI= +google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/pkg/config/conf.gen.go b/pkg/config/conf.gen.go index d6d0b78c..7b3c4536 100644 --- a/pkg/config/conf.gen.go +++ b/pkg/config/conf.gen.go @@ -1,17 +1,17 @@ // Code generated by baton-sdk. DO NOT EDIT!!! package config -import "reflect" +import "reflect" type Github struct { - Token string `mapstructure:"token"` - Orgs []string `mapstructure:"orgs"` - Enterprises []string `mapstructure:"enterprises"` - InstanceUrl string `mapstructure:"instance-url"` - SyncSecrets bool `mapstructure:"sync-secrets"` - OmitArchivedRepositories bool `mapstructure:"omit-archived-repositories"` - AppId string `mapstructure:"app-id"` - AppPrivatekeyPath string `mapstructure:"app-privatekey-path"` + Token string `mapstructure:"token"` + Orgs []string `mapstructure:"orgs"` + Enterprises []string `mapstructure:"enterprises"` + InstanceUrl string `mapstructure:"instance-url"` + SyncSecrets bool `mapstructure:"sync-secrets"` + OmitArchivedRepositories bool `mapstructure:"omit-archived-repositories"` + AppId string `mapstructure:"app-id"` + AppPrivatekeyPath string `mapstructure:"app-privatekey-path"` } func (c *Github) findFieldByTag(tagValue string) (any, bool) { @@ -46,11 +46,13 @@ func (c *Github) GetString(fieldName string) string { if !ok { return "" } - t, ok := v.(string) - if !ok { - panic("wrong type") + if t, ok := v.(string); ok { + return t } - return t + if t, ok := v.([]byte); ok { + return string(t) + } + panic("wrong type") } func (c *Github) GetInt(fieldName string) int { diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index c0432824..1e7cdb97 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -652,7 +652,7 @@ func (o *repositoryResourceType) registerUpdateRepositoryAction(ctx context.Cont Name: "update", DisplayName: "Update Repository", Description: "Update an existing repository in a GitHub organization", - ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_MUTATE}, + ActionType: []v2.ActionType{}, Arguments: []*config.Field{ { Name: "resource", diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 37af7a94..6fc420d2 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -467,7 +467,7 @@ func (o *teamResourceType) registerUpdateTeamAction(ctx context.Context, registr Name: "update", DisplayName: "Update Team", Description: "Update an existing team in a GitHub organization", - ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_MUTATE}, + ActionType: []v2.ActionType{}, Arguments: []*config.Field{ { Name: "resource", diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go index d563d18f..06945eed 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go @@ -566,8 +566,6 @@ type Field struct { // *Field_ResourceIdSliceField // *Field_ResourceField // *Field_ResourceSliceField - // *Field_EntitlementSliceField - // *Field_GrantSliceField Field isField_Field `protobuf_oneof:"field"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -735,24 +733,6 @@ func (x *Field) GetResourceSliceField() *ResourceSliceField { return nil } -func (x *Field) GetEntitlementSliceField() *EntitlementSliceField { - if x != nil { - if x, ok := x.Field.(*Field_EntitlementSliceField); ok { - return x.EntitlementSliceField - } - } - return nil -} - -func (x *Field) GetGrantSliceField() *GrantSliceField { - if x != nil { - if x, ok := x.Field.(*Field_GrantSliceField); ok { - return x.GrantSliceField - } - } - return nil -} - func (x *Field) SetName(v string) { x.Name = v } @@ -853,22 +833,6 @@ func (x *Field) SetResourceSliceField(v *ResourceSliceField) { x.Field = &Field_ResourceSliceField{v} } -func (x *Field) SetEntitlementSliceField(v *EntitlementSliceField) { - if v == nil { - x.Field = nil - return - } - x.Field = &Field_EntitlementSliceField{v} -} - -func (x *Field) SetGrantSliceField(v *GrantSliceField) { - if v == nil { - x.Field = nil - return - } - x.Field = &Field_GrantSliceField{v} -} - func (x *Field) HasField() bool { if x == nil { return false @@ -948,22 +912,6 @@ func (x *Field) HasResourceSliceField() bool { return ok } -func (x *Field) HasEntitlementSliceField() bool { - if x == nil { - return false - } - _, ok := x.Field.(*Field_EntitlementSliceField) - return ok -} - -func (x *Field) HasGrantSliceField() bool { - if x == nil { - return false - } - _, ok := x.Field.(*Field_GrantSliceField) - return ok -} - func (x *Field) ClearField() { x.Field = nil } @@ -1022,18 +970,6 @@ func (x *Field) ClearResourceSliceField() { } } -func (x *Field) ClearEntitlementSliceField() { - if _, ok := x.Field.(*Field_EntitlementSliceField); ok { - x.Field = nil - } -} - -func (x *Field) ClearGrantSliceField() { - if _, ok := x.Field.(*Field_GrantSliceField); ok { - x.Field = nil - } -} - const Field_Field_not_set_case case_Field_Field = 0 const Field_StringField_case case_Field_Field = 100 const Field_IntField_case case_Field_Field = 101 @@ -1044,8 +980,6 @@ const Field_ResourceIdField_case case_Field_Field = 105 const Field_ResourceIdSliceField_case case_Field_Field = 106 const Field_ResourceField_case case_Field_Field = 107 const Field_ResourceSliceField_case case_Field_Field = 108 -const Field_EntitlementSliceField_case case_Field_Field = 109 -const Field_GrantSliceField_case case_Field_Field = 110 func (x *Field) WhichField() case_Field_Field { if x == nil { @@ -1070,10 +1004,6 @@ func (x *Field) WhichField() case_Field_Field { return Field_ResourceField_case case *Field_ResourceSliceField: return Field_ResourceSliceField_case - case *Field_EntitlementSliceField: - return Field_EntitlementSliceField_case - case *Field_GrantSliceField: - return Field_GrantSliceField_case default: return Field_Field_not_set_case } @@ -1098,10 +1028,8 @@ type Field_builder struct { ResourceIdField *ResourceIdField ResourceIdSliceField *ResourceIdSliceField // These are meant to serve as return types for actions. - ResourceField *ResourceField - ResourceSliceField *ResourceSliceField - EntitlementSliceField *EntitlementSliceField - GrantSliceField *GrantSliceField + ResourceField *ResourceField + ResourceSliceField *ResourceSliceField // -- end of Field } @@ -1143,12 +1071,6 @@ func (b0 Field_builder) Build() *Field { if b.ResourceSliceField != nil { x.Field = &Field_ResourceSliceField{b.ResourceSliceField} } - if b.EntitlementSliceField != nil { - x.Field = &Field_EntitlementSliceField{b.EntitlementSliceField} - } - if b.GrantSliceField != nil { - x.Field = &Field_GrantSliceField{b.GrantSliceField} - } return m0 } @@ -1203,14 +1125,6 @@ type Field_ResourceSliceField struct { ResourceSliceField *ResourceSliceField `protobuf:"bytes,108,opt,name=resource_slice_field,json=resourceSliceField,proto3,oneof"` } -type Field_EntitlementSliceField struct { - EntitlementSliceField *EntitlementSliceField `protobuf:"bytes,109,opt,name=entitlement_slice_field,json=entitlementSliceField,proto3,oneof"` -} - -type Field_GrantSliceField struct { - GrantSliceField *GrantSliceField `protobuf:"bytes,110,opt,name=grant_slice_field,json=grantSliceField,proto3,oneof"` -} - func (*Field_StringField) isField_Field() {} func (*Field_IntField) isField_Field() {} @@ -1229,10 +1143,6 @@ func (*Field_ResourceField) isField_Field() {} func (*Field_ResourceSliceField) isField_Field() {} -func (*Field_EntitlementSliceField) isField_Field() {} - -func (*Field_GrantSliceField) isField_Field() {} - // These are partially duplicate with the Resource proto in the connector package. // This is to avoid import cycles type Resource struct { @@ -1566,442 +1476,6 @@ func (b0 ResourceSliceField_builder) Build() *ResourceSliceField { return m0 } -// Simplified Entitlement for config return types (avoids import cycles with connector package) -type Entitlement struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Slug string `protobuf:"bytes,4,opt,name=slug,proto3" json:"slug,omitempty"` - Purpose string `protobuf:"bytes,5,opt,name=purpose,proto3" json:"purpose,omitempty"` // "PURPOSE_VALUE_ASSIGNMENT", "PURPOSE_VALUE_PERMISSION", or "PURPOSE_VALUE_OWNERSHIP" - GrantableToResourceTypeIds []string `protobuf:"bytes,6,rep,name=grantable_to_resource_type_ids,json=grantableToResourceTypeIds,proto3" json:"grantable_to_resource_type_ids,omitempty"` - ResourceId string `protobuf:"bytes,7,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` - ResourceTypeId string `protobuf:"bytes,8,opt,name=resource_type_id,json=resourceTypeId,proto3" json:"resource_type_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Entitlement) Reset() { - *x = Entitlement{} - mi := &file_c1_config_v1_config_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Entitlement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Entitlement) ProtoMessage() {} - -func (x *Entitlement) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Entitlement) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Entitlement) GetDisplayName() string { - if x != nil { - return x.DisplayName - } - return "" -} - -func (x *Entitlement) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Entitlement) GetSlug() string { - if x != nil { - return x.Slug - } - return "" -} - -func (x *Entitlement) GetPurpose() string { - if x != nil { - return x.Purpose - } - return "" -} - -func (x *Entitlement) GetGrantableToResourceTypeIds() []string { - if x != nil { - return x.GrantableToResourceTypeIds - } - return nil -} - -func (x *Entitlement) GetResourceId() string { - if x != nil { - return x.ResourceId - } - return "" -} - -func (x *Entitlement) GetResourceTypeId() string { - if x != nil { - return x.ResourceTypeId - } - return "" -} - -func (x *Entitlement) SetId(v string) { - x.Id = v -} - -func (x *Entitlement) SetDisplayName(v string) { - x.DisplayName = v -} - -func (x *Entitlement) SetDescription(v string) { - x.Description = v -} - -func (x *Entitlement) SetSlug(v string) { - x.Slug = v -} - -func (x *Entitlement) SetPurpose(v string) { - x.Purpose = v -} - -func (x *Entitlement) SetGrantableToResourceTypeIds(v []string) { - x.GrantableToResourceTypeIds = v -} - -func (x *Entitlement) SetResourceId(v string) { - x.ResourceId = v -} - -func (x *Entitlement) SetResourceTypeId(v string) { - x.ResourceTypeId = v -} - -type Entitlement_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id string - DisplayName string - Description string - Slug string - Purpose string - GrantableToResourceTypeIds []string - ResourceId string - ResourceTypeId string -} - -func (b0 Entitlement_builder) Build() *Entitlement { - m0 := &Entitlement{} - b, x := &b0, m0 - _, _ = b, x - x.Id = b.Id - x.DisplayName = b.DisplayName - x.Description = b.Description - x.Slug = b.Slug - x.Purpose = b.Purpose - x.GrantableToResourceTypeIds = b.GrantableToResourceTypeIds - x.ResourceId = b.ResourceId - x.ResourceTypeId = b.ResourceTypeId - return m0 -} - -type EntitlementSliceField struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - DefaultValue []*Entitlement `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EntitlementSliceField) Reset() { - *x = EntitlementSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EntitlementSliceField) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EntitlementSliceField) ProtoMessage() {} - -func (x *EntitlementSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *EntitlementSliceField) GetDefaultValue() []*Entitlement { - if x != nil { - return x.DefaultValue - } - return nil -} - -func (x *EntitlementSliceField) SetDefaultValue(v []*Entitlement) { - x.DefaultValue = v -} - -type EntitlementSliceField_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - DefaultValue []*Entitlement -} - -func (b0 EntitlementSliceField_builder) Build() *EntitlementSliceField { - m0 := &EntitlementSliceField{} - b, x := &b0, m0 - _, _ = b, x - x.DefaultValue = b.DefaultValue - return m0 -} - -// Reference to an entitlement (used in Grant) -type EntitlementRef struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EntitlementRef) Reset() { - *x = EntitlementRef{} - mi := &file_c1_config_v1_config_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EntitlementRef) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EntitlementRef) ProtoMessage() {} - -func (x *EntitlementRef) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *EntitlementRef) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EntitlementRef) SetId(v string) { - x.Id = v -} - -type EntitlementRef_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id string -} - -func (b0 EntitlementRef_builder) Build() *EntitlementRef { - m0 := &EntitlementRef{} - b, x := &b0, m0 - _, _ = b, x - x.Id = b.Id - return m0 -} - -// Simplified Grant for config return types (avoids import cycles with connector package) -type Grant struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Entitlement *EntitlementRef `protobuf:"bytes,2,opt,name=entitlement,proto3" json:"entitlement,omitempty"` - Principal *Resource `protobuf:"bytes,3,opt,name=principal,proto3" json:"principal,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Grant) Reset() { - *x = Grant{} - mi := &file_c1_config_v1_config_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Grant) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Grant) ProtoMessage() {} - -func (x *Grant) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Grant) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Grant) GetEntitlement() *EntitlementRef { - if x != nil { - return x.Entitlement - } - return nil -} - -func (x *Grant) GetPrincipal() *Resource { - if x != nil { - return x.Principal - } - return nil -} - -func (x *Grant) SetId(v string) { - x.Id = v -} - -func (x *Grant) SetEntitlement(v *EntitlementRef) { - x.Entitlement = v -} - -func (x *Grant) SetPrincipal(v *Resource) { - x.Principal = v -} - -func (x *Grant) HasEntitlement() bool { - if x == nil { - return false - } - return x.Entitlement != nil -} - -func (x *Grant) HasPrincipal() bool { - if x == nil { - return false - } - return x.Principal != nil -} - -func (x *Grant) ClearEntitlement() { - x.Entitlement = nil -} - -func (x *Grant) ClearPrincipal() { - x.Principal = nil -} - -type Grant_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id string - Entitlement *EntitlementRef - Principal *Resource -} - -func (b0 Grant_builder) Build() *Grant { - m0 := &Grant{} - b, x := &b0, m0 - _, _ = b, x - x.Id = b.Id - x.Entitlement = b.Entitlement - x.Principal = b.Principal - return m0 -} - -type GrantSliceField struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - DefaultValue []*Grant `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GrantSliceField) Reset() { - *x = GrantSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GrantSliceField) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrantSliceField) ProtoMessage() {} - -func (x *GrantSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *GrantSliceField) GetDefaultValue() []*Grant { - if x != nil { - return x.DefaultValue - } - return nil -} - -func (x *GrantSliceField) SetDefaultValue(v []*Grant) { - x.DefaultValue = v -} - -type GrantSliceField_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - DefaultValue []*Grant -} - -func (b0 GrantSliceField_builder) Build() *GrantSliceField { - m0 := &GrantSliceField{} - b, x := &b0, m0 - _, _ = b, x - x.DefaultValue = b.DefaultValue - return m0 -} - type ResourceIdField struct { state protoimpl.MessageState `protogen:"hybrid.v1"` DefaultValue *ResourceId `protobuf:"bytes,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` @@ -2012,7 +1486,7 @@ type ResourceIdField struct { func (x *ResourceIdField) Reset() { *x = ResourceIdField{} - mi := &file_c1_config_v1_config_proto_msgTypes[13] + mi := &file_c1_config_v1_config_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2024,7 +1498,7 @@ func (x *ResourceIdField) String() string { func (*ResourceIdField) ProtoMessage() {} func (x *ResourceIdField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[13] + mi := &file_c1_config_v1_config_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2105,7 +1579,7 @@ type ResourceIdSliceField struct { func (x *ResourceIdSliceField) Reset() { *x = ResourceIdSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[14] + mi := &file_c1_config_v1_config_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2117,7 +1591,7 @@ func (x *ResourceIdSliceField) String() string { func (*ResourceIdSliceField) ProtoMessage() {} func (x *ResourceIdSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[14] + mi := &file_c1_config_v1_config_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2188,7 +1662,7 @@ type IntField struct { func (x *IntField) Reset() { *x = IntField{} - mi := &file_c1_config_v1_config_proto_msgTypes[15] + mi := &file_c1_config_v1_config_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2200,7 +1674,7 @@ func (x *IntField) String() string { func (*IntField) ProtoMessage() {} func (x *IntField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[15] + mi := &file_c1_config_v1_config_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2271,7 +1745,7 @@ type BoolField struct { func (x *BoolField) Reset() { *x = BoolField{} - mi := &file_c1_config_v1_config_proto_msgTypes[16] + mi := &file_c1_config_v1_config_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2283,7 +1757,7 @@ func (x *BoolField) String() string { func (*BoolField) ProtoMessage() {} func (x *BoolField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[16] + mi := &file_c1_config_v1_config_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2353,7 +1827,7 @@ type StringSliceField struct { func (x *StringSliceField) Reset() { *x = StringSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[17] + mi := &file_c1_config_v1_config_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2365,7 +1839,7 @@ func (x *StringSliceField) String() string { func (*StringSliceField) ProtoMessage() {} func (x *StringSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[17] + mi := &file_c1_config_v1_config_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2435,7 +1909,7 @@ type StringMapField struct { func (x *StringMapField) Reset() { *x = StringMapField{} - mi := &file_c1_config_v1_config_proto_msgTypes[18] + mi := &file_c1_config_v1_config_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2447,7 +1921,7 @@ func (x *StringMapField) String() string { func (*StringMapField) ProtoMessage() {} func (x *StringMapField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[18] + mi := &file_c1_config_v1_config_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2518,7 +1992,7 @@ type StringFieldOption struct { func (x *StringFieldOption) Reset() { *x = StringFieldOption{} - mi := &file_c1_config_v1_config_proto_msgTypes[19] + mi := &file_c1_config_v1_config_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2530,7 +2004,7 @@ func (x *StringFieldOption) String() string { func (*StringFieldOption) ProtoMessage() {} func (x *StringFieldOption) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[19] + mi := &file_c1_config_v1_config_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2606,7 +2080,7 @@ type StringField struct { func (x *StringField) Reset() { *x = StringField{} - mi := &file_c1_config_v1_config_proto_msgTypes[20] + mi := &file_c1_config_v1_config_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2618,7 +2092,7 @@ func (x *StringField) String() string { func (*StringField) ProtoMessage() {} func (x *StringField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[20] + mi := &file_c1_config_v1_config_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2751,7 +2225,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x1b\n" + "\thelp_text\x18\x03 \x01(\tR\bhelpText\x12\x16\n" + "\x06fields\x18\x04 \x03(\tR\x06fields\x12\x18\n" + - "\adefault\x18\x05 \x01(\bR\adefault\"\x9d\b\n" + + "\adefault\x18\x05 \x01(\bR\adefault\"\xf1\x06\n" + "\x05Field\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + @@ -2770,9 +2244,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x11resource_id_field\x18i \x01(\v2\x1d.c1.config.v1.ResourceIdFieldH\x00R\x0fresourceIdField\x12[\n" + "\x17resource_id_slice_field\x18j \x01(\v2\".c1.config.v1.ResourceIdSliceFieldH\x00R\x14resourceIdSliceField\x12D\n" + "\x0eresource_field\x18k \x01(\v2\x1b.c1.config.v1.ResourceFieldH\x00R\rresourceField\x12T\n" + - "\x14resource_slice_field\x18l \x01(\v2 .c1.config.v1.ResourceSliceFieldH\x00R\x12resourceSliceField\x12]\n" + - "\x17entitlement_slice_field\x18m \x01(\v2#.c1.config.v1.EntitlementSliceFieldH\x00R\x15entitlementSliceField\x12K\n" + - "\x11grant_slice_field\x18n \x01(\v2\x1d.c1.config.v1.GrantSliceFieldH\x00R\x0fgrantSliceFieldB\a\n" + + "\x14resource_slice_field\x18l \x01(\v2 .c1.config.v1.ResourceSliceFieldH\x00R\x12resourceSliceFieldB\a\n" + "\x05field\"\x8a\x02\n" + "\bResource\x129\n" + "\vresource_id\x18\x01 \x01(\v2\x18.c1.config.v1.ResourceIdR\n" + @@ -2789,27 +2261,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\rResourceField\x12;\n" + "\rdefault_value\x18\x01 \x01(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"Q\n" + "\x12ResourceSliceField\x12;\n" + - "\rdefault_value\x18\x01 \x03(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"\x9f\x02\n" + - "\vEntitlement\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12!\n" + - "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x12\n" + - "\x04slug\x18\x04 \x01(\tR\x04slug\x12\x18\n" + - "\apurpose\x18\x05 \x01(\tR\apurpose\x12B\n" + - "\x1egrantable_to_resource_type_ids\x18\x06 \x03(\tR\x1agrantableToResourceTypeIds\x12\x1f\n" + - "\vresource_id\x18\a \x01(\tR\n" + - "resourceId\x12(\n" + - "\x10resource_type_id\x18\b \x01(\tR\x0eresourceTypeId\"W\n" + - "\x15EntitlementSliceField\x12>\n" + - "\rdefault_value\x18\x01 \x03(\v2\x19.c1.config.v1.EntitlementR\fdefaultValue\" \n" + - "\x0eEntitlementRef\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\x8d\x01\n" + - "\x05Grant\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12>\n" + - "\ventitlement\x18\x02 \x01(\v2\x1c.c1.config.v1.EntitlementRefR\ventitlement\x124\n" + - "\tprincipal\x18\x03 \x01(\v2\x16.c1.config.v1.ResourceR\tprincipal\"K\n" + - "\x0fGrantSliceField\x128\n" + - "\rdefault_value\x18\x01 \x03(\v2\x13.c1.config.v1.GrantR\fdefaultValue\"\x94\x01\n" + + "\rdefault_value\x18\x01 \x03(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"\x94\x01\n" + "\x0fResourceIdField\x12=\n" + "\rdefault_value\x18\x01 \x01(\v2\x18.c1.config.v1.ResourceIdR\fdefaultValue\x128\n" + "\x05rules\x18\x03 \x01(\v2\x1d.c1.config.v1.ResourceIDRulesH\x00R\x05rules\x88\x01\x01B\b\n" + @@ -2862,7 +2314,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x1dSTRING_FIELD_TYPE_FILE_UPLOAD\x10\x04B3Z1github.com/conductorone/baton-sdk/pb/c1/config/v1b\x06proto3" var file_c1_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_c1_config_v1_config_proto_goTypes = []any{ (ConstraintKind)(0), // 0: c1.config.v1.ConstraintKind (StringFieldType)(0), // 1: c1.config.v1.StringFieldType @@ -2874,72 +2326,61 @@ var file_c1_config_v1_config_proto_goTypes = []any{ (*ResourceId)(nil), // 7: c1.config.v1.ResourceId (*ResourceField)(nil), // 8: c1.config.v1.ResourceField (*ResourceSliceField)(nil), // 9: c1.config.v1.ResourceSliceField - (*Entitlement)(nil), // 10: c1.config.v1.Entitlement - (*EntitlementSliceField)(nil), // 11: c1.config.v1.EntitlementSliceField - (*EntitlementRef)(nil), // 12: c1.config.v1.EntitlementRef - (*Grant)(nil), // 13: c1.config.v1.Grant - (*GrantSliceField)(nil), // 14: c1.config.v1.GrantSliceField - (*ResourceIdField)(nil), // 15: c1.config.v1.ResourceIdField - (*ResourceIdSliceField)(nil), // 16: c1.config.v1.ResourceIdSliceField - (*IntField)(nil), // 17: c1.config.v1.IntField - (*BoolField)(nil), // 18: c1.config.v1.BoolField - (*StringSliceField)(nil), // 19: c1.config.v1.StringSliceField - (*StringMapField)(nil), // 20: c1.config.v1.StringMapField - (*StringFieldOption)(nil), // 21: c1.config.v1.StringFieldOption - (*StringField)(nil), // 22: c1.config.v1.StringField - nil, // 23: c1.config.v1.StringMapField.DefaultValueEntry - (*anypb.Any)(nil), // 24: google.protobuf.Any - (*ResourceIDRules)(nil), // 25: c1.config.v1.ResourceIDRules - (*RepeatedResourceIdRules)(nil), // 26: c1.config.v1.RepeatedResourceIdRules - (*Int64Rules)(nil), // 27: c1.config.v1.Int64Rules - (*BoolRules)(nil), // 28: c1.config.v1.BoolRules - (*RepeatedStringRules)(nil), // 29: c1.config.v1.RepeatedStringRules - (*StringMapRules)(nil), // 30: c1.config.v1.StringMapRules - (*StringRules)(nil), // 31: c1.config.v1.StringRules + (*ResourceIdField)(nil), // 10: c1.config.v1.ResourceIdField + (*ResourceIdSliceField)(nil), // 11: c1.config.v1.ResourceIdSliceField + (*IntField)(nil), // 12: c1.config.v1.IntField + (*BoolField)(nil), // 13: c1.config.v1.BoolField + (*StringSliceField)(nil), // 14: c1.config.v1.StringSliceField + (*StringMapField)(nil), // 15: c1.config.v1.StringMapField + (*StringFieldOption)(nil), // 16: c1.config.v1.StringFieldOption + (*StringField)(nil), // 17: c1.config.v1.StringField + nil, // 18: c1.config.v1.StringMapField.DefaultValueEntry + (*anypb.Any)(nil), // 19: google.protobuf.Any + (*ResourceIDRules)(nil), // 20: c1.config.v1.ResourceIDRules + (*RepeatedResourceIdRules)(nil), // 21: c1.config.v1.RepeatedResourceIdRules + (*Int64Rules)(nil), // 22: c1.config.v1.Int64Rules + (*BoolRules)(nil), // 23: c1.config.v1.BoolRules + (*RepeatedStringRules)(nil), // 24: c1.config.v1.RepeatedStringRules + (*StringMapRules)(nil), // 25: c1.config.v1.StringMapRules + (*StringRules)(nil), // 26: c1.config.v1.StringRules } var file_c1_config_v1_config_proto_depIdxs = []int32{ 5, // 0: c1.config.v1.Configuration.fields:type_name -> c1.config.v1.Field 3, // 1: c1.config.v1.Configuration.constraints:type_name -> c1.config.v1.Constraint 4, // 2: c1.config.v1.Configuration.field_groups:type_name -> c1.config.v1.FieldGroup 0, // 3: c1.config.v1.Constraint.kind:type_name -> c1.config.v1.ConstraintKind - 22, // 4: c1.config.v1.Field.string_field:type_name -> c1.config.v1.StringField - 17, // 5: c1.config.v1.Field.int_field:type_name -> c1.config.v1.IntField - 18, // 6: c1.config.v1.Field.bool_field:type_name -> c1.config.v1.BoolField - 19, // 7: c1.config.v1.Field.string_slice_field:type_name -> c1.config.v1.StringSliceField - 20, // 8: c1.config.v1.Field.string_map_field:type_name -> c1.config.v1.StringMapField - 15, // 9: c1.config.v1.Field.resource_id_field:type_name -> c1.config.v1.ResourceIdField - 16, // 10: c1.config.v1.Field.resource_id_slice_field:type_name -> c1.config.v1.ResourceIdSliceField + 17, // 4: c1.config.v1.Field.string_field:type_name -> c1.config.v1.StringField + 12, // 5: c1.config.v1.Field.int_field:type_name -> c1.config.v1.IntField + 13, // 6: c1.config.v1.Field.bool_field:type_name -> c1.config.v1.BoolField + 14, // 7: c1.config.v1.Field.string_slice_field:type_name -> c1.config.v1.StringSliceField + 15, // 8: c1.config.v1.Field.string_map_field:type_name -> c1.config.v1.StringMapField + 10, // 9: c1.config.v1.Field.resource_id_field:type_name -> c1.config.v1.ResourceIdField + 11, // 10: c1.config.v1.Field.resource_id_slice_field:type_name -> c1.config.v1.ResourceIdSliceField 8, // 11: c1.config.v1.Field.resource_field:type_name -> c1.config.v1.ResourceField 9, // 12: c1.config.v1.Field.resource_slice_field:type_name -> c1.config.v1.ResourceSliceField - 11, // 13: c1.config.v1.Field.entitlement_slice_field:type_name -> c1.config.v1.EntitlementSliceField - 14, // 14: c1.config.v1.Field.grant_slice_field:type_name -> c1.config.v1.GrantSliceField - 7, // 15: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId - 7, // 16: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId - 24, // 17: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any - 6, // 18: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource - 6, // 19: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource - 10, // 20: c1.config.v1.EntitlementSliceField.default_value:type_name -> c1.config.v1.Entitlement - 12, // 21: c1.config.v1.Grant.entitlement:type_name -> c1.config.v1.EntitlementRef - 6, // 22: c1.config.v1.Grant.principal:type_name -> c1.config.v1.Resource - 13, // 23: c1.config.v1.GrantSliceField.default_value:type_name -> c1.config.v1.Grant - 7, // 24: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId - 25, // 25: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules - 15, // 26: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField - 26, // 27: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules - 27, // 28: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules - 28, // 29: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules - 29, // 30: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules - 23, // 31: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry - 30, // 32: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules - 31, // 33: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules - 1, // 34: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType - 21, // 35: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption - 24, // 36: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any - 37, // [37:37] is the sub-list for method output_type - 37, // [37:37] is the sub-list for method input_type - 37, // [37:37] is the sub-list for extension type_name - 37, // [37:37] is the sub-list for extension extendee - 0, // [0:37] is the sub-list for field type_name + 7, // 13: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId + 7, // 14: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId + 19, // 15: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any + 6, // 16: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource + 6, // 17: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource + 7, // 18: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId + 20, // 19: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules + 10, // 20: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField + 21, // 21: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules + 22, // 22: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules + 23, // 23: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules + 24, // 24: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules + 18, // 25: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry + 25, // 26: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules + 26, // 27: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules + 1, // 28: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType + 16, // 29: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption + 19, // 30: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any + 31, // [31:31] is the sub-list for method output_type + 31, // [31:31] is the sub-list for method input_type + 31, // [31:31] is the sub-list for extension type_name + 31, // [31:31] is the sub-list for extension extendee + 0, // [0:31] is the sub-list for field type_name } func init() { file_c1_config_v1_config_proto_init() } @@ -2958,23 +2399,21 @@ func file_c1_config_v1_config_proto_init() { (*Field_ResourceIdSliceField)(nil), (*Field_ResourceField)(nil), (*Field_ResourceSliceField)(nil), - (*Field_EntitlementSliceField)(nil), - (*Field_GrantSliceField)(nil), } + file_c1_config_v1_config_proto_msgTypes[8].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[9].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[10].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[11].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[12].OneofWrappers = []any{} file_c1_config_v1_config_proto_msgTypes[13].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[14].OneofWrappers = []any{} file_c1_config_v1_config_proto_msgTypes[15].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[16].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[17].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[18].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[20].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_config_v1_config_proto_rawDesc), len(file_c1_config_v1_config_proto_rawDesc)), NumEnums: 2, - NumMessages: 22, + NumMessages: 17, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go index 3c99fe9b..c58e2bd2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go @@ -870,88 +870,6 @@ func (m *Field) validate(all bool) error { } } - case *Field_EntitlementSliceField: - if v == nil { - err := FieldValidationError{ - field: "Field", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetEntitlementSliceField()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, FieldValidationError{ - field: "EntitlementSliceField", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, FieldValidationError{ - field: "EntitlementSliceField", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEntitlementSliceField()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return FieldValidationError{ - field: "EntitlementSliceField", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *Field_GrantSliceField: - if v == nil { - err := FieldValidationError{ - field: "Field", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetGrantSliceField()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, FieldValidationError{ - field: "GrantSliceField", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, FieldValidationError{ - field: "GrantSliceField", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetGrantSliceField()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return FieldValidationError{ - field: "GrantSliceField", - reason: "embedded message failed validation", - cause: err, - } - } - } - default: _ = v // ensures v is used } @@ -1596,649 +1514,6 @@ var _ interface { ErrorName() string } = ResourceSliceFieldValidationError{} -// Validate checks the field values on Entitlement with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Entitlement) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Entitlement with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in EntitlementMultiError, or -// nil if none found. -func (m *Entitlement) ValidateAll() error { - return m.validate(true) -} - -func (m *Entitlement) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - // no validation rules for DisplayName - - // no validation rules for Description - - // no validation rules for Slug - - // no validation rules for Purpose - - // no validation rules for ResourceId - - // no validation rules for ResourceTypeId - - if len(errors) > 0 { - return EntitlementMultiError(errors) - } - - return nil -} - -// EntitlementMultiError is an error wrapping multiple validation errors -// returned by Entitlement.ValidateAll() if the designated constraints aren't met. -type EntitlementMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m EntitlementMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m EntitlementMultiError) AllErrors() []error { return m } - -// EntitlementValidationError is the validation error returned by -// Entitlement.Validate if the designated constraints aren't met. -type EntitlementValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e EntitlementValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e EntitlementValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e EntitlementValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e EntitlementValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e EntitlementValidationError) ErrorName() string { return "EntitlementValidationError" } - -// Error satisfies the builtin error interface -func (e EntitlementValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sEntitlement.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = EntitlementValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = EntitlementValidationError{} - -// Validate checks the field values on EntitlementSliceField with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *EntitlementSliceField) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on EntitlementSliceField with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// EntitlementSliceFieldMultiError, or nil if none found. -func (m *EntitlementSliceField) ValidateAll() error { - return m.validate(true) -} - -func (m *EntitlementSliceField) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetDefaultValue() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, EntitlementSliceFieldValidationError{ - field: fmt.Sprintf("DefaultValue[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, EntitlementSliceFieldValidationError{ - field: fmt.Sprintf("DefaultValue[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return EntitlementSliceFieldValidationError{ - field: fmt.Sprintf("DefaultValue[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return EntitlementSliceFieldMultiError(errors) - } - - return nil -} - -// EntitlementSliceFieldMultiError is an error wrapping multiple validation -// errors returned by EntitlementSliceField.ValidateAll() if the designated -// constraints aren't met. -type EntitlementSliceFieldMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m EntitlementSliceFieldMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m EntitlementSliceFieldMultiError) AllErrors() []error { return m } - -// EntitlementSliceFieldValidationError is the validation error returned by -// EntitlementSliceField.Validate if the designated constraints aren't met. -type EntitlementSliceFieldValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e EntitlementSliceFieldValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e EntitlementSliceFieldValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e EntitlementSliceFieldValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e EntitlementSliceFieldValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e EntitlementSliceFieldValidationError) ErrorName() string { - return "EntitlementSliceFieldValidationError" -} - -// Error satisfies the builtin error interface -func (e EntitlementSliceFieldValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sEntitlementSliceField.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = EntitlementSliceFieldValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = EntitlementSliceFieldValidationError{} - -// Validate checks the field values on EntitlementRef with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *EntitlementRef) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on EntitlementRef with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in EntitlementRefMultiError, -// or nil if none found. -func (m *EntitlementRef) ValidateAll() error { - return m.validate(true) -} - -func (m *EntitlementRef) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if len(errors) > 0 { - return EntitlementRefMultiError(errors) - } - - return nil -} - -// EntitlementRefMultiError is an error wrapping multiple validation errors -// returned by EntitlementRef.ValidateAll() if the designated constraints -// aren't met. -type EntitlementRefMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m EntitlementRefMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m EntitlementRefMultiError) AllErrors() []error { return m } - -// EntitlementRefValidationError is the validation error returned by -// EntitlementRef.Validate if the designated constraints aren't met. -type EntitlementRefValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e EntitlementRefValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e EntitlementRefValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e EntitlementRefValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e EntitlementRefValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e EntitlementRefValidationError) ErrorName() string { return "EntitlementRefValidationError" } - -// Error satisfies the builtin error interface -func (e EntitlementRefValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sEntitlementRef.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = EntitlementRefValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = EntitlementRefValidationError{} - -// Validate checks the field values on Grant with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Grant) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Grant with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in GrantMultiError, or nil if none found. -func (m *Grant) ValidateAll() error { - return m.validate(true) -} - -func (m *Grant) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if all { - switch v := interface{}(m.GetEntitlement()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GrantValidationError{ - field: "Entitlement", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GrantValidationError{ - field: "Entitlement", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetEntitlement()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GrantValidationError{ - field: "Entitlement", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPrincipal()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GrantValidationError{ - field: "Principal", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GrantValidationError{ - field: "Principal", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPrincipal()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GrantValidationError{ - field: "Principal", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GrantMultiError(errors) - } - - return nil -} - -// GrantMultiError is an error wrapping multiple validation errors returned by -// Grant.ValidateAll() if the designated constraints aren't met. -type GrantMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GrantMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GrantMultiError) AllErrors() []error { return m } - -// GrantValidationError is the validation error returned by Grant.Validate if -// the designated constraints aren't met. -type GrantValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GrantValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GrantValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GrantValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GrantValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GrantValidationError) ErrorName() string { return "GrantValidationError" } - -// Error satisfies the builtin error interface -func (e GrantValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGrant.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GrantValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GrantValidationError{} - -// Validate checks the field values on GrantSliceField with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *GrantSliceField) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GrantSliceField with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GrantSliceFieldMultiError, or nil if none found. -func (m *GrantSliceField) ValidateAll() error { - return m.validate(true) -} - -func (m *GrantSliceField) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetDefaultValue() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GrantSliceFieldValidationError{ - field: fmt.Sprintf("DefaultValue[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GrantSliceFieldValidationError{ - field: fmt.Sprintf("DefaultValue[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GrantSliceFieldValidationError{ - field: fmt.Sprintf("DefaultValue[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GrantSliceFieldMultiError(errors) - } - - return nil -} - -// GrantSliceFieldMultiError is an error wrapping multiple validation errors -// returned by GrantSliceField.ValidateAll() if the designated constraints -// aren't met. -type GrantSliceFieldMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GrantSliceFieldMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GrantSliceFieldMultiError) AllErrors() []error { return m } - -// GrantSliceFieldValidationError is the validation error returned by -// GrantSliceField.Validate if the designated constraints aren't met. -type GrantSliceFieldValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GrantSliceFieldValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GrantSliceFieldValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GrantSliceFieldValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GrantSliceFieldValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GrantSliceFieldValidationError) ErrorName() string { return "GrantSliceFieldValidationError" } - -// Error satisfies the builtin error interface -func (e GrantSliceFieldValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGrantSliceField.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GrantSliceFieldValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GrantSliceFieldValidationError{} - // Validate checks the field values on ResourceIdField with the rules defined // in the proto definition for this message. If any rules are violated, the // first error encountered is returned, or nil if there are no violations. diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go index a236f5f3..5cc36692 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go @@ -721,24 +721,6 @@ func (x *Field) GetResourceSliceField() *ResourceSliceField { return nil } -func (x *Field) GetEntitlementSliceField() *EntitlementSliceField { - if x != nil { - if x, ok := x.xxx_hidden_Field.(*field_EntitlementSliceField); ok { - return x.EntitlementSliceField - } - } - return nil -} - -func (x *Field) GetGrantSliceField() *GrantSliceField { - if x != nil { - if x, ok := x.xxx_hidden_Field.(*field_GrantSliceField); ok { - return x.GrantSliceField - } - } - return nil -} - func (x *Field) SetName(v string) { x.xxx_hidden_Name = v } @@ -839,22 +821,6 @@ func (x *Field) SetResourceSliceField(v *ResourceSliceField) { x.xxx_hidden_Field = &field_ResourceSliceField{v} } -func (x *Field) SetEntitlementSliceField(v *EntitlementSliceField) { - if v == nil { - x.xxx_hidden_Field = nil - return - } - x.xxx_hidden_Field = &field_EntitlementSliceField{v} -} - -func (x *Field) SetGrantSliceField(v *GrantSliceField) { - if v == nil { - x.xxx_hidden_Field = nil - return - } - x.xxx_hidden_Field = &field_GrantSliceField{v} -} - func (x *Field) HasField() bool { if x == nil { return false @@ -934,22 +900,6 @@ func (x *Field) HasResourceSliceField() bool { return ok } -func (x *Field) HasEntitlementSliceField() bool { - if x == nil { - return false - } - _, ok := x.xxx_hidden_Field.(*field_EntitlementSliceField) - return ok -} - -func (x *Field) HasGrantSliceField() bool { - if x == nil { - return false - } - _, ok := x.xxx_hidden_Field.(*field_GrantSliceField) - return ok -} - func (x *Field) ClearField() { x.xxx_hidden_Field = nil } @@ -1008,18 +958,6 @@ func (x *Field) ClearResourceSliceField() { } } -func (x *Field) ClearEntitlementSliceField() { - if _, ok := x.xxx_hidden_Field.(*field_EntitlementSliceField); ok { - x.xxx_hidden_Field = nil - } -} - -func (x *Field) ClearGrantSliceField() { - if _, ok := x.xxx_hidden_Field.(*field_GrantSliceField); ok { - x.xxx_hidden_Field = nil - } -} - const Field_Field_not_set_case case_Field_Field = 0 const Field_StringField_case case_Field_Field = 100 const Field_IntField_case case_Field_Field = 101 @@ -1030,8 +968,6 @@ const Field_ResourceIdField_case case_Field_Field = 105 const Field_ResourceIdSliceField_case case_Field_Field = 106 const Field_ResourceField_case case_Field_Field = 107 const Field_ResourceSliceField_case case_Field_Field = 108 -const Field_EntitlementSliceField_case case_Field_Field = 109 -const Field_GrantSliceField_case case_Field_Field = 110 func (x *Field) WhichField() case_Field_Field { if x == nil { @@ -1056,10 +992,6 @@ func (x *Field) WhichField() case_Field_Field { return Field_ResourceField_case case *field_ResourceSliceField: return Field_ResourceSliceField_case - case *field_EntitlementSliceField: - return Field_EntitlementSliceField_case - case *field_GrantSliceField: - return Field_GrantSliceField_case default: return Field_Field_not_set_case } @@ -1084,10 +1016,8 @@ type Field_builder struct { ResourceIdField *ResourceIdField ResourceIdSliceField *ResourceIdSliceField // These are meant to serve as return types for actions. - ResourceField *ResourceField - ResourceSliceField *ResourceSliceField - EntitlementSliceField *EntitlementSliceField - GrantSliceField *GrantSliceField + ResourceField *ResourceField + ResourceSliceField *ResourceSliceField // -- end of xxx_hidden_Field } @@ -1129,12 +1059,6 @@ func (b0 Field_builder) Build() *Field { if b.ResourceSliceField != nil { x.xxx_hidden_Field = &field_ResourceSliceField{b.ResourceSliceField} } - if b.EntitlementSliceField != nil { - x.xxx_hidden_Field = &field_EntitlementSliceField{b.EntitlementSliceField} - } - if b.GrantSliceField != nil { - x.xxx_hidden_Field = &field_GrantSliceField{b.GrantSliceField} - } return m0 } @@ -1189,14 +1113,6 @@ type field_ResourceSliceField struct { ResourceSliceField *ResourceSliceField `protobuf:"bytes,108,opt,name=resource_slice_field,json=resourceSliceField,proto3,oneof"` } -type field_EntitlementSliceField struct { - EntitlementSliceField *EntitlementSliceField `protobuf:"bytes,109,opt,name=entitlement_slice_field,json=entitlementSliceField,proto3,oneof"` -} - -type field_GrantSliceField struct { - GrantSliceField *GrantSliceField `protobuf:"bytes,110,opt,name=grant_slice_field,json=grantSliceField,proto3,oneof"` -} - func (*field_StringField) isField_Field() {} func (*field_IntField) isField_Field() {} @@ -1215,10 +1131,6 @@ func (*field_ResourceField) isField_Field() {} func (*field_ResourceSliceField) isField_Field() {} -func (*field_EntitlementSliceField) isField_Field() {} - -func (*field_GrantSliceField) isField_Field() {} - // These are partially duplicate with the Resource proto in the connector package. // This is to avoid import cycles type Resource struct { @@ -1556,446 +1468,6 @@ func (b0 ResourceSliceField_builder) Build() *ResourceSliceField { return m0 } -// Simplified Entitlement for config return types (avoids import cycles with connector package) -type Entitlement struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Id string `protobuf:"bytes,1,opt,name=id,proto3"` - xxx_hidden_DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3"` - xxx_hidden_Description string `protobuf:"bytes,3,opt,name=description,proto3"` - xxx_hidden_Slug string `protobuf:"bytes,4,opt,name=slug,proto3"` - xxx_hidden_Purpose string `protobuf:"bytes,5,opt,name=purpose,proto3"` - xxx_hidden_GrantableToResourceTypeIds []string `protobuf:"bytes,6,rep,name=grantable_to_resource_type_ids,json=grantableToResourceTypeIds,proto3"` - xxx_hidden_ResourceId string `protobuf:"bytes,7,opt,name=resource_id,json=resourceId,proto3"` - xxx_hidden_ResourceTypeId string `protobuf:"bytes,8,opt,name=resource_type_id,json=resourceTypeId,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Entitlement) Reset() { - *x = Entitlement{} - mi := &file_c1_config_v1_config_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Entitlement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Entitlement) ProtoMessage() {} - -func (x *Entitlement) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Entitlement) GetId() string { - if x != nil { - return x.xxx_hidden_Id - } - return "" -} - -func (x *Entitlement) GetDisplayName() string { - if x != nil { - return x.xxx_hidden_DisplayName - } - return "" -} - -func (x *Entitlement) GetDescription() string { - if x != nil { - return x.xxx_hidden_Description - } - return "" -} - -func (x *Entitlement) GetSlug() string { - if x != nil { - return x.xxx_hidden_Slug - } - return "" -} - -func (x *Entitlement) GetPurpose() string { - if x != nil { - return x.xxx_hidden_Purpose - } - return "" -} - -func (x *Entitlement) GetGrantableToResourceTypeIds() []string { - if x != nil { - return x.xxx_hidden_GrantableToResourceTypeIds - } - return nil -} - -func (x *Entitlement) GetResourceId() string { - if x != nil { - return x.xxx_hidden_ResourceId - } - return "" -} - -func (x *Entitlement) GetResourceTypeId() string { - if x != nil { - return x.xxx_hidden_ResourceTypeId - } - return "" -} - -func (x *Entitlement) SetId(v string) { - x.xxx_hidden_Id = v -} - -func (x *Entitlement) SetDisplayName(v string) { - x.xxx_hidden_DisplayName = v -} - -func (x *Entitlement) SetDescription(v string) { - x.xxx_hidden_Description = v -} - -func (x *Entitlement) SetSlug(v string) { - x.xxx_hidden_Slug = v -} - -func (x *Entitlement) SetPurpose(v string) { - x.xxx_hidden_Purpose = v -} - -func (x *Entitlement) SetGrantableToResourceTypeIds(v []string) { - x.xxx_hidden_GrantableToResourceTypeIds = v -} - -func (x *Entitlement) SetResourceId(v string) { - x.xxx_hidden_ResourceId = v -} - -func (x *Entitlement) SetResourceTypeId(v string) { - x.xxx_hidden_ResourceTypeId = v -} - -type Entitlement_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id string - DisplayName string - Description string - Slug string - Purpose string - GrantableToResourceTypeIds []string - ResourceId string - ResourceTypeId string -} - -func (b0 Entitlement_builder) Build() *Entitlement { - m0 := &Entitlement{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Id = b.Id - x.xxx_hidden_DisplayName = b.DisplayName - x.xxx_hidden_Description = b.Description - x.xxx_hidden_Slug = b.Slug - x.xxx_hidden_Purpose = b.Purpose - x.xxx_hidden_GrantableToResourceTypeIds = b.GrantableToResourceTypeIds - x.xxx_hidden_ResourceId = b.ResourceId - x.xxx_hidden_ResourceTypeId = b.ResourceTypeId - return m0 -} - -type EntitlementSliceField struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_DefaultValue *[]*Entitlement `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EntitlementSliceField) Reset() { - *x = EntitlementSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EntitlementSliceField) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EntitlementSliceField) ProtoMessage() {} - -func (x *EntitlementSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *EntitlementSliceField) GetDefaultValue() []*Entitlement { - if x != nil { - if x.xxx_hidden_DefaultValue != nil { - return *x.xxx_hidden_DefaultValue - } - } - return nil -} - -func (x *EntitlementSliceField) SetDefaultValue(v []*Entitlement) { - x.xxx_hidden_DefaultValue = &v -} - -type EntitlementSliceField_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - DefaultValue []*Entitlement -} - -func (b0 EntitlementSliceField_builder) Build() *EntitlementSliceField { - m0 := &EntitlementSliceField{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_DefaultValue = &b.DefaultValue - return m0 -} - -// Reference to an entitlement (used in Grant) -type EntitlementRef struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Id string `protobuf:"bytes,1,opt,name=id,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EntitlementRef) Reset() { - *x = EntitlementRef{} - mi := &file_c1_config_v1_config_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EntitlementRef) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EntitlementRef) ProtoMessage() {} - -func (x *EntitlementRef) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *EntitlementRef) GetId() string { - if x != nil { - return x.xxx_hidden_Id - } - return "" -} - -func (x *EntitlementRef) SetId(v string) { - x.xxx_hidden_Id = v -} - -type EntitlementRef_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id string -} - -func (b0 EntitlementRef_builder) Build() *EntitlementRef { - m0 := &EntitlementRef{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Id = b.Id - return m0 -} - -// Simplified Grant for config return types (avoids import cycles with connector package) -type Grant struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Id string `protobuf:"bytes,1,opt,name=id,proto3"` - xxx_hidden_Entitlement *EntitlementRef `protobuf:"bytes,2,opt,name=entitlement,proto3"` - xxx_hidden_Principal *Resource `protobuf:"bytes,3,opt,name=principal,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Grant) Reset() { - *x = Grant{} - mi := &file_c1_config_v1_config_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Grant) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Grant) ProtoMessage() {} - -func (x *Grant) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Grant) GetId() string { - if x != nil { - return x.xxx_hidden_Id - } - return "" -} - -func (x *Grant) GetEntitlement() *EntitlementRef { - if x != nil { - return x.xxx_hidden_Entitlement - } - return nil -} - -func (x *Grant) GetPrincipal() *Resource { - if x != nil { - return x.xxx_hidden_Principal - } - return nil -} - -func (x *Grant) SetId(v string) { - x.xxx_hidden_Id = v -} - -func (x *Grant) SetEntitlement(v *EntitlementRef) { - x.xxx_hidden_Entitlement = v -} - -func (x *Grant) SetPrincipal(v *Resource) { - x.xxx_hidden_Principal = v -} - -func (x *Grant) HasEntitlement() bool { - if x == nil { - return false - } - return x.xxx_hidden_Entitlement != nil -} - -func (x *Grant) HasPrincipal() bool { - if x == nil { - return false - } - return x.xxx_hidden_Principal != nil -} - -func (x *Grant) ClearEntitlement() { - x.xxx_hidden_Entitlement = nil -} - -func (x *Grant) ClearPrincipal() { - x.xxx_hidden_Principal = nil -} - -type Grant_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id string - Entitlement *EntitlementRef - Principal *Resource -} - -func (b0 Grant_builder) Build() *Grant { - m0 := &Grant{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Id = b.Id - x.xxx_hidden_Entitlement = b.Entitlement - x.xxx_hidden_Principal = b.Principal - return m0 -} - -type GrantSliceField struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_DefaultValue *[]*Grant `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GrantSliceField) Reset() { - *x = GrantSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GrantSliceField) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrantSliceField) ProtoMessage() {} - -func (x *GrantSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *GrantSliceField) GetDefaultValue() []*Grant { - if x != nil { - if x.xxx_hidden_DefaultValue != nil { - return *x.xxx_hidden_DefaultValue - } - } - return nil -} - -func (x *GrantSliceField) SetDefaultValue(v []*Grant) { - x.xxx_hidden_DefaultValue = &v -} - -type GrantSliceField_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - DefaultValue []*Grant -} - -func (b0 GrantSliceField_builder) Build() *GrantSliceField { - m0 := &GrantSliceField{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_DefaultValue = &b.DefaultValue - return m0 -} - type ResourceIdField struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_DefaultValue *ResourceId `protobuf:"bytes,1,opt,name=default_value,json=defaultValue,proto3"` @@ -2006,7 +1478,7 @@ type ResourceIdField struct { func (x *ResourceIdField) Reset() { *x = ResourceIdField{} - mi := &file_c1_config_v1_config_proto_msgTypes[13] + mi := &file_c1_config_v1_config_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2018,7 +1490,7 @@ func (x *ResourceIdField) String() string { func (*ResourceIdField) ProtoMessage() {} func (x *ResourceIdField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[13] + mi := &file_c1_config_v1_config_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2099,7 +1571,7 @@ type ResourceIdSliceField struct { func (x *ResourceIdSliceField) Reset() { *x = ResourceIdSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[14] + mi := &file_c1_config_v1_config_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2111,7 +1583,7 @@ func (x *ResourceIdSliceField) String() string { func (*ResourceIdSliceField) ProtoMessage() {} func (x *ResourceIdSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[14] + mi := &file_c1_config_v1_config_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2183,7 +1655,7 @@ type IntField struct { func (x *IntField) Reset() { *x = IntField{} - mi := &file_c1_config_v1_config_proto_msgTypes[15] + mi := &file_c1_config_v1_config_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2195,7 +1667,7 @@ func (x *IntField) String() string { func (*IntField) ProtoMessage() {} func (x *IntField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[15] + mi := &file_c1_config_v1_config_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2266,7 +1738,7 @@ type BoolField struct { func (x *BoolField) Reset() { *x = BoolField{} - mi := &file_c1_config_v1_config_proto_msgTypes[16] + mi := &file_c1_config_v1_config_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2278,7 +1750,7 @@ func (x *BoolField) String() string { func (*BoolField) ProtoMessage() {} func (x *BoolField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[16] + mi := &file_c1_config_v1_config_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2348,7 +1820,7 @@ type StringSliceField struct { func (x *StringSliceField) Reset() { *x = StringSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[17] + mi := &file_c1_config_v1_config_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2360,7 +1832,7 @@ func (x *StringSliceField) String() string { func (*StringSliceField) ProtoMessage() {} func (x *StringSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[17] + mi := &file_c1_config_v1_config_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2430,7 +1902,7 @@ type StringMapField struct { func (x *StringMapField) Reset() { *x = StringMapField{} - mi := &file_c1_config_v1_config_proto_msgTypes[18] + mi := &file_c1_config_v1_config_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2442,7 +1914,7 @@ func (x *StringMapField) String() string { func (*StringMapField) ProtoMessage() {} func (x *StringMapField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[18] + mi := &file_c1_config_v1_config_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2513,7 +1985,7 @@ type StringFieldOption struct { func (x *StringFieldOption) Reset() { *x = StringFieldOption{} - mi := &file_c1_config_v1_config_proto_msgTypes[19] + mi := &file_c1_config_v1_config_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2525,7 +1997,7 @@ func (x *StringFieldOption) String() string { func (*StringFieldOption) ProtoMessage() {} func (x *StringFieldOption) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[19] + mi := &file_c1_config_v1_config_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2600,7 +2072,7 @@ type StringField struct { func (x *StringField) Reset() { *x = StringField{} - mi := &file_c1_config_v1_config_proto_msgTypes[20] + mi := &file_c1_config_v1_config_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2612,7 +2084,7 @@ func (x *StringField) String() string { func (*StringField) ProtoMessage() {} func (x *StringField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[20] + mi := &file_c1_config_v1_config_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2747,7 +2219,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x1b\n" + "\thelp_text\x18\x03 \x01(\tR\bhelpText\x12\x16\n" + "\x06fields\x18\x04 \x03(\tR\x06fields\x12\x18\n" + - "\adefault\x18\x05 \x01(\bR\adefault\"\x9d\b\n" + + "\adefault\x18\x05 \x01(\bR\adefault\"\xf1\x06\n" + "\x05Field\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + @@ -2766,9 +2238,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x11resource_id_field\x18i \x01(\v2\x1d.c1.config.v1.ResourceIdFieldH\x00R\x0fresourceIdField\x12[\n" + "\x17resource_id_slice_field\x18j \x01(\v2\".c1.config.v1.ResourceIdSliceFieldH\x00R\x14resourceIdSliceField\x12D\n" + "\x0eresource_field\x18k \x01(\v2\x1b.c1.config.v1.ResourceFieldH\x00R\rresourceField\x12T\n" + - "\x14resource_slice_field\x18l \x01(\v2 .c1.config.v1.ResourceSliceFieldH\x00R\x12resourceSliceField\x12]\n" + - "\x17entitlement_slice_field\x18m \x01(\v2#.c1.config.v1.EntitlementSliceFieldH\x00R\x15entitlementSliceField\x12K\n" + - "\x11grant_slice_field\x18n \x01(\v2\x1d.c1.config.v1.GrantSliceFieldH\x00R\x0fgrantSliceFieldB\a\n" + + "\x14resource_slice_field\x18l \x01(\v2 .c1.config.v1.ResourceSliceFieldH\x00R\x12resourceSliceFieldB\a\n" + "\x05field\"\x8a\x02\n" + "\bResource\x129\n" + "\vresource_id\x18\x01 \x01(\v2\x18.c1.config.v1.ResourceIdR\n" + @@ -2785,27 +2255,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\rResourceField\x12;\n" + "\rdefault_value\x18\x01 \x01(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"Q\n" + "\x12ResourceSliceField\x12;\n" + - "\rdefault_value\x18\x01 \x03(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"\x9f\x02\n" + - "\vEntitlement\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12!\n" + - "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x12\n" + - "\x04slug\x18\x04 \x01(\tR\x04slug\x12\x18\n" + - "\apurpose\x18\x05 \x01(\tR\apurpose\x12B\n" + - "\x1egrantable_to_resource_type_ids\x18\x06 \x03(\tR\x1agrantableToResourceTypeIds\x12\x1f\n" + - "\vresource_id\x18\a \x01(\tR\n" + - "resourceId\x12(\n" + - "\x10resource_type_id\x18\b \x01(\tR\x0eresourceTypeId\"W\n" + - "\x15EntitlementSliceField\x12>\n" + - "\rdefault_value\x18\x01 \x03(\v2\x19.c1.config.v1.EntitlementR\fdefaultValue\" \n" + - "\x0eEntitlementRef\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\x8d\x01\n" + - "\x05Grant\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12>\n" + - "\ventitlement\x18\x02 \x01(\v2\x1c.c1.config.v1.EntitlementRefR\ventitlement\x124\n" + - "\tprincipal\x18\x03 \x01(\v2\x16.c1.config.v1.ResourceR\tprincipal\"K\n" + - "\x0fGrantSliceField\x128\n" + - "\rdefault_value\x18\x01 \x03(\v2\x13.c1.config.v1.GrantR\fdefaultValue\"\x94\x01\n" + + "\rdefault_value\x18\x01 \x03(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"\x94\x01\n" + "\x0fResourceIdField\x12=\n" + "\rdefault_value\x18\x01 \x01(\v2\x18.c1.config.v1.ResourceIdR\fdefaultValue\x128\n" + "\x05rules\x18\x03 \x01(\v2\x1d.c1.config.v1.ResourceIDRulesH\x00R\x05rules\x88\x01\x01B\b\n" + @@ -2858,7 +2308,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x1dSTRING_FIELD_TYPE_FILE_UPLOAD\x10\x04B3Z1github.com/conductorone/baton-sdk/pb/c1/config/v1b\x06proto3" var file_c1_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_c1_config_v1_config_proto_goTypes = []any{ (ConstraintKind)(0), // 0: c1.config.v1.ConstraintKind (StringFieldType)(0), // 1: c1.config.v1.StringFieldType @@ -2870,72 +2320,61 @@ var file_c1_config_v1_config_proto_goTypes = []any{ (*ResourceId)(nil), // 7: c1.config.v1.ResourceId (*ResourceField)(nil), // 8: c1.config.v1.ResourceField (*ResourceSliceField)(nil), // 9: c1.config.v1.ResourceSliceField - (*Entitlement)(nil), // 10: c1.config.v1.Entitlement - (*EntitlementSliceField)(nil), // 11: c1.config.v1.EntitlementSliceField - (*EntitlementRef)(nil), // 12: c1.config.v1.EntitlementRef - (*Grant)(nil), // 13: c1.config.v1.Grant - (*GrantSliceField)(nil), // 14: c1.config.v1.GrantSliceField - (*ResourceIdField)(nil), // 15: c1.config.v1.ResourceIdField - (*ResourceIdSliceField)(nil), // 16: c1.config.v1.ResourceIdSliceField - (*IntField)(nil), // 17: c1.config.v1.IntField - (*BoolField)(nil), // 18: c1.config.v1.BoolField - (*StringSliceField)(nil), // 19: c1.config.v1.StringSliceField - (*StringMapField)(nil), // 20: c1.config.v1.StringMapField - (*StringFieldOption)(nil), // 21: c1.config.v1.StringFieldOption - (*StringField)(nil), // 22: c1.config.v1.StringField - nil, // 23: c1.config.v1.StringMapField.DefaultValueEntry - (*anypb.Any)(nil), // 24: google.protobuf.Any - (*ResourceIDRules)(nil), // 25: c1.config.v1.ResourceIDRules - (*RepeatedResourceIdRules)(nil), // 26: c1.config.v1.RepeatedResourceIdRules - (*Int64Rules)(nil), // 27: c1.config.v1.Int64Rules - (*BoolRules)(nil), // 28: c1.config.v1.BoolRules - (*RepeatedStringRules)(nil), // 29: c1.config.v1.RepeatedStringRules - (*StringMapRules)(nil), // 30: c1.config.v1.StringMapRules - (*StringRules)(nil), // 31: c1.config.v1.StringRules + (*ResourceIdField)(nil), // 10: c1.config.v1.ResourceIdField + (*ResourceIdSliceField)(nil), // 11: c1.config.v1.ResourceIdSliceField + (*IntField)(nil), // 12: c1.config.v1.IntField + (*BoolField)(nil), // 13: c1.config.v1.BoolField + (*StringSliceField)(nil), // 14: c1.config.v1.StringSliceField + (*StringMapField)(nil), // 15: c1.config.v1.StringMapField + (*StringFieldOption)(nil), // 16: c1.config.v1.StringFieldOption + (*StringField)(nil), // 17: c1.config.v1.StringField + nil, // 18: c1.config.v1.StringMapField.DefaultValueEntry + (*anypb.Any)(nil), // 19: google.protobuf.Any + (*ResourceIDRules)(nil), // 20: c1.config.v1.ResourceIDRules + (*RepeatedResourceIdRules)(nil), // 21: c1.config.v1.RepeatedResourceIdRules + (*Int64Rules)(nil), // 22: c1.config.v1.Int64Rules + (*BoolRules)(nil), // 23: c1.config.v1.BoolRules + (*RepeatedStringRules)(nil), // 24: c1.config.v1.RepeatedStringRules + (*StringMapRules)(nil), // 25: c1.config.v1.StringMapRules + (*StringRules)(nil), // 26: c1.config.v1.StringRules } var file_c1_config_v1_config_proto_depIdxs = []int32{ 5, // 0: c1.config.v1.Configuration.fields:type_name -> c1.config.v1.Field 3, // 1: c1.config.v1.Configuration.constraints:type_name -> c1.config.v1.Constraint 4, // 2: c1.config.v1.Configuration.field_groups:type_name -> c1.config.v1.FieldGroup 0, // 3: c1.config.v1.Constraint.kind:type_name -> c1.config.v1.ConstraintKind - 22, // 4: c1.config.v1.Field.string_field:type_name -> c1.config.v1.StringField - 17, // 5: c1.config.v1.Field.int_field:type_name -> c1.config.v1.IntField - 18, // 6: c1.config.v1.Field.bool_field:type_name -> c1.config.v1.BoolField - 19, // 7: c1.config.v1.Field.string_slice_field:type_name -> c1.config.v1.StringSliceField - 20, // 8: c1.config.v1.Field.string_map_field:type_name -> c1.config.v1.StringMapField - 15, // 9: c1.config.v1.Field.resource_id_field:type_name -> c1.config.v1.ResourceIdField - 16, // 10: c1.config.v1.Field.resource_id_slice_field:type_name -> c1.config.v1.ResourceIdSliceField + 17, // 4: c1.config.v1.Field.string_field:type_name -> c1.config.v1.StringField + 12, // 5: c1.config.v1.Field.int_field:type_name -> c1.config.v1.IntField + 13, // 6: c1.config.v1.Field.bool_field:type_name -> c1.config.v1.BoolField + 14, // 7: c1.config.v1.Field.string_slice_field:type_name -> c1.config.v1.StringSliceField + 15, // 8: c1.config.v1.Field.string_map_field:type_name -> c1.config.v1.StringMapField + 10, // 9: c1.config.v1.Field.resource_id_field:type_name -> c1.config.v1.ResourceIdField + 11, // 10: c1.config.v1.Field.resource_id_slice_field:type_name -> c1.config.v1.ResourceIdSliceField 8, // 11: c1.config.v1.Field.resource_field:type_name -> c1.config.v1.ResourceField 9, // 12: c1.config.v1.Field.resource_slice_field:type_name -> c1.config.v1.ResourceSliceField - 11, // 13: c1.config.v1.Field.entitlement_slice_field:type_name -> c1.config.v1.EntitlementSliceField - 14, // 14: c1.config.v1.Field.grant_slice_field:type_name -> c1.config.v1.GrantSliceField - 7, // 15: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId - 7, // 16: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId - 24, // 17: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any - 6, // 18: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource - 6, // 19: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource - 10, // 20: c1.config.v1.EntitlementSliceField.default_value:type_name -> c1.config.v1.Entitlement - 12, // 21: c1.config.v1.Grant.entitlement:type_name -> c1.config.v1.EntitlementRef - 6, // 22: c1.config.v1.Grant.principal:type_name -> c1.config.v1.Resource - 13, // 23: c1.config.v1.GrantSliceField.default_value:type_name -> c1.config.v1.Grant - 7, // 24: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId - 25, // 25: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules - 15, // 26: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField - 26, // 27: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules - 27, // 28: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules - 28, // 29: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules - 29, // 30: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules - 23, // 31: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry - 30, // 32: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules - 31, // 33: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules - 1, // 34: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType - 21, // 35: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption - 24, // 36: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any - 37, // [37:37] is the sub-list for method output_type - 37, // [37:37] is the sub-list for method input_type - 37, // [37:37] is the sub-list for extension type_name - 37, // [37:37] is the sub-list for extension extendee - 0, // [0:37] is the sub-list for field type_name + 7, // 13: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId + 7, // 14: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId + 19, // 15: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any + 6, // 16: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource + 6, // 17: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource + 7, // 18: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId + 20, // 19: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules + 10, // 20: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField + 21, // 21: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules + 22, // 22: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules + 23, // 23: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules + 24, // 24: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules + 18, // 25: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry + 25, // 26: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules + 26, // 27: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules + 1, // 28: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType + 16, // 29: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption + 19, // 30: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any + 31, // [31:31] is the sub-list for method output_type + 31, // [31:31] is the sub-list for method input_type + 31, // [31:31] is the sub-list for extension type_name + 31, // [31:31] is the sub-list for extension extendee + 0, // [0:31] is the sub-list for field type_name } func init() { file_c1_config_v1_config_proto_init() } @@ -2954,23 +2393,21 @@ func file_c1_config_v1_config_proto_init() { (*field_ResourceIdSliceField)(nil), (*field_ResourceField)(nil), (*field_ResourceSliceField)(nil), - (*field_EntitlementSliceField)(nil), - (*field_GrantSliceField)(nil), } + file_c1_config_v1_config_proto_msgTypes[8].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[9].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[10].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[11].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[12].OneofWrappers = []any{} file_c1_config_v1_config_proto_msgTypes[13].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[14].OneofWrappers = []any{} file_c1_config_v1_config_proto_msgTypes[15].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[16].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[17].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[18].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[20].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_config_v1_config_proto_rawDesc), len(file_c1_config_v1_config_proto_rawDesc)), NumEnums: 2, - NumMessages: 22, + NumMessages: 17, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.go index afe1a1ff..11073384 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.go @@ -1487,20 +1487,8 @@ func (b0 ResourceIDRules_builder) Build() *ResourceIDRules { type RepeatedResourceIdRules struct { state protoimpl.MessageState `protogen:"hybrid.v1"` AllowedResourceTypeIds []string `protobuf:"bytes,1,rep,name=allowed_resource_type_ids,json=allowedResourceTypeIds,proto3" json:"allowed_resource_type_ids,omitempty"` - // MinItems specifies that this field must have the specified number of - // items at a minimum - MinItems *uint64 `protobuf:"varint,2,opt,name=min_items,json=minItems,proto3,oneof" json:"min_items,omitempty"` - // MaxItems specifies that this field must have the specified number of - // items at a maximum - MaxItems *uint64 `protobuf:"varint,3,opt,name=max_items,json=maxItems,proto3,oneof" json:"max_items,omitempty"` - // Unique specifies that all elements in this field must be unique. - Unique bool `protobuf:"varint,4,opt,name=unique,proto3" json:"unique,omitempty"` - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - ValidateEmpty bool `protobuf:"varint,5,opt,name=validate_empty,json=validateEmpty,proto3" json:"validate_empty,omitempty"` - IsRequired bool `protobuf:"varint,6,opt,name=is_required,json=isRequired,proto3" json:"is_required,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *RepeatedResourceIdRules) Reset() { @@ -1535,103 +1523,14 @@ func (x *RepeatedResourceIdRules) GetAllowedResourceTypeIds() []string { return nil } -func (x *RepeatedResourceIdRules) GetMinItems() uint64 { - if x != nil && x.MinItems != nil { - return *x.MinItems - } - return 0 -} - -func (x *RepeatedResourceIdRules) GetMaxItems() uint64 { - if x != nil && x.MaxItems != nil { - return *x.MaxItems - } - return 0 -} - -func (x *RepeatedResourceIdRules) GetUnique() bool { - if x != nil { - return x.Unique - } - return false -} - -func (x *RepeatedResourceIdRules) GetValidateEmpty() bool { - if x != nil { - return x.ValidateEmpty - } - return false -} - -func (x *RepeatedResourceIdRules) GetIsRequired() bool { - if x != nil { - return x.IsRequired - } - return false -} - func (x *RepeatedResourceIdRules) SetAllowedResourceTypeIds(v []string) { x.AllowedResourceTypeIds = v } -func (x *RepeatedResourceIdRules) SetMinItems(v uint64) { - x.MinItems = &v -} - -func (x *RepeatedResourceIdRules) SetMaxItems(v uint64) { - x.MaxItems = &v -} - -func (x *RepeatedResourceIdRules) SetUnique(v bool) { - x.Unique = v -} - -func (x *RepeatedResourceIdRules) SetValidateEmpty(v bool) { - x.ValidateEmpty = v -} - -func (x *RepeatedResourceIdRules) SetIsRequired(v bool) { - x.IsRequired = v -} - -func (x *RepeatedResourceIdRules) HasMinItems() bool { - if x == nil { - return false - } - return x.MinItems != nil -} - -func (x *RepeatedResourceIdRules) HasMaxItems() bool { - if x == nil { - return false - } - return x.MaxItems != nil -} - -func (x *RepeatedResourceIdRules) ClearMinItems() { - x.MinItems = nil -} - -func (x *RepeatedResourceIdRules) ClearMaxItems() { - x.MaxItems = nil -} - type RepeatedResourceIdRules_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. AllowedResourceTypeIds []string - // MinItems specifies that this field must have the specified number of - // items at a minimum - MinItems *uint64 - // MaxItems specifies that this field must have the specified number of - // items at a maximum - MaxItems *uint64 - // Unique specifies that all elements in this field must be unique. - Unique bool - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - ValidateEmpty bool - IsRequired bool } func (b0 RepeatedResourceIdRules_builder) Build() *RepeatedResourceIdRules { @@ -1639,11 +1538,6 @@ func (b0 RepeatedResourceIdRules_builder) Build() *RepeatedResourceIdRules { b, x := &b0, m0 _, _ = b, x x.AllowedResourceTypeIds = b.AllowedResourceTypeIds - x.MinItems = b.MinItems - x.MaxItems = b.MaxItems - x.Unique = b.Unique - x.ValidateEmpty = b.ValidateEmpty - x.IsRequired = b.IsRequired return m0 } @@ -1736,19 +1630,9 @@ const file_c1_config_v1_rules_proto_rawDesc = "" + "\vis_required\x18\x02 \x01(\bR\n" + "isRequired\"L\n" + "\x0fResourceIDRules\x129\n" + - "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\"\x94\x02\n" + + "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\"T\n" + "\x17RepeatedResourceIdRules\x129\n" + - "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\x12 \n" + - "\tmin_items\x18\x02 \x01(\x04H\x00R\bminItems\x88\x01\x01\x12 \n" + - "\tmax_items\x18\x03 \x01(\x04H\x01R\bmaxItems\x88\x01\x01\x12\x16\n" + - "\x06unique\x18\x04 \x01(\bR\x06unique\x12%\n" + - "\x0evalidate_empty\x18\x05 \x01(\bR\rvalidateEmpty\x12\x1f\n" + - "\vis_required\x18\x06 \x01(\bR\n" + - "isRequiredB\f\n" + - "\n" + - "_min_itemsB\f\n" + - "\n" + - "_max_items*\x99\x02\n" + + "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds*\x99\x02\n" + "\x0fWellKnownString\x12!\n" + "\x1dWELL_KNOWN_STRING_UNSPECIFIED\x10\x00\x12\x1b\n" + "\x17WELL_KNOWN_STRING_EMAIL\x10\x01\x12\x1e\n" + @@ -1800,7 +1684,6 @@ func file_c1_config_v1_rules_proto_init() { } file_c1_config_v1_rules_proto_msgTypes[3].OneofWrappers = []any{} file_c1_config_v1_rules_proto_msgTypes[4].OneofWrappers = []any{} - file_c1_config_v1_rules_proto_msgTypes[7].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.validate.go index ef7e9c54..f5f49e9e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.validate.go @@ -1015,20 +1015,6 @@ func (m *RepeatedResourceIdRules) validate(all bool) error { var errors []error - // no validation rules for Unique - - // no validation rules for ValidateEmpty - - // no validation rules for IsRequired - - if m.MinItems != nil { - // no validation rules for MinItems - } - - if m.MaxItems != nil { - // no validation rules for MaxItems - } - if len(errors) > 0 { return RepeatedResourceIdRulesMultiError(errors) } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules_protoopaque.pb.go index a4f425ba..87964c85 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules_protoopaque.pb.go @@ -1524,13 +1524,6 @@ func (b0 ResourceIDRules_builder) Build() *ResourceIDRules { type RepeatedResourceIdRules struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_AllowedResourceTypeIds []string `protobuf:"bytes,1,rep,name=allowed_resource_type_ids,json=allowedResourceTypeIds,proto3"` - xxx_hidden_MinItems uint64 `protobuf:"varint,2,opt,name=min_items,json=minItems,proto3,oneof"` - xxx_hidden_MaxItems uint64 `protobuf:"varint,3,opt,name=max_items,json=maxItems,proto3,oneof"` - xxx_hidden_Unique bool `protobuf:"varint,4,opt,name=unique,proto3"` - xxx_hidden_ValidateEmpty bool `protobuf:"varint,5,opt,name=validate_empty,json=validateEmpty,proto3"` - xxx_hidden_IsRequired bool `protobuf:"varint,6,opt,name=is_required,json=isRequired,proto3"` - XXX_raceDetectHookData protoimpl.RaceDetectHookData - XXX_presence [1]uint32 unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1567,107 +1560,14 @@ func (x *RepeatedResourceIdRules) GetAllowedResourceTypeIds() []string { return nil } -func (x *RepeatedResourceIdRules) GetMinItems() uint64 { - if x != nil { - return x.xxx_hidden_MinItems - } - return 0 -} - -func (x *RepeatedResourceIdRules) GetMaxItems() uint64 { - if x != nil { - return x.xxx_hidden_MaxItems - } - return 0 -} - -func (x *RepeatedResourceIdRules) GetUnique() bool { - if x != nil { - return x.xxx_hidden_Unique - } - return false -} - -func (x *RepeatedResourceIdRules) GetValidateEmpty() bool { - if x != nil { - return x.xxx_hidden_ValidateEmpty - } - return false -} - -func (x *RepeatedResourceIdRules) GetIsRequired() bool { - if x != nil { - return x.xxx_hidden_IsRequired - } - return false -} - func (x *RepeatedResourceIdRules) SetAllowedResourceTypeIds(v []string) { x.xxx_hidden_AllowedResourceTypeIds = v } -func (x *RepeatedResourceIdRules) SetMinItems(v uint64) { - x.xxx_hidden_MinItems = v - protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 6) -} - -func (x *RepeatedResourceIdRules) SetMaxItems(v uint64) { - x.xxx_hidden_MaxItems = v - protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 6) -} - -func (x *RepeatedResourceIdRules) SetUnique(v bool) { - x.xxx_hidden_Unique = v -} - -func (x *RepeatedResourceIdRules) SetValidateEmpty(v bool) { - x.xxx_hidden_ValidateEmpty = v -} - -func (x *RepeatedResourceIdRules) SetIsRequired(v bool) { - x.xxx_hidden_IsRequired = v -} - -func (x *RepeatedResourceIdRules) HasMinItems() bool { - if x == nil { - return false - } - return protoimpl.X.Present(&(x.XXX_presence[0]), 1) -} - -func (x *RepeatedResourceIdRules) HasMaxItems() bool { - if x == nil { - return false - } - return protoimpl.X.Present(&(x.XXX_presence[0]), 2) -} - -func (x *RepeatedResourceIdRules) ClearMinItems() { - protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) - x.xxx_hidden_MinItems = 0 -} - -func (x *RepeatedResourceIdRules) ClearMaxItems() { - protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) - x.xxx_hidden_MaxItems = 0 -} - type RepeatedResourceIdRules_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. AllowedResourceTypeIds []string - // MinItems specifies that this field must have the specified number of - // items at a minimum - MinItems *uint64 - // MaxItems specifies that this field must have the specified number of - // items at a maximum - MaxItems *uint64 - // Unique specifies that all elements in this field must be unique. - Unique bool - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - ValidateEmpty bool - IsRequired bool } func (b0 RepeatedResourceIdRules_builder) Build() *RepeatedResourceIdRules { @@ -1675,17 +1575,6 @@ func (b0 RepeatedResourceIdRules_builder) Build() *RepeatedResourceIdRules { b, x := &b0, m0 _, _ = b, x x.xxx_hidden_AllowedResourceTypeIds = b.AllowedResourceTypeIds - if b.MinItems != nil { - protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 6) - x.xxx_hidden_MinItems = *b.MinItems - } - if b.MaxItems != nil { - protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 6) - x.xxx_hidden_MaxItems = *b.MaxItems - } - x.xxx_hidden_Unique = b.Unique - x.xxx_hidden_ValidateEmpty = b.ValidateEmpty - x.xxx_hidden_IsRequired = b.IsRequired return m0 } @@ -1778,19 +1667,9 @@ const file_c1_config_v1_rules_proto_rawDesc = "" + "\vis_required\x18\x02 \x01(\bR\n" + "isRequired\"L\n" + "\x0fResourceIDRules\x129\n" + - "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\"\x94\x02\n" + + "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\"T\n" + "\x17RepeatedResourceIdRules\x129\n" + - "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\x12 \n" + - "\tmin_items\x18\x02 \x01(\x04H\x00R\bminItems\x88\x01\x01\x12 \n" + - "\tmax_items\x18\x03 \x01(\x04H\x01R\bmaxItems\x88\x01\x01\x12\x16\n" + - "\x06unique\x18\x04 \x01(\bR\x06unique\x12%\n" + - "\x0evalidate_empty\x18\x05 \x01(\bR\rvalidateEmpty\x12\x1f\n" + - "\vis_required\x18\x06 \x01(\bR\n" + - "isRequiredB\f\n" + - "\n" + - "_min_itemsB\f\n" + - "\n" + - "_max_items*\x99\x02\n" + + "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds*\x99\x02\n" + "\x0fWellKnownString\x12!\n" + "\x1dWELL_KNOWN_STRING_UNSPECIFIED\x10\x00\x12\x1b\n" + "\x17WELL_KNOWN_STRING_EMAIL\x10\x01\x12\x1e\n" + @@ -1842,7 +1721,6 @@ func file_c1_config_v1_rules_proto_init() { } file_c1_config_v1_rules_proto_msgTypes[3].OneofWrappers = []any{} file_c1_config_v1_rules_proto_msgTypes[4].OneofWrappers = []any{} - file_c1_config_v1_rules_proto_msgTypes[7].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.go index 355888bc..9da76c41 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.go @@ -24,166 +24,15 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// RiskScore represents a risk score insight -type RiskScore struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - // The risk score value (e.g., "85", "High") - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Factors []string `protobuf:"bytes,2,rep,name=factors,proto3" json:"factors,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RiskScore) Reset() { - *x = RiskScore{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RiskScore) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RiskScore) ProtoMessage() {} - -func (x *RiskScore) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *RiskScore) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *RiskScore) GetFactors() []string { - if x != nil { - return x.Factors - } - return nil -} - -func (x *RiskScore) SetValue(v string) { - x.Value = v -} - -func (x *RiskScore) SetFactors(v []string) { - x.Factors = v -} - -type RiskScore_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - // The risk score value (e.g., "85", "High") - Value string - Factors []string -} - -func (b0 RiskScore_builder) Build() *RiskScore { - m0 := &RiskScore{} - b, x := &b0, m0 - _, _ = b, x - x.Value = b.Value - x.Factors = b.Factors - return m0 -} - -// Issue represents a security issue or vulnerability -type Issue struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - // The issue description or severity (e.g., "Critical", "CVE-2024-1234") - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Severity string `protobuf:"bytes,2,opt,name=severity,proto3" json:"severity,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Issue) Reset() { - *x = Issue{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Issue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Issue) ProtoMessage() {} - -func (x *Issue) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Issue) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Issue) GetSeverity() string { - if x != nil { - return x.Severity - } - return "" -} - -func (x *Issue) SetValue(v string) { - x.Value = v -} - -func (x *Issue) SetSeverity(v string) { - x.Severity = v -} - -type Issue_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - // The issue description or severity (e.g., "Critical", "CVE-2024-1234") - Value string - Severity string -} - -func (b0 Issue_builder) Build() *Issue { - m0 := &Issue{} - b, x := &b0, m0 - _, _ = b, x - x.Value = b.Value - x.Severity = b.Severity - return m0 -} - // SecurityInsightTrait is the trait annotation for resources with TRAIT_SECURITY_INSIGHT. // It contains the metadata for the security insight including type, value, observation time, // and the target entity (user or resource) that this insight should be bound to. type SecurityInsightTrait struct { state protoimpl.MessageState `protogen:"hybrid.v1"` - // The type and value of the insight - // - // Types that are valid to be assigned to InsightType: - // - // *SecurityInsightTrait_RiskScore - // *SecurityInsightTrait_Issue - InsightType isSecurityInsightTrait_InsightType `protobuf_oneof:"insight_type"` + // The type of insight (e.g., "crowdstrike_zta_score", "wiz_critical_vulnerability") + InsightType string `protobuf:"bytes,1,opt,name=insight_type,json=insightType,proto3" json:"insight_type,omitempty"` + // The value of the insight (e.g., "85", "High", "Critical") + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // When this insight was observed/captured from the source system ObservedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=observed_at,json=observedAt,proto3" json:"observed_at,omitempty"` // The target entity this insight should be bound to @@ -193,7 +42,6 @@ type SecurityInsightTrait struct { // *SecurityInsightTrait_User // *SecurityInsightTrait_ResourceId // *SecurityInsightTrait_ExternalResource - // *SecurityInsightTrait_AppUser Target isSecurityInsightTrait_Target `protobuf_oneof:"target"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -201,7 +49,7 @@ type SecurityInsightTrait struct { func (x *SecurityInsightTrait) Reset() { *x = SecurityInsightTrait{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -213,7 +61,7 @@ func (x *SecurityInsightTrait) String() string { func (*SecurityInsightTrait) ProtoMessage() {} func (x *SecurityInsightTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -224,29 +72,18 @@ func (x *SecurityInsightTrait) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -func (x *SecurityInsightTrait) GetInsightType() isSecurityInsightTrait_InsightType { +func (x *SecurityInsightTrait) GetInsightType() string { if x != nil { return x.InsightType } - return nil -} - -func (x *SecurityInsightTrait) GetRiskScore() *RiskScore { - if x != nil { - if x, ok := x.InsightType.(*SecurityInsightTrait_RiskScore); ok { - return x.RiskScore - } - } - return nil + return "" } -func (x *SecurityInsightTrait) GetIssue() *Issue { +func (x *SecurityInsightTrait) GetValue() string { if x != nil { - if x, ok := x.InsightType.(*SecurityInsightTrait_Issue); ok { - return x.Issue - } + return x.Value } - return nil + return "" } func (x *SecurityInsightTrait) GetObservedAt() *timestamppb.Timestamp { @@ -290,29 +127,12 @@ func (x *SecurityInsightTrait) GetExternalResource() *SecurityInsightTrait_Exter return nil } -func (x *SecurityInsightTrait) GetAppUser() *SecurityInsightTrait_AppUserTarget { - if x != nil { - if x, ok := x.Target.(*SecurityInsightTrait_AppUser); ok { - return x.AppUser - } - } - return nil -} - -func (x *SecurityInsightTrait) SetRiskScore(v *RiskScore) { - if v == nil { - x.InsightType = nil - return - } - x.InsightType = &SecurityInsightTrait_RiskScore{v} +func (x *SecurityInsightTrait) SetInsightType(v string) { + x.InsightType = v } -func (x *SecurityInsightTrait) SetIssue(v *Issue) { - if v == nil { - x.InsightType = nil - return - } - x.InsightType = &SecurityInsightTrait_Issue{v} +func (x *SecurityInsightTrait) SetValue(v string) { + x.Value = v } func (x *SecurityInsightTrait) SetObservedAt(v *timestamppb.Timestamp) { @@ -343,37 +163,6 @@ func (x *SecurityInsightTrait) SetExternalResource(v *SecurityInsightTrait_Exter x.Target = &SecurityInsightTrait_ExternalResource{v} } -func (x *SecurityInsightTrait) SetAppUser(v *SecurityInsightTrait_AppUserTarget) { - if v == nil { - x.Target = nil - return - } - x.Target = &SecurityInsightTrait_AppUser{v} -} - -func (x *SecurityInsightTrait) HasInsightType() bool { - if x == nil { - return false - } - return x.InsightType != nil -} - -func (x *SecurityInsightTrait) HasRiskScore() bool { - if x == nil { - return false - } - _, ok := x.InsightType.(*SecurityInsightTrait_RiskScore) - return ok -} - -func (x *SecurityInsightTrait) HasIssue() bool { - if x == nil { - return false - } - _, ok := x.InsightType.(*SecurityInsightTrait_Issue) - return ok -} - func (x *SecurityInsightTrait) HasObservedAt() bool { if x == nil { return false @@ -412,30 +201,6 @@ func (x *SecurityInsightTrait) HasExternalResource() bool { return ok } -func (x *SecurityInsightTrait) HasAppUser() bool { - if x == nil { - return false - } - _, ok := x.Target.(*SecurityInsightTrait_AppUser) - return ok -} - -func (x *SecurityInsightTrait) ClearInsightType() { - x.InsightType = nil -} - -func (x *SecurityInsightTrait) ClearRiskScore() { - if _, ok := x.InsightType.(*SecurityInsightTrait_RiskScore); ok { - x.InsightType = nil - } -} - -func (x *SecurityInsightTrait) ClearIssue() { - if _, ok := x.InsightType.(*SecurityInsightTrait_Issue); ok { - x.InsightType = nil - } -} - func (x *SecurityInsightTrait) ClearObservedAt() { x.ObservedAt = nil } @@ -462,35 +227,10 @@ func (x *SecurityInsightTrait) ClearExternalResource() { } } -func (x *SecurityInsightTrait) ClearAppUser() { - if _, ok := x.Target.(*SecurityInsightTrait_AppUser); ok { - x.Target = nil - } -} - -const SecurityInsightTrait_InsightType_not_set_case case_SecurityInsightTrait_InsightType = 0 -const SecurityInsightTrait_RiskScore_case case_SecurityInsightTrait_InsightType = 1 -const SecurityInsightTrait_Issue_case case_SecurityInsightTrait_InsightType = 2 - -func (x *SecurityInsightTrait) WhichInsightType() case_SecurityInsightTrait_InsightType { - if x == nil { - return SecurityInsightTrait_InsightType_not_set_case - } - switch x.InsightType.(type) { - case *SecurityInsightTrait_RiskScore: - return SecurityInsightTrait_RiskScore_case - case *SecurityInsightTrait_Issue: - return SecurityInsightTrait_Issue_case - default: - return SecurityInsightTrait_InsightType_not_set_case - } -} - const SecurityInsightTrait_Target_not_set_case case_SecurityInsightTrait_Target = 0 const SecurityInsightTrait_User_case case_SecurityInsightTrait_Target = 4 const SecurityInsightTrait_ResourceId_case case_SecurityInsightTrait_Target = 5 const SecurityInsightTrait_ExternalResource_case case_SecurityInsightTrait_Target = 6 -const SecurityInsightTrait_AppUser_case case_SecurityInsightTrait_Target = 7 func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { if x == nil { @@ -503,8 +243,6 @@ func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { return SecurityInsightTrait_ResourceId_case case *SecurityInsightTrait_ExternalResource: return SecurityInsightTrait_ExternalResource_case - case *SecurityInsightTrait_AppUser: - return SecurityInsightTrait_AppUser_case default: return SecurityInsightTrait_Target_not_set_case } @@ -513,12 +251,10 @@ func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { type SecurityInsightTrait_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - // The type and value of the insight - - // Fields of oneof InsightType: - RiskScore *RiskScore - Issue *Issue - // -- end of InsightType + // The type of insight (e.g., "crowdstrike_zta_score", "wiz_critical_vulnerability") + InsightType string + // The value of the insight (e.g., "85", "High", "Critical") + Value string // When this insight was observed/captured from the source system ObservedAt *timestamppb.Timestamp // The target entity this insight should be bound to @@ -530,8 +266,6 @@ type SecurityInsightTrait_builder struct { ResourceId *ResourceId // For binding to an AppResource by external ID ExternalResource *SecurityInsightTrait_ExternalResourceTarget - // For binding to an AppUser by email address - AppUser *SecurityInsightTrait_AppUserTarget // -- end of Target } @@ -539,12 +273,8 @@ func (b0 SecurityInsightTrait_builder) Build() *SecurityInsightTrait { m0 := &SecurityInsightTrait{} b, x := &b0, m0 _, _ = b, x - if b.RiskScore != nil { - x.InsightType = &SecurityInsightTrait_RiskScore{b.RiskScore} - } - if b.Issue != nil { - x.InsightType = &SecurityInsightTrait_Issue{b.Issue} - } + x.InsightType = b.InsightType + x.Value = b.Value x.ObservedAt = b.ObservedAt if b.User != nil { x.Target = &SecurityInsightTrait_User{b.User} @@ -555,48 +285,19 @@ func (b0 SecurityInsightTrait_builder) Build() *SecurityInsightTrait { if b.ExternalResource != nil { x.Target = &SecurityInsightTrait_ExternalResource{b.ExternalResource} } - if b.AppUser != nil { - x.Target = &SecurityInsightTrait_AppUser{b.AppUser} - } return m0 } -type case_SecurityInsightTrait_InsightType protoreflect.FieldNumber - -func (x case_SecurityInsightTrait_InsightType) String() string { - md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].Descriptor() - if x == 0 { - return "not set" - } - return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) -} - type case_SecurityInsightTrait_Target protoreflect.FieldNumber func (x case_SecurityInsightTrait_Target) String() string { - md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].Descriptor() + md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0].Descriptor() if x == 0 { return "not set" } return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) } -type isSecurityInsightTrait_InsightType interface { - isSecurityInsightTrait_InsightType() -} - -type SecurityInsightTrait_RiskScore struct { - RiskScore *RiskScore `protobuf:"bytes,1,opt,name=risk_score,json=riskScore,proto3,oneof"` -} - -type SecurityInsightTrait_Issue struct { - Issue *Issue `protobuf:"bytes,2,opt,name=issue,proto3,oneof"` -} - -func (*SecurityInsightTrait_RiskScore) isSecurityInsightTrait_InsightType() {} - -func (*SecurityInsightTrait_Issue) isSecurityInsightTrait_InsightType() {} - type isSecurityInsightTrait_Target interface { isSecurityInsightTrait_Target() } @@ -616,19 +317,12 @@ type SecurityInsightTrait_ExternalResource struct { ExternalResource *SecurityInsightTrait_ExternalResourceTarget `protobuf:"bytes,6,opt,name=external_resource,json=externalResource,proto3,oneof"` } -type SecurityInsightTrait_AppUser struct { - // For binding to an AppUser by email address - AppUser *SecurityInsightTrait_AppUserTarget `protobuf:"bytes,7,opt,name=app_user,json=appUser,proto3,oneof"` -} - func (*SecurityInsightTrait_User) isSecurityInsightTrait_Target() {} func (*SecurityInsightTrait_ResourceId) isSecurityInsightTrait_Target() {} func (*SecurityInsightTrait_ExternalResource) isSecurityInsightTrait_Target() {} -func (*SecurityInsightTrait_AppUser) isSecurityInsightTrait_Target() {} - // UserTarget identifies a user by email for resolution to a C1 User type SecurityInsightTrait_UserTarget struct { state protoimpl.MessageState `protogen:"hybrid.v1"` @@ -639,7 +333,7 @@ type SecurityInsightTrait_UserTarget struct { func (x *SecurityInsightTrait_UserTarget) Reset() { *x = SecurityInsightTrait_UserTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[3] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -651,7 +345,7 @@ func (x *SecurityInsightTrait_UserTarget) String() string { func (*SecurityInsightTrait_UserTarget) ProtoMessage() {} func (x *SecurityInsightTrait_UserTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[3] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -687,80 +381,6 @@ func (b0 SecurityInsightTrait_UserTarget_builder) Build() *SecurityInsightTrait_ return m0 } -// AppUserTarget identifies a user by email for resolution to an AppUser. -type SecurityInsightTrait_AppUserTarget struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` - // The external identifier of the user (e.g., ID, GUID, etc.) - ExternalId string `protobuf:"bytes,2,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SecurityInsightTrait_AppUserTarget) Reset() { - *x = SecurityInsightTrait_AppUserTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SecurityInsightTrait_AppUserTarget) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityInsightTrait_AppUserTarget) ProtoMessage() {} - -func (x *SecurityInsightTrait_AppUserTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *SecurityInsightTrait_AppUserTarget) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *SecurityInsightTrait_AppUserTarget) GetExternalId() string { - if x != nil { - return x.ExternalId - } - return "" -} - -func (x *SecurityInsightTrait_AppUserTarget) SetEmail(v string) { - x.Email = v -} - -func (x *SecurityInsightTrait_AppUserTarget) SetExternalId(v string) { - x.ExternalId = v -} - -type SecurityInsightTrait_AppUserTarget_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Email string - // The external identifier of the user (e.g., ID, GUID, etc.) - ExternalId string -} - -func (b0 SecurityInsightTrait_AppUserTarget_builder) Build() *SecurityInsightTrait_AppUserTarget { - m0 := &SecurityInsightTrait_AppUserTarget{} - b, x := &b0, m0 - _, _ = b, x - x.Email = b.Email - x.ExternalId = b.ExternalId - return m0 -} - // ExternalResourceTarget identifies a resource by external ID for resolution to an AppResource. // Use this when the connector doesn't sync the target resource itself. type SecurityInsightTrait_ExternalResourceTarget struct { @@ -775,7 +395,7 @@ type SecurityInsightTrait_ExternalResourceTarget struct { func (x *SecurityInsightTrait_ExternalResourceTarget) Reset() { *x = SecurityInsightTrait_ExternalResourceTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[5] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -787,7 +407,7 @@ func (x *SecurityInsightTrait_ExternalResourceTarget) String() string { func (*SecurityInsightTrait_ExternalResourceTarget) ProtoMessage() {} func (x *SecurityInsightTrait_ExternalResourceTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[5] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -842,65 +462,46 @@ var File_c1_connector_v2_annotation_security_insight_proto protoreflect.FileDesc const file_c1_connector_v2_annotation_security_insight_proto_rawDesc = "" + "\n" + - "1c1/connector/v2/annotation_security_insight.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\";\n" + - "\tRiskScore\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12\x18\n" + - "\afactors\x18\x02 \x03(\tR\afactors\"E\n" + - "\x05Issue\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12&\n" + - "\bseverity\x18\x02 \x01(\tB\n" + - "\xfaB\ar\x05 \x00(\x80\bR\bseverity\"\xae\x06\n" + - "\x14SecurityInsightTrait\x12;\n" + - "\n" + - "risk_score\x18\x01 \x01(\v2\x1a.c1.connector.v2.RiskScoreH\x00R\triskScore\x12.\n" + - "\x05issue\x18\x02 \x01(\v2\x16.c1.connector.v2.IssueH\x00R\x05issue\x12;\n" + + "1c1/connector/v2/annotation_security_insight.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"\xc9\x04\n" + + "\x14SecurityInsightTrait\x12-\n" + + "\finsight_type\x18\x01 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\vinsightType\x12 \n" + + "\x05value\x18\x02 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\x05value\x12;\n" + "\vobserved_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\n" + "observedAt\x12F\n" + - "\x04user\x18\x04 \x01(\v20.c1.connector.v2.SecurityInsightTrait.UserTargetH\x01R\x04user\x12>\n" + - "\vresource_id\x18\x05 \x01(\v2\x1b.c1.connector.v2.ResourceIdH\x01R\n" + + "\x04user\x18\x04 \x01(\v20.c1.connector.v2.SecurityInsightTrait.UserTargetH\x00R\x04user\x12>\n" + + "\vresource_id\x18\x05 \x01(\v2\x1b.c1.connector.v2.ResourceIdH\x00R\n" + "resourceId\x12k\n" + - "\x11external_resource\x18\x06 \x01(\v2<.c1.connector.v2.SecurityInsightTrait.ExternalResourceTargetH\x01R\x10externalResource\x12P\n" + - "\bapp_user\x18\a \x01(\v23.c1.connector.v2.SecurityInsightTrait.AppUserTargetH\x01R\aappUser\x1a0\n" + + "\x11external_resource\x18\x06 \x01(\v2<.c1.connector.v2.SecurityInsightTrait.ExternalResourceTargetH\x00R\x10externalResource\x1a0\n" + "\n" + "UserTarget\x12\"\n" + - "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x1a`\n" + - "\rAppUserTarget\x12\"\n" + - "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x12+\n" + - "\vexternal_id\x18\x02 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80 R\n" + - "externalId\x1am\n" + + "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x1am\n" + "\x16ExternalResourceTarget\x12+\n" + "\vexternal_id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80 R\n" + "externalId\x12&\n" + - "\bapp_hint\x18\x02 \x01(\tB\v\xfaB\br\x06(\x80\b\xd0\x01\x01R\aappHintB\x13\n" + - "\finsight_type\x12\x03\xf8B\x01B\r\n" + + "\bapp_hint\x18\x02 \x01(\tB\v\xfaB\br\x06(\x80\b\xd0\x01\x01R\aappHintB\r\n" + "\x06target\x12\x03\xf8B\x01B6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" -var file_c1_connector_v2_annotation_security_insight_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_c1_connector_v2_annotation_security_insight_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_c1_connector_v2_annotation_security_insight_proto_goTypes = []any{ - (*RiskScore)(nil), // 0: c1.connector.v2.RiskScore - (*Issue)(nil), // 1: c1.connector.v2.Issue - (*SecurityInsightTrait)(nil), // 2: c1.connector.v2.SecurityInsightTrait - (*SecurityInsightTrait_UserTarget)(nil), // 3: c1.connector.v2.SecurityInsightTrait.UserTarget - (*SecurityInsightTrait_AppUserTarget)(nil), // 4: c1.connector.v2.SecurityInsightTrait.AppUserTarget - (*SecurityInsightTrait_ExternalResourceTarget)(nil), // 5: c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp - (*ResourceId)(nil), // 7: c1.connector.v2.ResourceId + (*SecurityInsightTrait)(nil), // 0: c1.connector.v2.SecurityInsightTrait + (*SecurityInsightTrait_UserTarget)(nil), // 1: c1.connector.v2.SecurityInsightTrait.UserTarget + (*SecurityInsightTrait_ExternalResourceTarget)(nil), // 2: c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget + (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp + (*ResourceId)(nil), // 4: c1.connector.v2.ResourceId } var file_c1_connector_v2_annotation_security_insight_proto_depIdxs = []int32{ - 0, // 0: c1.connector.v2.SecurityInsightTrait.risk_score:type_name -> c1.connector.v2.RiskScore - 1, // 1: c1.connector.v2.SecurityInsightTrait.issue:type_name -> c1.connector.v2.Issue - 6, // 2: c1.connector.v2.SecurityInsightTrait.observed_at:type_name -> google.protobuf.Timestamp - 3, // 3: c1.connector.v2.SecurityInsightTrait.user:type_name -> c1.connector.v2.SecurityInsightTrait.UserTarget - 7, // 4: c1.connector.v2.SecurityInsightTrait.resource_id:type_name -> c1.connector.v2.ResourceId - 5, // 5: c1.connector.v2.SecurityInsightTrait.external_resource:type_name -> c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget - 4, // 6: c1.connector.v2.SecurityInsightTrait.app_user:type_name -> c1.connector.v2.SecurityInsightTrait.AppUserTarget - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 3, // 0: c1.connector.v2.SecurityInsightTrait.observed_at:type_name -> google.protobuf.Timestamp + 1, // 1: c1.connector.v2.SecurityInsightTrait.user:type_name -> c1.connector.v2.SecurityInsightTrait.UserTarget + 4, // 2: c1.connector.v2.SecurityInsightTrait.resource_id:type_name -> c1.connector.v2.ResourceId + 2, // 3: c1.connector.v2.SecurityInsightTrait.external_resource:type_name -> c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_c1_connector_v2_annotation_security_insight_proto_init() } @@ -909,13 +510,10 @@ func file_c1_connector_v2_annotation_security_insight_proto_init() { return } file_c1_connector_v2_resource_proto_init() - file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].OneofWrappers = []any{ - (*SecurityInsightTrait_RiskScore)(nil), - (*SecurityInsightTrait_Issue)(nil), + file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0].OneofWrappers = []any{ (*SecurityInsightTrait_User)(nil), (*SecurityInsightTrait_ResourceId)(nil), (*SecurityInsightTrait_ExternalResource)(nil), - (*SecurityInsightTrait_AppUser)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -923,7 +521,7 @@ func file_c1_connector_v2_annotation_security_insight_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_security_insight_proto_rawDesc), len(file_c1_connector_v2_annotation_security_insight_proto_rawDesc)), NumEnums: 0, - NumMessages: 6, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.validate.go index 6b83aee6..b550d79e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.validate.go @@ -35,218 +35,6 @@ var ( _ = sort.Sort ) -// Validate checks the field values on RiskScore with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *RiskScore) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RiskScore with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in RiskScoreMultiError, or nil -// if none found. -func (m *RiskScore) ValidateAll() error { - return m.validate(true) -} - -func (m *RiskScore) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Value - - if len(errors) > 0 { - return RiskScoreMultiError(errors) - } - - return nil -} - -// RiskScoreMultiError is an error wrapping multiple validation errors returned -// by RiskScore.ValidateAll() if the designated constraints aren't met. -type RiskScoreMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RiskScoreMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RiskScoreMultiError) AllErrors() []error { return m } - -// RiskScoreValidationError is the validation error returned by -// RiskScore.Validate if the designated constraints aren't met. -type RiskScoreValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RiskScoreValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RiskScoreValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RiskScoreValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RiskScoreValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RiskScoreValidationError) ErrorName() string { return "RiskScoreValidationError" } - -// Error satisfies the builtin error interface -func (e RiskScoreValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRiskScore.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RiskScoreValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RiskScoreValidationError{} - -// Validate checks the field values on Issue with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Issue) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Issue with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in IssueMultiError, or nil if none found. -func (m *Issue) ValidateAll() error { - return m.validate(true) -} - -func (m *Issue) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Value - - if l := len(m.GetSeverity()); l < 0 || l > 1024 { - err := IssueValidationError{ - field: "Severity", - reason: "value length must be between 0 and 1024 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return IssueMultiError(errors) - } - - return nil -} - -// IssueMultiError is an error wrapping multiple validation errors returned by -// Issue.ValidateAll() if the designated constraints aren't met. -type IssueMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m IssueMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m IssueMultiError) AllErrors() []error { return m } - -// IssueValidationError is the validation error returned by Issue.Validate if -// the designated constraints aren't met. -type IssueValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e IssueValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e IssueValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e IssueValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e IssueValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e IssueValidationError) ErrorName() string { return "IssueValidationError" } - -// Error satisfies the builtin error interface -func (e IssueValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sIssue.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = IssueValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = IssueValidationError{} - // Validate checks the field values on SecurityInsightTrait with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. @@ -269,6 +57,28 @@ func (m *SecurityInsightTrait) validate(all bool) error { var errors []error + if l := len(m.GetInsightType()); l < 1 || l > 1024 { + err := SecurityInsightTraitValidationError{ + field: "InsightType", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if l := len(m.GetValue()); l < 1 || l > 1024 { + err := SecurityInsightTraitValidationError{ + field: "Value", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + if all { switch v := interface{}(m.GetObservedAt()).(type) { case interface{ ValidateAll() error }: @@ -298,105 +108,6 @@ func (m *SecurityInsightTrait) validate(all bool) error { } } - oneofInsightTypePresent := false - switch v := m.InsightType.(type) { - case *SecurityInsightTrait_RiskScore: - if v == nil { - err := SecurityInsightTraitValidationError{ - field: "InsightType", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofInsightTypePresent = true - - if all { - switch v := interface{}(m.GetRiskScore()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SecurityInsightTraitValidationError{ - field: "RiskScore", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SecurityInsightTraitValidationError{ - field: "RiskScore", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRiskScore()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SecurityInsightTraitValidationError{ - field: "RiskScore", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *SecurityInsightTrait_Issue: - if v == nil { - err := SecurityInsightTraitValidationError{ - field: "InsightType", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofInsightTypePresent = true - - if all { - switch v := interface{}(m.GetIssue()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SecurityInsightTraitValidationError{ - field: "Issue", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SecurityInsightTraitValidationError{ - field: "Issue", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetIssue()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SecurityInsightTraitValidationError{ - field: "Issue", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - if !oneofInsightTypePresent { - err := SecurityInsightTraitValidationError{ - field: "InsightType", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } oneofTargetPresent := false switch v := m.Target.(type) { case *SecurityInsightTrait_User: @@ -525,48 +236,6 @@ func (m *SecurityInsightTrait) validate(all bool) error { } } - case *SecurityInsightTrait_AppUser: - if v == nil { - err := SecurityInsightTraitValidationError{ - field: "Target", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofTargetPresent = true - - if all { - switch v := interface{}(m.GetAppUser()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SecurityInsightTraitValidationError{ - field: "AppUser", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SecurityInsightTraitValidationError{ - field: "AppUser", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAppUser()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SecurityInsightTraitValidationError{ - field: "AppUser", - reason: "embedded message failed validation", - cause: err, - } - } - } - default: _ = v // ensures v is used } @@ -837,195 +506,6 @@ var _ interface { ErrorName() string } = SecurityInsightTrait_UserTargetValidationError{} -// Validate checks the field values on SecurityInsightTrait_AppUserTarget with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *SecurityInsightTrait_AppUserTarget) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SecurityInsightTrait_AppUserTarget -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// SecurityInsightTrait_AppUserTargetMultiError, or nil if none found. -func (m *SecurityInsightTrait_AppUserTarget) ValidateAll() error { - return m.validate(true) -} - -func (m *SecurityInsightTrait_AppUserTarget) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if l := len(m.GetEmail()); l < 1 || l > 1024 { - err := SecurityInsightTrait_AppUserTargetValidationError{ - field: "Email", - reason: "value length must be between 1 and 1024 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if err := m._validateEmail(m.GetEmail()); err != nil { - err = SecurityInsightTrait_AppUserTargetValidationError{ - field: "Email", - reason: "value must be a valid email address", - cause: err, - } - if !all { - return err - } - errors = append(errors, err) - } - - if l := len(m.GetExternalId()); l < 1 || l > 4096 { - err := SecurityInsightTrait_AppUserTargetValidationError{ - field: "ExternalId", - reason: "value length must be between 1 and 4096 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return SecurityInsightTrait_AppUserTargetMultiError(errors) - } - - return nil -} - -func (m *SecurityInsightTrait_AppUserTarget) _validateHostname(host string) error { - s := strings.ToLower(strings.TrimSuffix(host, ".")) - - if len(host) > 253 { - return errors.New("hostname cannot exceed 253 characters") - } - - for _, part := range strings.Split(s, ".") { - if l := len(part); l == 0 || l > 63 { - return errors.New("hostname part must be non-empty and cannot exceed 63 characters") - } - - if part[0] == '-' { - return errors.New("hostname parts cannot begin with hyphens") - } - - if part[len(part)-1] == '-' { - return errors.New("hostname parts cannot end with hyphens") - } - - for _, r := range part { - if (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' { - return fmt.Errorf("hostname parts can only contain alphanumeric characters or hyphens, got %q", string(r)) - } - } - } - - return nil -} - -func (m *SecurityInsightTrait_AppUserTarget) _validateEmail(addr string) error { - a, err := mail.ParseAddress(addr) - if err != nil { - return err - } - addr = a.Address - - if len(addr) > 254 { - return errors.New("email addresses cannot exceed 254 characters") - } - - parts := strings.SplitN(addr, "@", 2) - - if len(parts[0]) > 64 { - return errors.New("email address local phrase cannot exceed 64 characters") - } - - return m._validateHostname(parts[1]) -} - -// SecurityInsightTrait_AppUserTargetMultiError is an error wrapping multiple -// validation errors returned by -// SecurityInsightTrait_AppUserTarget.ValidateAll() if the designated -// constraints aren't met. -type SecurityInsightTrait_AppUserTargetMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SecurityInsightTrait_AppUserTargetMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m SecurityInsightTrait_AppUserTargetMultiError) AllErrors() []error { return m } - -// SecurityInsightTrait_AppUserTargetValidationError is the validation error -// returned by SecurityInsightTrait_AppUserTarget.Validate if the designated -// constraints aren't met. -type SecurityInsightTrait_AppUserTargetValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SecurityInsightTrait_AppUserTargetValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SecurityInsightTrait_AppUserTargetValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SecurityInsightTrait_AppUserTargetValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SecurityInsightTrait_AppUserTargetValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SecurityInsightTrait_AppUserTargetValidationError) ErrorName() string { - return "SecurityInsightTrait_AppUserTargetValidationError" -} - -// Error satisfies the builtin error interface -func (e SecurityInsightTrait_AppUserTargetValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sSecurityInsightTrait_AppUserTarget.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SecurityInsightTrait_AppUserTargetValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SecurityInsightTrait_AppUserTargetValidationError{} - // Validate checks the field values on // SecurityInsightTrait_ExternalResourceTarget with the rules defined in the // proto definition for this message. If any rules are violated, the first diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight_protoopaque.pb.go index e3e03b5a..184346c1 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight_protoopaque.pb.go @@ -24,167 +24,22 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// RiskScore represents a risk score insight -type RiskScore struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Value string `protobuf:"bytes,1,opt,name=value,proto3"` - xxx_hidden_Factors []string `protobuf:"bytes,2,rep,name=factors,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RiskScore) Reset() { - *x = RiskScore{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RiskScore) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RiskScore) ProtoMessage() {} - -func (x *RiskScore) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *RiskScore) GetValue() string { - if x != nil { - return x.xxx_hidden_Value - } - return "" -} - -func (x *RiskScore) GetFactors() []string { - if x != nil { - return x.xxx_hidden_Factors - } - return nil -} - -func (x *RiskScore) SetValue(v string) { - x.xxx_hidden_Value = v -} - -func (x *RiskScore) SetFactors(v []string) { - x.xxx_hidden_Factors = v -} - -type RiskScore_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - // The risk score value (e.g., "85", "High") - Value string - Factors []string -} - -func (b0 RiskScore_builder) Build() *RiskScore { - m0 := &RiskScore{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Value = b.Value - x.xxx_hidden_Factors = b.Factors - return m0 -} - -// Issue represents a security issue or vulnerability -type Issue struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Value string `protobuf:"bytes,1,opt,name=value,proto3"` - xxx_hidden_Severity string `protobuf:"bytes,2,opt,name=severity,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Issue) Reset() { - *x = Issue{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Issue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Issue) ProtoMessage() {} - -func (x *Issue) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Issue) GetValue() string { - if x != nil { - return x.xxx_hidden_Value - } - return "" -} - -func (x *Issue) GetSeverity() string { - if x != nil { - return x.xxx_hidden_Severity - } - return "" -} - -func (x *Issue) SetValue(v string) { - x.xxx_hidden_Value = v -} - -func (x *Issue) SetSeverity(v string) { - x.xxx_hidden_Severity = v -} - -type Issue_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - // The issue description or severity (e.g., "Critical", "CVE-2024-1234") - Value string - Severity string -} - -func (b0 Issue_builder) Build() *Issue { - m0 := &Issue{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Value = b.Value - x.xxx_hidden_Severity = b.Severity - return m0 -} - // SecurityInsightTrait is the trait annotation for resources with TRAIT_SECURITY_INSIGHT. // It contains the metadata for the security insight including type, value, observation time, // and the target entity (user or resource) that this insight should be bound to. type SecurityInsightTrait struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_InsightType isSecurityInsightTrait_InsightType `protobuf_oneof:"insight_type"` - xxx_hidden_ObservedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=observed_at,json=observedAt,proto3"` - xxx_hidden_Target isSecurityInsightTrait_Target `protobuf_oneof:"target"` + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_InsightType string `protobuf:"bytes,1,opt,name=insight_type,json=insightType,proto3"` + xxx_hidden_Value string `protobuf:"bytes,2,opt,name=value,proto3"` + xxx_hidden_ObservedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=observed_at,json=observedAt,proto3"` + xxx_hidden_Target isSecurityInsightTrait_Target `protobuf_oneof:"target"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SecurityInsightTrait) Reset() { *x = SecurityInsightTrait{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -196,7 +51,7 @@ func (x *SecurityInsightTrait) String() string { func (*SecurityInsightTrait) ProtoMessage() {} func (x *SecurityInsightTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -207,22 +62,18 @@ func (x *SecurityInsightTrait) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -func (x *SecurityInsightTrait) GetRiskScore() *RiskScore { +func (x *SecurityInsightTrait) GetInsightType() string { if x != nil { - if x, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_RiskScore); ok { - return x.RiskScore - } + return x.xxx_hidden_InsightType } - return nil + return "" } -func (x *SecurityInsightTrait) GetIssue() *Issue { +func (x *SecurityInsightTrait) GetValue() string { if x != nil { - if x, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_Issue); ok { - return x.Issue - } + return x.xxx_hidden_Value } - return nil + return "" } func (x *SecurityInsightTrait) GetObservedAt() *timestamppb.Timestamp { @@ -259,29 +110,12 @@ func (x *SecurityInsightTrait) GetExternalResource() *SecurityInsightTrait_Exter return nil } -func (x *SecurityInsightTrait) GetAppUser() *SecurityInsightTrait_AppUserTarget { - if x != nil { - if x, ok := x.xxx_hidden_Target.(*securityInsightTrait_AppUser); ok { - return x.AppUser - } - } - return nil +func (x *SecurityInsightTrait) SetInsightType(v string) { + x.xxx_hidden_InsightType = v } -func (x *SecurityInsightTrait) SetRiskScore(v *RiskScore) { - if v == nil { - x.xxx_hidden_InsightType = nil - return - } - x.xxx_hidden_InsightType = &securityInsightTrait_RiskScore{v} -} - -func (x *SecurityInsightTrait) SetIssue(v *Issue) { - if v == nil { - x.xxx_hidden_InsightType = nil - return - } - x.xxx_hidden_InsightType = &securityInsightTrait_Issue{v} +func (x *SecurityInsightTrait) SetValue(v string) { + x.xxx_hidden_Value = v } func (x *SecurityInsightTrait) SetObservedAt(v *timestamppb.Timestamp) { @@ -312,37 +146,6 @@ func (x *SecurityInsightTrait) SetExternalResource(v *SecurityInsightTrait_Exter x.xxx_hidden_Target = &securityInsightTrait_ExternalResource{v} } -func (x *SecurityInsightTrait) SetAppUser(v *SecurityInsightTrait_AppUserTarget) { - if v == nil { - x.xxx_hidden_Target = nil - return - } - x.xxx_hidden_Target = &securityInsightTrait_AppUser{v} -} - -func (x *SecurityInsightTrait) HasInsightType() bool { - if x == nil { - return false - } - return x.xxx_hidden_InsightType != nil -} - -func (x *SecurityInsightTrait) HasRiskScore() bool { - if x == nil { - return false - } - _, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_RiskScore) - return ok -} - -func (x *SecurityInsightTrait) HasIssue() bool { - if x == nil { - return false - } - _, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_Issue) - return ok -} - func (x *SecurityInsightTrait) HasObservedAt() bool { if x == nil { return false @@ -381,30 +184,6 @@ func (x *SecurityInsightTrait) HasExternalResource() bool { return ok } -func (x *SecurityInsightTrait) HasAppUser() bool { - if x == nil { - return false - } - _, ok := x.xxx_hidden_Target.(*securityInsightTrait_AppUser) - return ok -} - -func (x *SecurityInsightTrait) ClearInsightType() { - x.xxx_hidden_InsightType = nil -} - -func (x *SecurityInsightTrait) ClearRiskScore() { - if _, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_RiskScore); ok { - x.xxx_hidden_InsightType = nil - } -} - -func (x *SecurityInsightTrait) ClearIssue() { - if _, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_Issue); ok { - x.xxx_hidden_InsightType = nil - } -} - func (x *SecurityInsightTrait) ClearObservedAt() { x.xxx_hidden_ObservedAt = nil } @@ -431,35 +210,10 @@ func (x *SecurityInsightTrait) ClearExternalResource() { } } -func (x *SecurityInsightTrait) ClearAppUser() { - if _, ok := x.xxx_hidden_Target.(*securityInsightTrait_AppUser); ok { - x.xxx_hidden_Target = nil - } -} - -const SecurityInsightTrait_InsightType_not_set_case case_SecurityInsightTrait_InsightType = 0 -const SecurityInsightTrait_RiskScore_case case_SecurityInsightTrait_InsightType = 1 -const SecurityInsightTrait_Issue_case case_SecurityInsightTrait_InsightType = 2 - -func (x *SecurityInsightTrait) WhichInsightType() case_SecurityInsightTrait_InsightType { - if x == nil { - return SecurityInsightTrait_InsightType_not_set_case - } - switch x.xxx_hidden_InsightType.(type) { - case *securityInsightTrait_RiskScore: - return SecurityInsightTrait_RiskScore_case - case *securityInsightTrait_Issue: - return SecurityInsightTrait_Issue_case - default: - return SecurityInsightTrait_InsightType_not_set_case - } -} - const SecurityInsightTrait_Target_not_set_case case_SecurityInsightTrait_Target = 0 const SecurityInsightTrait_User_case case_SecurityInsightTrait_Target = 4 const SecurityInsightTrait_ResourceId_case case_SecurityInsightTrait_Target = 5 const SecurityInsightTrait_ExternalResource_case case_SecurityInsightTrait_Target = 6 -const SecurityInsightTrait_AppUser_case case_SecurityInsightTrait_Target = 7 func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { if x == nil { @@ -472,8 +226,6 @@ func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { return SecurityInsightTrait_ResourceId_case case *securityInsightTrait_ExternalResource: return SecurityInsightTrait_ExternalResource_case - case *securityInsightTrait_AppUser: - return SecurityInsightTrait_AppUser_case default: return SecurityInsightTrait_Target_not_set_case } @@ -482,12 +234,10 @@ func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { type SecurityInsightTrait_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - // The type and value of the insight - - // Fields of oneof xxx_hidden_InsightType: - RiskScore *RiskScore - Issue *Issue - // -- end of xxx_hidden_InsightType + // The type of insight (e.g., "crowdstrike_zta_score", "wiz_critical_vulnerability") + InsightType string + // The value of the insight (e.g., "85", "High", "Critical") + Value string // When this insight was observed/captured from the source system ObservedAt *timestamppb.Timestamp // The target entity this insight should be bound to @@ -499,8 +249,6 @@ type SecurityInsightTrait_builder struct { ResourceId *ResourceId // For binding to an AppResource by external ID ExternalResource *SecurityInsightTrait_ExternalResourceTarget - // For binding to an AppUser by email address - AppUser *SecurityInsightTrait_AppUserTarget // -- end of xxx_hidden_Target } @@ -508,12 +256,8 @@ func (b0 SecurityInsightTrait_builder) Build() *SecurityInsightTrait { m0 := &SecurityInsightTrait{} b, x := &b0, m0 _, _ = b, x - if b.RiskScore != nil { - x.xxx_hidden_InsightType = &securityInsightTrait_RiskScore{b.RiskScore} - } - if b.Issue != nil { - x.xxx_hidden_InsightType = &securityInsightTrait_Issue{b.Issue} - } + x.xxx_hidden_InsightType = b.InsightType + x.xxx_hidden_Value = b.Value x.xxx_hidden_ObservedAt = b.ObservedAt if b.User != nil { x.xxx_hidden_Target = &securityInsightTrait_User{b.User} @@ -524,48 +268,19 @@ func (b0 SecurityInsightTrait_builder) Build() *SecurityInsightTrait { if b.ExternalResource != nil { x.xxx_hidden_Target = &securityInsightTrait_ExternalResource{b.ExternalResource} } - if b.AppUser != nil { - x.xxx_hidden_Target = &securityInsightTrait_AppUser{b.AppUser} - } return m0 } -type case_SecurityInsightTrait_InsightType protoreflect.FieldNumber - -func (x case_SecurityInsightTrait_InsightType) String() string { - md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].Descriptor() - if x == 0 { - return "not set" - } - return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) -} - type case_SecurityInsightTrait_Target protoreflect.FieldNumber func (x case_SecurityInsightTrait_Target) String() string { - md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].Descriptor() + md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0].Descriptor() if x == 0 { return "not set" } return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) } -type isSecurityInsightTrait_InsightType interface { - isSecurityInsightTrait_InsightType() -} - -type securityInsightTrait_RiskScore struct { - RiskScore *RiskScore `protobuf:"bytes,1,opt,name=risk_score,json=riskScore,proto3,oneof"` -} - -type securityInsightTrait_Issue struct { - Issue *Issue `protobuf:"bytes,2,opt,name=issue,proto3,oneof"` -} - -func (*securityInsightTrait_RiskScore) isSecurityInsightTrait_InsightType() {} - -func (*securityInsightTrait_Issue) isSecurityInsightTrait_InsightType() {} - type isSecurityInsightTrait_Target interface { isSecurityInsightTrait_Target() } @@ -585,19 +300,12 @@ type securityInsightTrait_ExternalResource struct { ExternalResource *SecurityInsightTrait_ExternalResourceTarget `protobuf:"bytes,6,opt,name=external_resource,json=externalResource,proto3,oneof"` } -type securityInsightTrait_AppUser struct { - // For binding to an AppUser by email address - AppUser *SecurityInsightTrait_AppUserTarget `protobuf:"bytes,7,opt,name=app_user,json=appUser,proto3,oneof"` -} - func (*securityInsightTrait_User) isSecurityInsightTrait_Target() {} func (*securityInsightTrait_ResourceId) isSecurityInsightTrait_Target() {} func (*securityInsightTrait_ExternalResource) isSecurityInsightTrait_Target() {} -func (*securityInsightTrait_AppUser) isSecurityInsightTrait_Target() {} - // UserTarget identifies a user by email for resolution to a C1 User type SecurityInsightTrait_UserTarget struct { state protoimpl.MessageState `protogen:"opaque.v1"` @@ -608,7 +316,7 @@ type SecurityInsightTrait_UserTarget struct { func (x *SecurityInsightTrait_UserTarget) Reset() { *x = SecurityInsightTrait_UserTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[3] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -620,7 +328,7 @@ func (x *SecurityInsightTrait_UserTarget) String() string { func (*SecurityInsightTrait_UserTarget) ProtoMessage() {} func (x *SecurityInsightTrait_UserTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[3] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -656,79 +364,6 @@ func (b0 SecurityInsightTrait_UserTarget_builder) Build() *SecurityInsightTrait_ return m0 } -// AppUserTarget identifies a user by email for resolution to an AppUser. -type SecurityInsightTrait_AppUserTarget struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Email string `protobuf:"bytes,1,opt,name=email,proto3"` - xxx_hidden_ExternalId string `protobuf:"bytes,2,opt,name=external_id,json=externalId,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SecurityInsightTrait_AppUserTarget) Reset() { - *x = SecurityInsightTrait_AppUserTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SecurityInsightTrait_AppUserTarget) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityInsightTrait_AppUserTarget) ProtoMessage() {} - -func (x *SecurityInsightTrait_AppUserTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *SecurityInsightTrait_AppUserTarget) GetEmail() string { - if x != nil { - return x.xxx_hidden_Email - } - return "" -} - -func (x *SecurityInsightTrait_AppUserTarget) GetExternalId() string { - if x != nil { - return x.xxx_hidden_ExternalId - } - return "" -} - -func (x *SecurityInsightTrait_AppUserTarget) SetEmail(v string) { - x.xxx_hidden_Email = v -} - -func (x *SecurityInsightTrait_AppUserTarget) SetExternalId(v string) { - x.xxx_hidden_ExternalId = v -} - -type SecurityInsightTrait_AppUserTarget_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Email string - // The external identifier of the user (e.g., ID, GUID, etc.) - ExternalId string -} - -func (b0 SecurityInsightTrait_AppUserTarget_builder) Build() *SecurityInsightTrait_AppUserTarget { - m0 := &SecurityInsightTrait_AppUserTarget{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Email = b.Email - x.xxx_hidden_ExternalId = b.ExternalId - return m0 -} - // ExternalResourceTarget identifies a resource by external ID for resolution to an AppResource. // Use this when the connector doesn't sync the target resource itself. type SecurityInsightTrait_ExternalResourceTarget struct { @@ -741,7 +376,7 @@ type SecurityInsightTrait_ExternalResourceTarget struct { func (x *SecurityInsightTrait_ExternalResourceTarget) Reset() { *x = SecurityInsightTrait_ExternalResourceTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[5] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -753,7 +388,7 @@ func (x *SecurityInsightTrait_ExternalResourceTarget) String() string { func (*SecurityInsightTrait_ExternalResourceTarget) ProtoMessage() {} func (x *SecurityInsightTrait_ExternalResourceTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[5] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -808,65 +443,46 @@ var File_c1_connector_v2_annotation_security_insight_proto protoreflect.FileDesc const file_c1_connector_v2_annotation_security_insight_proto_rawDesc = "" + "\n" + - "1c1/connector/v2/annotation_security_insight.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\";\n" + - "\tRiskScore\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12\x18\n" + - "\afactors\x18\x02 \x03(\tR\afactors\"E\n" + - "\x05Issue\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12&\n" + - "\bseverity\x18\x02 \x01(\tB\n" + - "\xfaB\ar\x05 \x00(\x80\bR\bseverity\"\xae\x06\n" + - "\x14SecurityInsightTrait\x12;\n" + - "\n" + - "risk_score\x18\x01 \x01(\v2\x1a.c1.connector.v2.RiskScoreH\x00R\triskScore\x12.\n" + - "\x05issue\x18\x02 \x01(\v2\x16.c1.connector.v2.IssueH\x00R\x05issue\x12;\n" + + "1c1/connector/v2/annotation_security_insight.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"\xc9\x04\n" + + "\x14SecurityInsightTrait\x12-\n" + + "\finsight_type\x18\x01 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\vinsightType\x12 \n" + + "\x05value\x18\x02 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\x05value\x12;\n" + "\vobserved_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\n" + "observedAt\x12F\n" + - "\x04user\x18\x04 \x01(\v20.c1.connector.v2.SecurityInsightTrait.UserTargetH\x01R\x04user\x12>\n" + - "\vresource_id\x18\x05 \x01(\v2\x1b.c1.connector.v2.ResourceIdH\x01R\n" + + "\x04user\x18\x04 \x01(\v20.c1.connector.v2.SecurityInsightTrait.UserTargetH\x00R\x04user\x12>\n" + + "\vresource_id\x18\x05 \x01(\v2\x1b.c1.connector.v2.ResourceIdH\x00R\n" + "resourceId\x12k\n" + - "\x11external_resource\x18\x06 \x01(\v2<.c1.connector.v2.SecurityInsightTrait.ExternalResourceTargetH\x01R\x10externalResource\x12P\n" + - "\bapp_user\x18\a \x01(\v23.c1.connector.v2.SecurityInsightTrait.AppUserTargetH\x01R\aappUser\x1a0\n" + + "\x11external_resource\x18\x06 \x01(\v2<.c1.connector.v2.SecurityInsightTrait.ExternalResourceTargetH\x00R\x10externalResource\x1a0\n" + "\n" + "UserTarget\x12\"\n" + - "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x1a`\n" + - "\rAppUserTarget\x12\"\n" + - "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x12+\n" + - "\vexternal_id\x18\x02 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80 R\n" + - "externalId\x1am\n" + + "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x1am\n" + "\x16ExternalResourceTarget\x12+\n" + "\vexternal_id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80 R\n" + "externalId\x12&\n" + - "\bapp_hint\x18\x02 \x01(\tB\v\xfaB\br\x06(\x80\b\xd0\x01\x01R\aappHintB\x13\n" + - "\finsight_type\x12\x03\xf8B\x01B\r\n" + + "\bapp_hint\x18\x02 \x01(\tB\v\xfaB\br\x06(\x80\b\xd0\x01\x01R\aappHintB\r\n" + "\x06target\x12\x03\xf8B\x01B6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" -var file_c1_connector_v2_annotation_security_insight_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_c1_connector_v2_annotation_security_insight_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_c1_connector_v2_annotation_security_insight_proto_goTypes = []any{ - (*RiskScore)(nil), // 0: c1.connector.v2.RiskScore - (*Issue)(nil), // 1: c1.connector.v2.Issue - (*SecurityInsightTrait)(nil), // 2: c1.connector.v2.SecurityInsightTrait - (*SecurityInsightTrait_UserTarget)(nil), // 3: c1.connector.v2.SecurityInsightTrait.UserTarget - (*SecurityInsightTrait_AppUserTarget)(nil), // 4: c1.connector.v2.SecurityInsightTrait.AppUserTarget - (*SecurityInsightTrait_ExternalResourceTarget)(nil), // 5: c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp - (*ResourceId)(nil), // 7: c1.connector.v2.ResourceId + (*SecurityInsightTrait)(nil), // 0: c1.connector.v2.SecurityInsightTrait + (*SecurityInsightTrait_UserTarget)(nil), // 1: c1.connector.v2.SecurityInsightTrait.UserTarget + (*SecurityInsightTrait_ExternalResourceTarget)(nil), // 2: c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget + (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp + (*ResourceId)(nil), // 4: c1.connector.v2.ResourceId } var file_c1_connector_v2_annotation_security_insight_proto_depIdxs = []int32{ - 0, // 0: c1.connector.v2.SecurityInsightTrait.risk_score:type_name -> c1.connector.v2.RiskScore - 1, // 1: c1.connector.v2.SecurityInsightTrait.issue:type_name -> c1.connector.v2.Issue - 6, // 2: c1.connector.v2.SecurityInsightTrait.observed_at:type_name -> google.protobuf.Timestamp - 3, // 3: c1.connector.v2.SecurityInsightTrait.user:type_name -> c1.connector.v2.SecurityInsightTrait.UserTarget - 7, // 4: c1.connector.v2.SecurityInsightTrait.resource_id:type_name -> c1.connector.v2.ResourceId - 5, // 5: c1.connector.v2.SecurityInsightTrait.external_resource:type_name -> c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget - 4, // 6: c1.connector.v2.SecurityInsightTrait.app_user:type_name -> c1.connector.v2.SecurityInsightTrait.AppUserTarget - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 3, // 0: c1.connector.v2.SecurityInsightTrait.observed_at:type_name -> google.protobuf.Timestamp + 1, // 1: c1.connector.v2.SecurityInsightTrait.user:type_name -> c1.connector.v2.SecurityInsightTrait.UserTarget + 4, // 2: c1.connector.v2.SecurityInsightTrait.resource_id:type_name -> c1.connector.v2.ResourceId + 2, // 3: c1.connector.v2.SecurityInsightTrait.external_resource:type_name -> c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_c1_connector_v2_annotation_security_insight_proto_init() } @@ -875,13 +491,10 @@ func file_c1_connector_v2_annotation_security_insight_proto_init() { return } file_c1_connector_v2_resource_proto_init() - file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].OneofWrappers = []any{ - (*securityInsightTrait_RiskScore)(nil), - (*securityInsightTrait_Issue)(nil), + file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0].OneofWrappers = []any{ (*securityInsightTrait_User)(nil), (*securityInsightTrait_ResourceId)(nil), (*securityInsightTrait_ExternalResource)(nil), - (*securityInsightTrait_AppUser)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -889,7 +502,7 @@ func file_c1_connector_v2_annotation_security_insight_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_security_insight_proto_rawDesc), len(file_c1_connector_v2_annotation_security_insight_proto_rawDesc)), NumEnums: 0, - NumMessages: 6, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait.pb.go index 8a50448f..7b79389a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait.pb.go @@ -583,11 +583,10 @@ func (b0 GroupTrait_builder) Build() *GroupTrait { } type RoleTrait struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Profile *structpb.Struct `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` - RoleScopeConditions *RoleScopeConditions `protobuf:"bytes,2,opt,name=role_scope_conditions,json=roleScopeConditions,proto3" json:"role_scope_conditions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"hybrid.v1"` + Profile *structpb.Struct `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *RoleTrait) Reset() { @@ -622,21 +621,10 @@ func (x *RoleTrait) GetProfile() *structpb.Struct { return nil } -func (x *RoleTrait) GetRoleScopeConditions() *RoleScopeConditions { - if x != nil { - return x.RoleScopeConditions - } - return nil -} - func (x *RoleTrait) SetProfile(v *structpb.Struct) { x.Profile = v } -func (x *RoleTrait) SetRoleScopeConditions(v *RoleScopeConditions) { - x.RoleScopeConditions = v -} - func (x *RoleTrait) HasProfile() bool { if x == nil { return false @@ -644,26 +632,14 @@ func (x *RoleTrait) HasProfile() bool { return x.Profile != nil } -func (x *RoleTrait) HasRoleScopeConditions() bool { - if x == nil { - return false - } - return x.RoleScopeConditions != nil -} - func (x *RoleTrait) ClearProfile() { x.Profile = nil } -func (x *RoleTrait) ClearRoleScopeConditions() { - x.RoleScopeConditions = nil -} - type RoleTrait_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - Profile *structpb.Struct - RoleScopeConditions *RoleScopeConditions + Profile *structpb.Struct } func (b0 RoleTrait_builder) Build() *RoleTrait { @@ -671,234 +647,6 @@ func (b0 RoleTrait_builder) Build() *RoleTrait { b, x := &b0, m0 _, _ = b, x x.Profile = b.Profile - x.RoleScopeConditions = b.RoleScopeConditions - return m0 -} - -type RoleScopeConditions struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Conditions []*RoleScopeCondition `protobuf:"bytes,3,rep,name=conditions,proto3" json:"conditions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RoleScopeConditions) Reset() { - *x = RoleScopeConditions{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RoleScopeConditions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoleScopeConditions) ProtoMessage() {} - -func (x *RoleScopeConditions) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *RoleScopeConditions) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *RoleScopeConditions) GetConditions() []*RoleScopeCondition { - if x != nil { - return x.Conditions - } - return nil -} - -func (x *RoleScopeConditions) SetType(v string) { - x.Type = v -} - -func (x *RoleScopeConditions) SetConditions(v []*RoleScopeCondition) { - x.Conditions = v -} - -type RoleScopeConditions_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Type string - Conditions []*RoleScopeCondition -} - -func (b0 RoleScopeConditions_builder) Build() *RoleScopeConditions { - m0 := &RoleScopeConditions{} - b, x := &b0, m0 - _, _ = b, x - x.Type = b.Type - x.Conditions = b.Conditions - return m0 -} - -type RoleScopeCondition struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Expression string `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RoleScopeCondition) Reset() { - *x = RoleScopeCondition{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RoleScopeCondition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoleScopeCondition) ProtoMessage() {} - -func (x *RoleScopeCondition) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *RoleScopeCondition) GetExpression() string { - if x != nil { - return x.Expression - } - return "" -} - -func (x *RoleScopeCondition) SetExpression(v string) { - x.Expression = v -} - -type RoleScopeCondition_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Expression string -} - -func (b0 RoleScopeCondition_builder) Build() *RoleScopeCondition { - m0 := &RoleScopeCondition{} - b, x := &b0, m0 - _, _ = b, x - x.Expression = b.Expression - return m0 -} - -// ScopeBindingTrait is used to scope a role to a resource or set of resources. -// The scope may be static (determined at crawl time) or dynamic (determined based on conditions). -// For example, in Azure a role definition can be scoped to a subscription, management group, or resource group. -// In that case, the role ID would be the resource ID of the role definition, and the scope resource ID would be the resource ID of the subscription, management group, or resource group. -type ScopeBindingTrait struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - RoleId *ResourceId `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // The role that is scoped. Must be a resource with the role trait. - // Remove required if we add more ways to scope roles. (eg: Expressions.) - ScopeResourceId *ResourceId `protobuf:"bytes,2,opt,name=scope_resource_id,json=scopeResourceId,proto3" json:"scope_resource_id,omitempty"` // The resource that the role is scoped to. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ScopeBindingTrait) Reset() { - *x = ScopeBindingTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ScopeBindingTrait) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ScopeBindingTrait) ProtoMessage() {} - -func (x *ScopeBindingTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *ScopeBindingTrait) GetRoleId() *ResourceId { - if x != nil { - return x.RoleId - } - return nil -} - -func (x *ScopeBindingTrait) GetScopeResourceId() *ResourceId { - if x != nil { - return x.ScopeResourceId - } - return nil -} - -func (x *ScopeBindingTrait) SetRoleId(v *ResourceId) { - x.RoleId = v -} - -func (x *ScopeBindingTrait) SetScopeResourceId(v *ResourceId) { - x.ScopeResourceId = v -} - -func (x *ScopeBindingTrait) HasRoleId() bool { - if x == nil { - return false - } - return x.RoleId != nil -} - -func (x *ScopeBindingTrait) HasScopeResourceId() bool { - if x == nil { - return false - } - return x.ScopeResourceId != nil -} - -func (x *ScopeBindingTrait) ClearRoleId() { - x.RoleId = nil -} - -func (x *ScopeBindingTrait) ClearScopeResourceId() { - x.ScopeResourceId = nil -} - -type ScopeBindingTrait_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - RoleId *ResourceId - // Remove required if we add more ways to scope roles. (eg: Expressions.) - ScopeResourceId *ResourceId -} - -func (b0 ScopeBindingTrait_builder) Build() *ScopeBindingTrait { - m0 := &ScopeBindingTrait{} - b, x := &b0, m0 - _, _ = b, x - x.RoleId = b.RoleId - x.ScopeResourceId = b.ScopeResourceId return m0 } @@ -915,7 +663,7 @@ type AppTrait struct { func (x *AppTrait) Reset() { *x = AppTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -927,7 +675,7 @@ func (x *AppTrait) String() string { func (*AppTrait) ProtoMessage() {} func (x *AppTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1062,7 +810,7 @@ type SecretTrait struct { func (x *SecretTrait) Reset() { *x = SecretTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1074,7 +822,7 @@ func (x *SecretTrait) String() string { func (*SecretTrait) ProtoMessage() {} func (x *SecretTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1252,7 +1000,7 @@ type UserTrait_Email struct { func (x *UserTrait_Email) Reset() { *x = UserTrait_Email{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1264,7 +1012,7 @@ func (x *UserTrait_Email) String() string { func (*UserTrait_Email) ProtoMessage() {} func (x *UserTrait_Email) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1324,7 +1072,7 @@ type UserTrait_Status struct { func (x *UserTrait_Status) Reset() { *x = UserTrait_Status{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1336,7 +1084,7 @@ func (x *UserTrait_Status) String() string { func (*UserTrait_Status) ProtoMessage() {} func (x *UserTrait_Status) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1394,7 +1142,7 @@ type UserTrait_MFAStatus struct { func (x *UserTrait_MFAStatus) Reset() { *x = UserTrait_MFAStatus{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[10] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1406,7 +1154,7 @@ func (x *UserTrait_MFAStatus) String() string { func (*UserTrait_MFAStatus) ProtoMessage() {} func (x *UserTrait_MFAStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[10] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1451,7 +1199,7 @@ type UserTrait_SSOStatus struct { func (x *UserTrait_SSOStatus) Reset() { *x = UserTrait_SSOStatus{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[11] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1463,7 +1211,7 @@ func (x *UserTrait_SSOStatus) String() string { func (*UserTrait_SSOStatus) ProtoMessage() {} func (x *UserTrait_SSOStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[11] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1512,7 +1260,7 @@ type UserTrait_StructuredName struct { func (x *UserTrait_StructuredName) Reset() { *x = UserTrait_StructuredName{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[12] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1524,7 +1272,7 @@ func (x *UserTrait_StructuredName) String() string { func (*UserTrait_StructuredName) ProtoMessage() {} func (x *UserTrait_StructuredName) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[12] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1671,22 +1419,9 @@ const file_c1_connector_v2_annotation_trait_proto_rawDesc = "" + "\n" + "GroupTrait\x12-\n" + "\x04icon\x18\x01 \x01(\v2\x19.c1.connector.v2.AssetRefR\x04icon\x121\n" + - "\aprofile\x18\x02 \x01(\v2\x17.google.protobuf.StructR\aprofile\"\x98\x01\n" + + "\aprofile\x18\x02 \x01(\v2\x17.google.protobuf.StructR\aprofile\">\n" + "\tRoleTrait\x121\n" + - "\aprofile\x18\x01 \x01(\v2\x17.google.protobuf.StructR\aprofile\x12X\n" + - "\x15role_scope_conditions\x18\x02 \x01(\v2$.c1.connector.v2.RoleScopeConditionsR\x13roleScopeConditions\"n\n" + - "\x13RoleScopeConditions\x12\x12\n" + - "\x04type\x18\x01 \x01(\tR\x04type\x12C\n" + - "\n" + - "conditions\x18\x03 \x03(\v2#.c1.connector.v2.RoleScopeConditionR\n" + - "conditions\"4\n" + - "\x12RoleScopeCondition\x12\x1e\n" + - "\n" + - "expression\x18\x01 \x01(\tR\n" + - "expression\"\xa6\x01\n" + - "\x11ScopeBindingTrait\x12>\n" + - "\arole_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x06roleId\x12Q\n" + - "\x11scope_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x0fscopeResourceId\"\x9a\x03\n" + + "\aprofile\x18\x01 \x01(\v2\x17.google.protobuf.StructR\aprofile\"\x9a\x03\n" + "\bAppTrait\x125\n" + "\bhelp_url\x18\x01 \x01(\tB\x1a\xfaB\x17r\x15 \x01(\x80\b:\bhttps://\xd0\x01\x01\x88\x01\x01R\ahelpUrl\x12-\n" + "\x04icon\x18\x02 \x01(\v2\x19.c1.connector.v2.AssetRefR\x04icon\x12-\n" + @@ -1713,7 +1448,7 @@ const file_c1_connector_v2_annotation_trait_proto_rawDesc = "" + "identityIdB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" var file_c1_connector_v2_annotation_trait_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_c1_connector_v2_annotation_trait_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_c1_connector_v2_annotation_trait_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_c1_connector_v2_annotation_trait_proto_goTypes = []any{ (UserTrait_AccountType)(0), // 0: c1.connector.v2.UserTrait.AccountType (UserTrait_Status_Status)(0), // 1: c1.connector.v2.UserTrait.Status.Status @@ -1721,55 +1456,48 @@ var file_c1_connector_v2_annotation_trait_proto_goTypes = []any{ (*UserTrait)(nil), // 3: c1.connector.v2.UserTrait (*GroupTrait)(nil), // 4: c1.connector.v2.GroupTrait (*RoleTrait)(nil), // 5: c1.connector.v2.RoleTrait - (*RoleScopeConditions)(nil), // 6: c1.connector.v2.RoleScopeConditions - (*RoleScopeCondition)(nil), // 7: c1.connector.v2.RoleScopeCondition - (*ScopeBindingTrait)(nil), // 8: c1.connector.v2.ScopeBindingTrait - (*AppTrait)(nil), // 9: c1.connector.v2.AppTrait - (*SecretTrait)(nil), // 10: c1.connector.v2.SecretTrait - (*UserTrait_Email)(nil), // 11: c1.connector.v2.UserTrait.Email - (*UserTrait_Status)(nil), // 12: c1.connector.v2.UserTrait.Status - (*UserTrait_MFAStatus)(nil), // 13: c1.connector.v2.UserTrait.MFAStatus - (*UserTrait_SSOStatus)(nil), // 14: c1.connector.v2.UserTrait.SSOStatus - (*UserTrait_StructuredName)(nil), // 15: c1.connector.v2.UserTrait.StructuredName - (*structpb.Struct)(nil), // 16: google.protobuf.Struct - (*AssetRef)(nil), // 17: c1.connector.v2.AssetRef - (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp - (*ResourceId)(nil), // 19: c1.connector.v2.ResourceId + (*AppTrait)(nil), // 6: c1.connector.v2.AppTrait + (*SecretTrait)(nil), // 7: c1.connector.v2.SecretTrait + (*UserTrait_Email)(nil), // 8: c1.connector.v2.UserTrait.Email + (*UserTrait_Status)(nil), // 9: c1.connector.v2.UserTrait.Status + (*UserTrait_MFAStatus)(nil), // 10: c1.connector.v2.UserTrait.MFAStatus + (*UserTrait_SSOStatus)(nil), // 11: c1.connector.v2.UserTrait.SSOStatus + (*UserTrait_StructuredName)(nil), // 12: c1.connector.v2.UserTrait.StructuredName + (*structpb.Struct)(nil), // 13: google.protobuf.Struct + (*AssetRef)(nil), // 14: c1.connector.v2.AssetRef + (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp + (*ResourceId)(nil), // 16: c1.connector.v2.ResourceId } var file_c1_connector_v2_annotation_trait_proto_depIdxs = []int32{ - 11, // 0: c1.connector.v2.UserTrait.emails:type_name -> c1.connector.v2.UserTrait.Email - 12, // 1: c1.connector.v2.UserTrait.status:type_name -> c1.connector.v2.UserTrait.Status - 16, // 2: c1.connector.v2.UserTrait.profile:type_name -> google.protobuf.Struct - 17, // 3: c1.connector.v2.UserTrait.icon:type_name -> c1.connector.v2.AssetRef + 8, // 0: c1.connector.v2.UserTrait.emails:type_name -> c1.connector.v2.UserTrait.Email + 9, // 1: c1.connector.v2.UserTrait.status:type_name -> c1.connector.v2.UserTrait.Status + 13, // 2: c1.connector.v2.UserTrait.profile:type_name -> google.protobuf.Struct + 14, // 3: c1.connector.v2.UserTrait.icon:type_name -> c1.connector.v2.AssetRef 0, // 4: c1.connector.v2.UserTrait.account_type:type_name -> c1.connector.v2.UserTrait.AccountType - 18, // 5: c1.connector.v2.UserTrait.created_at:type_name -> google.protobuf.Timestamp - 18, // 6: c1.connector.v2.UserTrait.last_login:type_name -> google.protobuf.Timestamp - 13, // 7: c1.connector.v2.UserTrait.mfa_status:type_name -> c1.connector.v2.UserTrait.MFAStatus - 14, // 8: c1.connector.v2.UserTrait.sso_status:type_name -> c1.connector.v2.UserTrait.SSOStatus - 15, // 9: c1.connector.v2.UserTrait.structured_name:type_name -> c1.connector.v2.UserTrait.StructuredName - 17, // 10: c1.connector.v2.GroupTrait.icon:type_name -> c1.connector.v2.AssetRef - 16, // 11: c1.connector.v2.GroupTrait.profile:type_name -> google.protobuf.Struct - 16, // 12: c1.connector.v2.RoleTrait.profile:type_name -> google.protobuf.Struct - 6, // 13: c1.connector.v2.RoleTrait.role_scope_conditions:type_name -> c1.connector.v2.RoleScopeConditions - 7, // 14: c1.connector.v2.RoleScopeConditions.conditions:type_name -> c1.connector.v2.RoleScopeCondition - 19, // 15: c1.connector.v2.ScopeBindingTrait.role_id:type_name -> c1.connector.v2.ResourceId - 19, // 16: c1.connector.v2.ScopeBindingTrait.scope_resource_id:type_name -> c1.connector.v2.ResourceId - 17, // 17: c1.connector.v2.AppTrait.icon:type_name -> c1.connector.v2.AssetRef - 17, // 18: c1.connector.v2.AppTrait.logo:type_name -> c1.connector.v2.AssetRef - 16, // 19: c1.connector.v2.AppTrait.profile:type_name -> google.protobuf.Struct - 2, // 20: c1.connector.v2.AppTrait.flags:type_name -> c1.connector.v2.AppTrait.AppFlag - 16, // 21: c1.connector.v2.SecretTrait.profile:type_name -> google.protobuf.Struct - 18, // 22: c1.connector.v2.SecretTrait.created_at:type_name -> google.protobuf.Timestamp - 18, // 23: c1.connector.v2.SecretTrait.expires_at:type_name -> google.protobuf.Timestamp - 18, // 24: c1.connector.v2.SecretTrait.last_used_at:type_name -> google.protobuf.Timestamp - 19, // 25: c1.connector.v2.SecretTrait.created_by_id:type_name -> c1.connector.v2.ResourceId - 19, // 26: c1.connector.v2.SecretTrait.identity_id:type_name -> c1.connector.v2.ResourceId - 1, // 27: c1.connector.v2.UserTrait.Status.status:type_name -> c1.connector.v2.UserTrait.Status.Status - 28, // [28:28] is the sub-list for method output_type - 28, // [28:28] is the sub-list for method input_type - 28, // [28:28] is the sub-list for extension type_name - 28, // [28:28] is the sub-list for extension extendee - 0, // [0:28] is the sub-list for field type_name + 15, // 5: c1.connector.v2.UserTrait.created_at:type_name -> google.protobuf.Timestamp + 15, // 6: c1.connector.v2.UserTrait.last_login:type_name -> google.protobuf.Timestamp + 10, // 7: c1.connector.v2.UserTrait.mfa_status:type_name -> c1.connector.v2.UserTrait.MFAStatus + 11, // 8: c1.connector.v2.UserTrait.sso_status:type_name -> c1.connector.v2.UserTrait.SSOStatus + 12, // 9: c1.connector.v2.UserTrait.structured_name:type_name -> c1.connector.v2.UserTrait.StructuredName + 14, // 10: c1.connector.v2.GroupTrait.icon:type_name -> c1.connector.v2.AssetRef + 13, // 11: c1.connector.v2.GroupTrait.profile:type_name -> google.protobuf.Struct + 13, // 12: c1.connector.v2.RoleTrait.profile:type_name -> google.protobuf.Struct + 14, // 13: c1.connector.v2.AppTrait.icon:type_name -> c1.connector.v2.AssetRef + 14, // 14: c1.connector.v2.AppTrait.logo:type_name -> c1.connector.v2.AssetRef + 13, // 15: c1.connector.v2.AppTrait.profile:type_name -> google.protobuf.Struct + 2, // 16: c1.connector.v2.AppTrait.flags:type_name -> c1.connector.v2.AppTrait.AppFlag + 13, // 17: c1.connector.v2.SecretTrait.profile:type_name -> google.protobuf.Struct + 15, // 18: c1.connector.v2.SecretTrait.created_at:type_name -> google.protobuf.Timestamp + 15, // 19: c1.connector.v2.SecretTrait.expires_at:type_name -> google.protobuf.Timestamp + 15, // 20: c1.connector.v2.SecretTrait.last_used_at:type_name -> google.protobuf.Timestamp + 16, // 21: c1.connector.v2.SecretTrait.created_by_id:type_name -> c1.connector.v2.ResourceId + 16, // 22: c1.connector.v2.SecretTrait.identity_id:type_name -> c1.connector.v2.ResourceId + 1, // 23: c1.connector.v2.UserTrait.Status.status:type_name -> c1.connector.v2.UserTrait.Status.Status + 24, // [24:24] is the sub-list for method output_type + 24, // [24:24] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_c1_connector_v2_annotation_trait_proto_init() } @@ -1785,7 +1513,7 @@ func file_c1_connector_v2_annotation_trait_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_trait_proto_rawDesc), len(file_c1_connector_v2_annotation_trait_proto_rawDesc)), NumEnums: 3, - NumMessages: 13, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait_protoopaque.pb.go index db2e7db8..c7a4531b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait_protoopaque.pb.go @@ -583,11 +583,10 @@ func (b0 GroupTrait_builder) Build() *GroupTrait { } type RoleTrait struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Profile *structpb.Struct `protobuf:"bytes,1,opt,name=profile,proto3"` - xxx_hidden_RoleScopeConditions *RoleScopeConditions `protobuf:"bytes,2,opt,name=role_scope_conditions,json=roleScopeConditions,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Profile *structpb.Struct `protobuf:"bytes,1,opt,name=profile,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *RoleTrait) Reset() { @@ -622,21 +621,10 @@ func (x *RoleTrait) GetProfile() *structpb.Struct { return nil } -func (x *RoleTrait) GetRoleScopeConditions() *RoleScopeConditions { - if x != nil { - return x.xxx_hidden_RoleScopeConditions - } - return nil -} - func (x *RoleTrait) SetProfile(v *structpb.Struct) { x.xxx_hidden_Profile = v } -func (x *RoleTrait) SetRoleScopeConditions(v *RoleScopeConditions) { - x.xxx_hidden_RoleScopeConditions = v -} - func (x *RoleTrait) HasProfile() bool { if x == nil { return false @@ -644,26 +632,14 @@ func (x *RoleTrait) HasProfile() bool { return x.xxx_hidden_Profile != nil } -func (x *RoleTrait) HasRoleScopeConditions() bool { - if x == nil { - return false - } - return x.xxx_hidden_RoleScopeConditions != nil -} - func (x *RoleTrait) ClearProfile() { x.xxx_hidden_Profile = nil } -func (x *RoleTrait) ClearRoleScopeConditions() { - x.xxx_hidden_RoleScopeConditions = nil -} - type RoleTrait_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - Profile *structpb.Struct - RoleScopeConditions *RoleScopeConditions + Profile *structpb.Struct } func (b0 RoleTrait_builder) Build() *RoleTrait { @@ -671,235 +647,6 @@ func (b0 RoleTrait_builder) Build() *RoleTrait { b, x := &b0, m0 _, _ = b, x x.xxx_hidden_Profile = b.Profile - x.xxx_hidden_RoleScopeConditions = b.RoleScopeConditions - return m0 -} - -type RoleScopeConditions struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Type string `protobuf:"bytes,1,opt,name=type,proto3"` - xxx_hidden_Conditions *[]*RoleScopeCondition `protobuf:"bytes,3,rep,name=conditions,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RoleScopeConditions) Reset() { - *x = RoleScopeConditions{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RoleScopeConditions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoleScopeConditions) ProtoMessage() {} - -func (x *RoleScopeConditions) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *RoleScopeConditions) GetType() string { - if x != nil { - return x.xxx_hidden_Type - } - return "" -} - -func (x *RoleScopeConditions) GetConditions() []*RoleScopeCondition { - if x != nil { - if x.xxx_hidden_Conditions != nil { - return *x.xxx_hidden_Conditions - } - } - return nil -} - -func (x *RoleScopeConditions) SetType(v string) { - x.xxx_hidden_Type = v -} - -func (x *RoleScopeConditions) SetConditions(v []*RoleScopeCondition) { - x.xxx_hidden_Conditions = &v -} - -type RoleScopeConditions_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Type string - Conditions []*RoleScopeCondition -} - -func (b0 RoleScopeConditions_builder) Build() *RoleScopeConditions { - m0 := &RoleScopeConditions{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Type = b.Type - x.xxx_hidden_Conditions = &b.Conditions - return m0 -} - -type RoleScopeCondition struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Expression string `protobuf:"bytes,1,opt,name=expression,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RoleScopeCondition) Reset() { - *x = RoleScopeCondition{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RoleScopeCondition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoleScopeCondition) ProtoMessage() {} - -func (x *RoleScopeCondition) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *RoleScopeCondition) GetExpression() string { - if x != nil { - return x.xxx_hidden_Expression - } - return "" -} - -func (x *RoleScopeCondition) SetExpression(v string) { - x.xxx_hidden_Expression = v -} - -type RoleScopeCondition_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Expression string -} - -func (b0 RoleScopeCondition_builder) Build() *RoleScopeCondition { - m0 := &RoleScopeCondition{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Expression = b.Expression - return m0 -} - -// ScopeBindingTrait is used to scope a role to a resource or set of resources. -// The scope may be static (determined at crawl time) or dynamic (determined based on conditions). -// For example, in Azure a role definition can be scoped to a subscription, management group, or resource group. -// In that case, the role ID would be the resource ID of the role definition, and the scope resource ID would be the resource ID of the subscription, management group, or resource group. -type ScopeBindingTrait struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_RoleId *ResourceId `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3"` - xxx_hidden_ScopeResourceId *ResourceId `protobuf:"bytes,2,opt,name=scope_resource_id,json=scopeResourceId,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ScopeBindingTrait) Reset() { - *x = ScopeBindingTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ScopeBindingTrait) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ScopeBindingTrait) ProtoMessage() {} - -func (x *ScopeBindingTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *ScopeBindingTrait) GetRoleId() *ResourceId { - if x != nil { - return x.xxx_hidden_RoleId - } - return nil -} - -func (x *ScopeBindingTrait) GetScopeResourceId() *ResourceId { - if x != nil { - return x.xxx_hidden_ScopeResourceId - } - return nil -} - -func (x *ScopeBindingTrait) SetRoleId(v *ResourceId) { - x.xxx_hidden_RoleId = v -} - -func (x *ScopeBindingTrait) SetScopeResourceId(v *ResourceId) { - x.xxx_hidden_ScopeResourceId = v -} - -func (x *ScopeBindingTrait) HasRoleId() bool { - if x == nil { - return false - } - return x.xxx_hidden_RoleId != nil -} - -func (x *ScopeBindingTrait) HasScopeResourceId() bool { - if x == nil { - return false - } - return x.xxx_hidden_ScopeResourceId != nil -} - -func (x *ScopeBindingTrait) ClearRoleId() { - x.xxx_hidden_RoleId = nil -} - -func (x *ScopeBindingTrait) ClearScopeResourceId() { - x.xxx_hidden_ScopeResourceId = nil -} - -type ScopeBindingTrait_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - RoleId *ResourceId - // Remove required if we add more ways to scope roles. (eg: Expressions.) - ScopeResourceId *ResourceId -} - -func (b0 ScopeBindingTrait_builder) Build() *ScopeBindingTrait { - m0 := &ScopeBindingTrait{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_RoleId = b.RoleId - x.xxx_hidden_ScopeResourceId = b.ScopeResourceId return m0 } @@ -916,7 +663,7 @@ type AppTrait struct { func (x *AppTrait) Reset() { *x = AppTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -928,7 +675,7 @@ func (x *AppTrait) String() string { func (*AppTrait) ProtoMessage() {} func (x *AppTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1063,7 +810,7 @@ type SecretTrait struct { func (x *SecretTrait) Reset() { *x = SecretTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1075,7 +822,7 @@ func (x *SecretTrait) String() string { func (*SecretTrait) ProtoMessage() {} func (x *SecretTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1252,7 +999,7 @@ type UserTrait_Email struct { func (x *UserTrait_Email) Reset() { *x = UserTrait_Email{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1264,7 +1011,7 @@ func (x *UserTrait_Email) String() string { func (*UserTrait_Email) ProtoMessage() {} func (x *UserTrait_Email) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1324,7 +1071,7 @@ type UserTrait_Status struct { func (x *UserTrait_Status) Reset() { *x = UserTrait_Status{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1336,7 +1083,7 @@ func (x *UserTrait_Status) String() string { func (*UserTrait_Status) ProtoMessage() {} func (x *UserTrait_Status) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1394,7 +1141,7 @@ type UserTrait_MFAStatus struct { func (x *UserTrait_MFAStatus) Reset() { *x = UserTrait_MFAStatus{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[10] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1406,7 +1153,7 @@ func (x *UserTrait_MFAStatus) String() string { func (*UserTrait_MFAStatus) ProtoMessage() {} func (x *UserTrait_MFAStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[10] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1451,7 +1198,7 @@ type UserTrait_SSOStatus struct { func (x *UserTrait_SSOStatus) Reset() { *x = UserTrait_SSOStatus{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[11] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1463,7 +1210,7 @@ func (x *UserTrait_SSOStatus) String() string { func (*UserTrait_SSOStatus) ProtoMessage() {} func (x *UserTrait_SSOStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[11] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1512,7 +1259,7 @@ type UserTrait_StructuredName struct { func (x *UserTrait_StructuredName) Reset() { *x = UserTrait_StructuredName{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[12] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1524,7 +1271,7 @@ func (x *UserTrait_StructuredName) String() string { func (*UserTrait_StructuredName) ProtoMessage() {} func (x *UserTrait_StructuredName) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[12] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1671,22 +1418,9 @@ const file_c1_connector_v2_annotation_trait_proto_rawDesc = "" + "\n" + "GroupTrait\x12-\n" + "\x04icon\x18\x01 \x01(\v2\x19.c1.connector.v2.AssetRefR\x04icon\x121\n" + - "\aprofile\x18\x02 \x01(\v2\x17.google.protobuf.StructR\aprofile\"\x98\x01\n" + + "\aprofile\x18\x02 \x01(\v2\x17.google.protobuf.StructR\aprofile\">\n" + "\tRoleTrait\x121\n" + - "\aprofile\x18\x01 \x01(\v2\x17.google.protobuf.StructR\aprofile\x12X\n" + - "\x15role_scope_conditions\x18\x02 \x01(\v2$.c1.connector.v2.RoleScopeConditionsR\x13roleScopeConditions\"n\n" + - "\x13RoleScopeConditions\x12\x12\n" + - "\x04type\x18\x01 \x01(\tR\x04type\x12C\n" + - "\n" + - "conditions\x18\x03 \x03(\v2#.c1.connector.v2.RoleScopeConditionR\n" + - "conditions\"4\n" + - "\x12RoleScopeCondition\x12\x1e\n" + - "\n" + - "expression\x18\x01 \x01(\tR\n" + - "expression\"\xa6\x01\n" + - "\x11ScopeBindingTrait\x12>\n" + - "\arole_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x06roleId\x12Q\n" + - "\x11scope_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x0fscopeResourceId\"\x9a\x03\n" + + "\aprofile\x18\x01 \x01(\v2\x17.google.protobuf.StructR\aprofile\"\x9a\x03\n" + "\bAppTrait\x125\n" + "\bhelp_url\x18\x01 \x01(\tB\x1a\xfaB\x17r\x15 \x01(\x80\b:\bhttps://\xd0\x01\x01\x88\x01\x01R\ahelpUrl\x12-\n" + "\x04icon\x18\x02 \x01(\v2\x19.c1.connector.v2.AssetRefR\x04icon\x12-\n" + @@ -1713,7 +1447,7 @@ const file_c1_connector_v2_annotation_trait_proto_rawDesc = "" + "identityIdB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" var file_c1_connector_v2_annotation_trait_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_c1_connector_v2_annotation_trait_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_c1_connector_v2_annotation_trait_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_c1_connector_v2_annotation_trait_proto_goTypes = []any{ (UserTrait_AccountType)(0), // 0: c1.connector.v2.UserTrait.AccountType (UserTrait_Status_Status)(0), // 1: c1.connector.v2.UserTrait.Status.Status @@ -1721,55 +1455,48 @@ var file_c1_connector_v2_annotation_trait_proto_goTypes = []any{ (*UserTrait)(nil), // 3: c1.connector.v2.UserTrait (*GroupTrait)(nil), // 4: c1.connector.v2.GroupTrait (*RoleTrait)(nil), // 5: c1.connector.v2.RoleTrait - (*RoleScopeConditions)(nil), // 6: c1.connector.v2.RoleScopeConditions - (*RoleScopeCondition)(nil), // 7: c1.connector.v2.RoleScopeCondition - (*ScopeBindingTrait)(nil), // 8: c1.connector.v2.ScopeBindingTrait - (*AppTrait)(nil), // 9: c1.connector.v2.AppTrait - (*SecretTrait)(nil), // 10: c1.connector.v2.SecretTrait - (*UserTrait_Email)(nil), // 11: c1.connector.v2.UserTrait.Email - (*UserTrait_Status)(nil), // 12: c1.connector.v2.UserTrait.Status - (*UserTrait_MFAStatus)(nil), // 13: c1.connector.v2.UserTrait.MFAStatus - (*UserTrait_SSOStatus)(nil), // 14: c1.connector.v2.UserTrait.SSOStatus - (*UserTrait_StructuredName)(nil), // 15: c1.connector.v2.UserTrait.StructuredName - (*structpb.Struct)(nil), // 16: google.protobuf.Struct - (*AssetRef)(nil), // 17: c1.connector.v2.AssetRef - (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp - (*ResourceId)(nil), // 19: c1.connector.v2.ResourceId + (*AppTrait)(nil), // 6: c1.connector.v2.AppTrait + (*SecretTrait)(nil), // 7: c1.connector.v2.SecretTrait + (*UserTrait_Email)(nil), // 8: c1.connector.v2.UserTrait.Email + (*UserTrait_Status)(nil), // 9: c1.connector.v2.UserTrait.Status + (*UserTrait_MFAStatus)(nil), // 10: c1.connector.v2.UserTrait.MFAStatus + (*UserTrait_SSOStatus)(nil), // 11: c1.connector.v2.UserTrait.SSOStatus + (*UserTrait_StructuredName)(nil), // 12: c1.connector.v2.UserTrait.StructuredName + (*structpb.Struct)(nil), // 13: google.protobuf.Struct + (*AssetRef)(nil), // 14: c1.connector.v2.AssetRef + (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp + (*ResourceId)(nil), // 16: c1.connector.v2.ResourceId } var file_c1_connector_v2_annotation_trait_proto_depIdxs = []int32{ - 11, // 0: c1.connector.v2.UserTrait.emails:type_name -> c1.connector.v2.UserTrait.Email - 12, // 1: c1.connector.v2.UserTrait.status:type_name -> c1.connector.v2.UserTrait.Status - 16, // 2: c1.connector.v2.UserTrait.profile:type_name -> google.protobuf.Struct - 17, // 3: c1.connector.v2.UserTrait.icon:type_name -> c1.connector.v2.AssetRef + 8, // 0: c1.connector.v2.UserTrait.emails:type_name -> c1.connector.v2.UserTrait.Email + 9, // 1: c1.connector.v2.UserTrait.status:type_name -> c1.connector.v2.UserTrait.Status + 13, // 2: c1.connector.v2.UserTrait.profile:type_name -> google.protobuf.Struct + 14, // 3: c1.connector.v2.UserTrait.icon:type_name -> c1.connector.v2.AssetRef 0, // 4: c1.connector.v2.UserTrait.account_type:type_name -> c1.connector.v2.UserTrait.AccountType - 18, // 5: c1.connector.v2.UserTrait.created_at:type_name -> google.protobuf.Timestamp - 18, // 6: c1.connector.v2.UserTrait.last_login:type_name -> google.protobuf.Timestamp - 13, // 7: c1.connector.v2.UserTrait.mfa_status:type_name -> c1.connector.v2.UserTrait.MFAStatus - 14, // 8: c1.connector.v2.UserTrait.sso_status:type_name -> c1.connector.v2.UserTrait.SSOStatus - 15, // 9: c1.connector.v2.UserTrait.structured_name:type_name -> c1.connector.v2.UserTrait.StructuredName - 17, // 10: c1.connector.v2.GroupTrait.icon:type_name -> c1.connector.v2.AssetRef - 16, // 11: c1.connector.v2.GroupTrait.profile:type_name -> google.protobuf.Struct - 16, // 12: c1.connector.v2.RoleTrait.profile:type_name -> google.protobuf.Struct - 6, // 13: c1.connector.v2.RoleTrait.role_scope_conditions:type_name -> c1.connector.v2.RoleScopeConditions - 7, // 14: c1.connector.v2.RoleScopeConditions.conditions:type_name -> c1.connector.v2.RoleScopeCondition - 19, // 15: c1.connector.v2.ScopeBindingTrait.role_id:type_name -> c1.connector.v2.ResourceId - 19, // 16: c1.connector.v2.ScopeBindingTrait.scope_resource_id:type_name -> c1.connector.v2.ResourceId - 17, // 17: c1.connector.v2.AppTrait.icon:type_name -> c1.connector.v2.AssetRef - 17, // 18: c1.connector.v2.AppTrait.logo:type_name -> c1.connector.v2.AssetRef - 16, // 19: c1.connector.v2.AppTrait.profile:type_name -> google.protobuf.Struct - 2, // 20: c1.connector.v2.AppTrait.flags:type_name -> c1.connector.v2.AppTrait.AppFlag - 16, // 21: c1.connector.v2.SecretTrait.profile:type_name -> google.protobuf.Struct - 18, // 22: c1.connector.v2.SecretTrait.created_at:type_name -> google.protobuf.Timestamp - 18, // 23: c1.connector.v2.SecretTrait.expires_at:type_name -> google.protobuf.Timestamp - 18, // 24: c1.connector.v2.SecretTrait.last_used_at:type_name -> google.protobuf.Timestamp - 19, // 25: c1.connector.v2.SecretTrait.created_by_id:type_name -> c1.connector.v2.ResourceId - 19, // 26: c1.connector.v2.SecretTrait.identity_id:type_name -> c1.connector.v2.ResourceId - 1, // 27: c1.connector.v2.UserTrait.Status.status:type_name -> c1.connector.v2.UserTrait.Status.Status - 28, // [28:28] is the sub-list for method output_type - 28, // [28:28] is the sub-list for method input_type - 28, // [28:28] is the sub-list for extension type_name - 28, // [28:28] is the sub-list for extension extendee - 0, // [0:28] is the sub-list for field type_name + 15, // 5: c1.connector.v2.UserTrait.created_at:type_name -> google.protobuf.Timestamp + 15, // 6: c1.connector.v2.UserTrait.last_login:type_name -> google.protobuf.Timestamp + 10, // 7: c1.connector.v2.UserTrait.mfa_status:type_name -> c1.connector.v2.UserTrait.MFAStatus + 11, // 8: c1.connector.v2.UserTrait.sso_status:type_name -> c1.connector.v2.UserTrait.SSOStatus + 12, // 9: c1.connector.v2.UserTrait.structured_name:type_name -> c1.connector.v2.UserTrait.StructuredName + 14, // 10: c1.connector.v2.GroupTrait.icon:type_name -> c1.connector.v2.AssetRef + 13, // 11: c1.connector.v2.GroupTrait.profile:type_name -> google.protobuf.Struct + 13, // 12: c1.connector.v2.RoleTrait.profile:type_name -> google.protobuf.Struct + 14, // 13: c1.connector.v2.AppTrait.icon:type_name -> c1.connector.v2.AssetRef + 14, // 14: c1.connector.v2.AppTrait.logo:type_name -> c1.connector.v2.AssetRef + 13, // 15: c1.connector.v2.AppTrait.profile:type_name -> google.protobuf.Struct + 2, // 16: c1.connector.v2.AppTrait.flags:type_name -> c1.connector.v2.AppTrait.AppFlag + 13, // 17: c1.connector.v2.SecretTrait.profile:type_name -> google.protobuf.Struct + 15, // 18: c1.connector.v2.SecretTrait.created_at:type_name -> google.protobuf.Timestamp + 15, // 19: c1.connector.v2.SecretTrait.expires_at:type_name -> google.protobuf.Timestamp + 15, // 20: c1.connector.v2.SecretTrait.last_used_at:type_name -> google.protobuf.Timestamp + 16, // 21: c1.connector.v2.SecretTrait.created_by_id:type_name -> c1.connector.v2.ResourceId + 16, // 22: c1.connector.v2.SecretTrait.identity_id:type_name -> c1.connector.v2.ResourceId + 1, // 23: c1.connector.v2.UserTrait.Status.status:type_name -> c1.connector.v2.UserTrait.Status.Status + 24, // [24:24] is the sub-list for method output_type + 24, // [24:24] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_c1_connector_v2_annotation_trait_proto_init() } @@ -1785,7 +1512,7 @@ func file_c1_connector_v2_annotation_trait_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_trait_proto_rawDesc), len(file_c1_connector_v2_annotation_trait_proto_rawDesc)), NumEnums: 3, - NumMessages: 13, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go index 8795297d..21ac6d98 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go @@ -28,20 +28,19 @@ const ( type Capability int32 const ( - Capability_CAPABILITY_UNSPECIFIED Capability = 0 - Capability_CAPABILITY_PROVISION Capability = 1 - Capability_CAPABILITY_SYNC Capability = 2 - Capability_CAPABILITY_EVENT_FEED Capability = 3 - Capability_CAPABILITY_TICKETING Capability = 4 - Capability_CAPABILITY_ACCOUNT_PROVISIONING Capability = 5 - Capability_CAPABILITY_CREDENTIAL_ROTATION Capability = 6 - Capability_CAPABILITY_RESOURCE_CREATE Capability = 7 - Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 - Capability_CAPABILITY_SYNC_SECRETS Capability = 9 - Capability_CAPABILITY_ACTIONS Capability = 10 - Capability_CAPABILITY_TARGETED_SYNC Capability = 11 - Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 - Capability_CAPABILITY_SERVICE_MODE_TARGETED_SYNC Capability = 13 + Capability_CAPABILITY_UNSPECIFIED Capability = 0 + Capability_CAPABILITY_PROVISION Capability = 1 + Capability_CAPABILITY_SYNC Capability = 2 + Capability_CAPABILITY_EVENT_FEED Capability = 3 + Capability_CAPABILITY_TICKETING Capability = 4 + Capability_CAPABILITY_ACCOUNT_PROVISIONING Capability = 5 + Capability_CAPABILITY_CREDENTIAL_ROTATION Capability = 6 + Capability_CAPABILITY_RESOURCE_CREATE Capability = 7 + Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 + Capability_CAPABILITY_SYNC_SECRETS Capability = 9 + Capability_CAPABILITY_ACTIONS Capability = 10 + Capability_CAPABILITY_TARGETED_SYNC Capability = 11 + Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 ) // Enum value maps for Capability. @@ -60,23 +59,21 @@ var ( 10: "CAPABILITY_ACTIONS", 11: "CAPABILITY_TARGETED_SYNC", 12: "CAPABILITY_EVENT_FEED_V2", - 13: "CAPABILITY_SERVICE_MODE_TARGETED_SYNC", } Capability_value = map[string]int32{ - "CAPABILITY_UNSPECIFIED": 0, - "CAPABILITY_PROVISION": 1, - "CAPABILITY_SYNC": 2, - "CAPABILITY_EVENT_FEED": 3, - "CAPABILITY_TICKETING": 4, - "CAPABILITY_ACCOUNT_PROVISIONING": 5, - "CAPABILITY_CREDENTIAL_ROTATION": 6, - "CAPABILITY_RESOURCE_CREATE": 7, - "CAPABILITY_RESOURCE_DELETE": 8, - "CAPABILITY_SYNC_SECRETS": 9, - "CAPABILITY_ACTIONS": 10, - "CAPABILITY_TARGETED_SYNC": 11, - "CAPABILITY_EVENT_FEED_V2": 12, - "CAPABILITY_SERVICE_MODE_TARGETED_SYNC": 13, + "CAPABILITY_UNSPECIFIED": 0, + "CAPABILITY_PROVISION": 1, + "CAPABILITY_SYNC": 2, + "CAPABILITY_EVENT_FEED": 3, + "CAPABILITY_TICKETING": 4, + "CAPABILITY_ACCOUNT_PROVISIONING": 5, + "CAPABILITY_CREDENTIAL_ROTATION": 6, + "CAPABILITY_RESOURCE_CREATE": 7, + "CAPABILITY_RESOURCE_DELETE": 8, + "CAPABILITY_SYNC_SECRETS": 9, + "CAPABILITY_ACTIONS": 10, + "CAPABILITY_TARGETED_SYNC": 11, + "CAPABILITY_EVENT_FEED_V2": 12, } ) @@ -2154,7 +2151,7 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\rdefault_value\x18\x01 \x03(\v2J.c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntryR\fdefaultValue\x1av\n" + "\x11DefaultValueEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12K\n" + - "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\xb1\x03\n" + + "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\x86\x03\n" + "\n" + "Capability\x12\x1a\n" + "\x16CAPABILITY_UNSPECIFIED\x10\x00\x12\x18\n" + @@ -2170,8 +2167,7 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x12CAPABILITY_ACTIONS\x10\n" + "\x12\x1c\n" + "\x18CAPABILITY_TARGETED_SYNC\x10\v\x12\x1c\n" + - "\x18CAPABILITY_EVENT_FEED_V2\x10\f\x12)\n" + - "%CAPABILITY_SERVICE_MODE_TARGETED_SYNC\x10\r*\xae\x02\n" + + "\x18CAPABILITY_EVENT_FEED_V2\x10\f*\xae\x02\n" + " CapabilityDetailCredentialOption\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED\x10\x00\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD\x10\x01\x127\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go index 2025995c..e8ec7de5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go @@ -28,20 +28,19 @@ const ( type Capability int32 const ( - Capability_CAPABILITY_UNSPECIFIED Capability = 0 - Capability_CAPABILITY_PROVISION Capability = 1 - Capability_CAPABILITY_SYNC Capability = 2 - Capability_CAPABILITY_EVENT_FEED Capability = 3 - Capability_CAPABILITY_TICKETING Capability = 4 - Capability_CAPABILITY_ACCOUNT_PROVISIONING Capability = 5 - Capability_CAPABILITY_CREDENTIAL_ROTATION Capability = 6 - Capability_CAPABILITY_RESOURCE_CREATE Capability = 7 - Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 - Capability_CAPABILITY_SYNC_SECRETS Capability = 9 - Capability_CAPABILITY_ACTIONS Capability = 10 - Capability_CAPABILITY_TARGETED_SYNC Capability = 11 - Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 - Capability_CAPABILITY_SERVICE_MODE_TARGETED_SYNC Capability = 13 + Capability_CAPABILITY_UNSPECIFIED Capability = 0 + Capability_CAPABILITY_PROVISION Capability = 1 + Capability_CAPABILITY_SYNC Capability = 2 + Capability_CAPABILITY_EVENT_FEED Capability = 3 + Capability_CAPABILITY_TICKETING Capability = 4 + Capability_CAPABILITY_ACCOUNT_PROVISIONING Capability = 5 + Capability_CAPABILITY_CREDENTIAL_ROTATION Capability = 6 + Capability_CAPABILITY_RESOURCE_CREATE Capability = 7 + Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 + Capability_CAPABILITY_SYNC_SECRETS Capability = 9 + Capability_CAPABILITY_ACTIONS Capability = 10 + Capability_CAPABILITY_TARGETED_SYNC Capability = 11 + Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 ) // Enum value maps for Capability. @@ -60,23 +59,21 @@ var ( 10: "CAPABILITY_ACTIONS", 11: "CAPABILITY_TARGETED_SYNC", 12: "CAPABILITY_EVENT_FEED_V2", - 13: "CAPABILITY_SERVICE_MODE_TARGETED_SYNC", } Capability_value = map[string]int32{ - "CAPABILITY_UNSPECIFIED": 0, - "CAPABILITY_PROVISION": 1, - "CAPABILITY_SYNC": 2, - "CAPABILITY_EVENT_FEED": 3, - "CAPABILITY_TICKETING": 4, - "CAPABILITY_ACCOUNT_PROVISIONING": 5, - "CAPABILITY_CREDENTIAL_ROTATION": 6, - "CAPABILITY_RESOURCE_CREATE": 7, - "CAPABILITY_RESOURCE_DELETE": 8, - "CAPABILITY_SYNC_SECRETS": 9, - "CAPABILITY_ACTIONS": 10, - "CAPABILITY_TARGETED_SYNC": 11, - "CAPABILITY_EVENT_FEED_V2": 12, - "CAPABILITY_SERVICE_MODE_TARGETED_SYNC": 13, + "CAPABILITY_UNSPECIFIED": 0, + "CAPABILITY_PROVISION": 1, + "CAPABILITY_SYNC": 2, + "CAPABILITY_EVENT_FEED": 3, + "CAPABILITY_TICKETING": 4, + "CAPABILITY_ACCOUNT_PROVISIONING": 5, + "CAPABILITY_CREDENTIAL_ROTATION": 6, + "CAPABILITY_RESOURCE_CREATE": 7, + "CAPABILITY_RESOURCE_DELETE": 8, + "CAPABILITY_SYNC_SECRETS": 9, + "CAPABILITY_ACTIONS": 10, + "CAPABILITY_TARGETED_SYNC": 11, + "CAPABILITY_EVENT_FEED_V2": 12, } ) @@ -2176,7 +2173,7 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\rdefault_value\x18\x01 \x03(\v2J.c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntryR\fdefaultValue\x1av\n" + "\x11DefaultValueEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12K\n" + - "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\xb1\x03\n" + + "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\x86\x03\n" + "\n" + "Capability\x12\x1a\n" + "\x16CAPABILITY_UNSPECIFIED\x10\x00\x12\x18\n" + @@ -2192,8 +2189,7 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x12CAPABILITY_ACTIONS\x10\n" + "\x12\x1c\n" + "\x18CAPABILITY_TARGETED_SYNC\x10\v\x12\x1c\n" + - "\x18CAPABILITY_EVENT_FEED_V2\x10\f\x12)\n" + - "%CAPABILITY_SERVICE_MODE_TARGETED_SYNC\x10\r*\xae\x02\n" + + "\x18CAPABILITY_EVENT_FEED_V2\x10\f*\xae\x02\n" + " CapabilityDetailCredentialOption\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED\x10\x00\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD\x10\x01\x127\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement.pb.go index d1926c4a..fca3e908 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement.pb.go @@ -30,7 +30,6 @@ const ( Entitlement_PURPOSE_VALUE_UNSPECIFIED Entitlement_PurposeValue = 0 Entitlement_PURPOSE_VALUE_ASSIGNMENT Entitlement_PurposeValue = 1 Entitlement_PURPOSE_VALUE_PERMISSION Entitlement_PurposeValue = 2 - Entitlement_PURPOSE_VALUE_OWNERSHIP Entitlement_PurposeValue = 3 ) // Enum value maps for Entitlement_PurposeValue. @@ -39,13 +38,11 @@ var ( 0: "PURPOSE_VALUE_UNSPECIFIED", 1: "PURPOSE_VALUE_ASSIGNMENT", 2: "PURPOSE_VALUE_PERMISSION", - 3: "PURPOSE_VALUE_OWNERSHIP", } Entitlement_PurposeValue_value = map[string]int32{ "PURPOSE_VALUE_UNSPECIFIED": 0, "PURPOSE_VALUE_ASSIGNMENT": 1, "PURPOSE_VALUE_PERMISSION": 2, - "PURPOSE_VALUE_OWNERSHIP": 3, } ) @@ -648,7 +645,7 @@ var File_c1_connector_v2_entitlement_proto protoreflect.FileDescriptor const file_c1_connector_v2_entitlement_proto_rawDesc = "" + "\n" + - "!c1/connector/v2/entitlement.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x17validate/validate.proto\"\xb3\x04\n" + + "!c1/connector/v2/entitlement.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x17validate/validate.proto\"\x95\x04\n" + "\vEntitlement\x12?\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceB\b\xfaB\x05\x8a\x01\x02\x10\x01R\bresource\x12\x1a\n" + "\x02id\x18\x02 \x01(\tB\n" + @@ -660,12 +657,11 @@ const file_c1_connector_v2_entitlement_proto_rawDesc = "" + "\fgrantable_to\x18\x05 \x03(\v2\x1d.c1.connector.v2.ResourceTypeR\vgrantableTo\x126\n" + "\vannotations\x18\x06 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12M\n" + "\apurpose\x18\a \x01(\x0e2).c1.connector.v2.Entitlement.PurposeValueB\b\xfaB\x05\x82\x01\x02\x10\x01R\apurpose\x12\x12\n" + - "\x04slug\x18\b \x01(\tR\x04slug\"\x86\x01\n" + + "\x04slug\x18\b \x01(\tR\x04slug\"i\n" + "\fPurposeValue\x12\x1d\n" + "\x19PURPOSE_VALUE_UNSPECIFIED\x10\x00\x12\x1c\n" + "\x18PURPOSE_VALUE_ASSIGNMENT\x10\x01\x12\x1c\n" + - "\x18PURPOSE_VALUE_PERMISSION\x10\x02\x12\x1b\n" + - "\x17PURPOSE_VALUE_OWNERSHIP\x10\x03\"\xa8\x02\n" + + "\x18PURPOSE_VALUE_PERMISSION\x10\x02\"\xa8\x02\n" + "*EntitlementsServiceListEntitlementsRequest\x125\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x12'\n" + "\tpage_size\x18\x02 \x01(\rB\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement_protoopaque.pb.go index 0fc2b471..88a1142b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement_protoopaque.pb.go @@ -30,7 +30,6 @@ const ( Entitlement_PURPOSE_VALUE_UNSPECIFIED Entitlement_PurposeValue = 0 Entitlement_PURPOSE_VALUE_ASSIGNMENT Entitlement_PurposeValue = 1 Entitlement_PURPOSE_VALUE_PERMISSION Entitlement_PurposeValue = 2 - Entitlement_PURPOSE_VALUE_OWNERSHIP Entitlement_PurposeValue = 3 ) // Enum value maps for Entitlement_PurposeValue. @@ -39,13 +38,11 @@ var ( 0: "PURPOSE_VALUE_UNSPECIFIED", 1: "PURPOSE_VALUE_ASSIGNMENT", 2: "PURPOSE_VALUE_PERMISSION", - 3: "PURPOSE_VALUE_OWNERSHIP", } Entitlement_PurposeValue_value = map[string]int32{ "PURPOSE_VALUE_UNSPECIFIED": 0, "PURPOSE_VALUE_ASSIGNMENT": 1, "PURPOSE_VALUE_PERMISSION": 2, - "PURPOSE_VALUE_OWNERSHIP": 3, } ) @@ -664,7 +661,7 @@ var File_c1_connector_v2_entitlement_proto protoreflect.FileDescriptor const file_c1_connector_v2_entitlement_proto_rawDesc = "" + "\n" + - "!c1/connector/v2/entitlement.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x17validate/validate.proto\"\xb3\x04\n" + + "!c1/connector/v2/entitlement.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x17validate/validate.proto\"\x95\x04\n" + "\vEntitlement\x12?\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceB\b\xfaB\x05\x8a\x01\x02\x10\x01R\bresource\x12\x1a\n" + "\x02id\x18\x02 \x01(\tB\n" + @@ -676,12 +673,11 @@ const file_c1_connector_v2_entitlement_proto_rawDesc = "" + "\fgrantable_to\x18\x05 \x03(\v2\x1d.c1.connector.v2.ResourceTypeR\vgrantableTo\x126\n" + "\vannotations\x18\x06 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12M\n" + "\apurpose\x18\a \x01(\x0e2).c1.connector.v2.Entitlement.PurposeValueB\b\xfaB\x05\x82\x01\x02\x10\x01R\apurpose\x12\x12\n" + - "\x04slug\x18\b \x01(\tR\x04slug\"\x86\x01\n" + + "\x04slug\x18\b \x01(\tR\x04slug\"i\n" + "\fPurposeValue\x12\x1d\n" + "\x19PURPOSE_VALUE_UNSPECIFIED\x10\x00\x12\x1c\n" + "\x18PURPOSE_VALUE_ASSIGNMENT\x10\x01\x12\x1c\n" + - "\x18PURPOSE_VALUE_PERMISSION\x10\x02\x12\x1b\n" + - "\x17PURPOSE_VALUE_OWNERSHIP\x10\x03\"\xa8\x02\n" + + "\x18PURPOSE_VALUE_PERMISSION\x10\x02\"\xa8\x02\n" + "*EntitlementsServiceListEntitlementsRequest\x125\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x12'\n" + "\tpage_size\x18\x02 \x01(\rB\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go index 34601877..de8fff47 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go @@ -35,7 +35,6 @@ const ( ResourceType_TRAIT_APP ResourceType_Trait = 4 ResourceType_TRAIT_SECRET ResourceType_Trait = 5 ResourceType_TRAIT_SECURITY_INSIGHT ResourceType_Trait = 6 - ResourceType_TRAIT_SCOPE_BINDING ResourceType_Trait = 7 ) // Enum value maps for ResourceType_Trait. @@ -48,7 +47,6 @@ var ( 4: "TRAIT_APP", 5: "TRAIT_SECRET", 6: "TRAIT_SECURITY_INSIGHT", - 7: "TRAIT_SCOPE_BINDING", } ResourceType_Trait_value = map[string]int32{ "TRAIT_UNSPECIFIED": 0, @@ -58,7 +56,6 @@ var ( "TRAIT_APP": 4, "TRAIT_SECRET": 5, "TRAIT_SECURITY_INSIGHT": 6, - "TRAIT_SCOPE_BINDING": 7, } ) @@ -84,6 +81,7 @@ func (x ResourceType_Trait) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } +// FIXME(mstanbCO): call this something else? Should it just be a bool? Possibly just use an annotation? type Resource_CreationSource int32 const ( @@ -1880,7 +1878,6 @@ type CreateAccountRequest struct { AccountInfo *AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3" json:"account_info,omitempty"` CredentialOptions *CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` EncryptionConfigs []*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` - ResourceTypeId string `protobuf:"bytes,4,opt,name=resource_type_id,json=resourceTypeId,proto3" json:"resource_type_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1931,13 +1928,6 @@ func (x *CreateAccountRequest) GetEncryptionConfigs() []*EncryptionConfig { return nil } -func (x *CreateAccountRequest) GetResourceTypeId() string { - if x != nil { - return x.ResourceTypeId - } - return "" -} - func (x *CreateAccountRequest) SetAccountInfo(v *AccountInfo) { x.AccountInfo = v } @@ -1950,10 +1940,6 @@ func (x *CreateAccountRequest) SetEncryptionConfigs(v []*EncryptionConfig) { x.EncryptionConfigs = v } -func (x *CreateAccountRequest) SetResourceTypeId(v string) { - x.ResourceTypeId = v -} - func (x *CreateAccountRequest) HasAccountInfo() bool { if x == nil { return false @@ -1982,7 +1968,6 @@ type CreateAccountRequest_builder struct { AccountInfo *AccountInfo CredentialOptions *CredentialOptions EncryptionConfigs []*EncryptionConfig - ResourceTypeId string } func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { @@ -1992,7 +1977,6 @@ func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { x.AccountInfo = b.AccountInfo x.CredentialOptions = b.CredentialOptions x.EncryptionConfigs = b.EncryptionConfigs - x.ResourceTypeId = b.ResourceTypeId return m0 } @@ -2822,23 +2806,17 @@ func (b0 ResourceId_builder) Build() *ResourceId { } type Resource struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Id *ResourceId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` - DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - Annotations []*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - BatonResource bool `protobuf:"varint,6,opt,name=baton_resource,json=batonResource,proto3" json:"baton_resource,omitempty"` - // Deprecated. This is no longer used. - // - // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. - ExternalId *ExternalId `protobuf:"bytes,7,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` - // Deprecated. This is no longer used. - // - // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. - CreationSource Resource_CreationSource `protobuf:"varint,8,opt,name=creation_source,json=creationSource,proto3,enum=c1.connector.v2.Resource_CreationSource" json:"creation_source,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"hybrid.v1"` + Id *ResourceId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + BatonResource bool `protobuf:"varint,6,opt,name=baton_resource,json=batonResource,proto3" json:"baton_resource,omitempty"` + ExternalId *ExternalId `protobuf:"bytes,7,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + CreationSource Resource_CreationSource `protobuf:"varint,8,opt,name=creation_source,json=creationSource,proto3,enum=c1.connector.v2.Resource_CreationSource" json:"creation_source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Resource) Reset() { @@ -2908,7 +2886,6 @@ func (x *Resource) GetBatonResource() bool { return false } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) GetExternalId() *ExternalId { if x != nil { return x.ExternalId @@ -2916,7 +2893,6 @@ func (x *Resource) GetExternalId() *ExternalId { return nil } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) GetCreationSource() Resource_CreationSource { if x != nil { return x.CreationSource @@ -2948,12 +2924,10 @@ func (x *Resource) SetBatonResource(v bool) { x.BatonResource = v } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) SetExternalId(v *ExternalId) { x.ExternalId = v } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) SetCreationSource(v Resource_CreationSource) { x.CreationSource = v } @@ -2972,7 +2946,6 @@ func (x *Resource) HasParentResourceId() bool { return x.ParentResourceId != nil } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) HasExternalId() bool { if x == nil { return false @@ -2988,7 +2961,6 @@ func (x *Resource) ClearParentResourceId() { x.ParentResourceId = nil } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) ClearExternalId() { x.ExternalId = nil } @@ -3002,14 +2974,8 @@ type Resource_builder struct { Annotations []*anypb.Any Description string BatonResource bool - // Deprecated. This is no longer used. - // - // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. - ExternalId *ExternalId - // Deprecated. This is no longer used. - // - // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. - CreationSource Resource_CreationSource + ExternalId *ExternalId + CreationSource Resource_CreationSource } func (b0 Resource_builder) Build() *Resource { @@ -4473,7 +4439,7 @@ var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor const file_c1_connector_v2_resource_proto_rawDesc = "" + "\n" + - "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xea\x03\n" + + "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xd1\x03\n" + "\fResourceType\x12\x1a\n" + "\x02id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\x02id\x120\n" + @@ -4483,7 +4449,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80 \xd0\x01\x01R\vdescription\x12-\n" + - "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"\xa5\x01\n" + + "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"\x8c\x01\n" + "\x05Trait\x12\x15\n" + "\x11TRAIT_UNSPECIFIED\x10\x00\x12\x0e\n" + "\n" + @@ -4493,8 +4459,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "TRAIT_ROLE\x10\x03\x12\r\n" + "\tTRAIT_APP\x10\x04\x12\x10\n" + "\fTRAIT_SECRET\x10\x05\x12\x1a\n" + - "\x16TRAIT_SECURITY_INSIGHT\x10\x06\x12\x17\n" + - "\x13TRAIT_SCOPE_BINDING\x10\a\"\xa6\x02\n" + + "\x16TRAIT_SECURITY_INSIGHT\x10\x06\"\xa6\x02\n" + ",ResourceTypesServiceListResourceTypesRequest\x121\n" + "\x06parent\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\x06parent\x12'\n" + "\tpage_size\x18\x02 \x01(\rB\n" + @@ -4580,13 +4545,11 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\aoptions\"L\n" + "\x12PasswordConstraint\x12\x19\n" + "\bchar_set\x18\x01 \x01(\tR\acharSet\x12\x1b\n" + - "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xb5\x02\n" + + "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xfc\x01\n" + "\x14CreateAccountRequest\x12?\n" + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x127\n" + - "\x10resource_type_id\x18\x04 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\x0eresourceTypeId\"\xcc\b\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\"\xcc\b\n" + "\x15CreateAccountResponse\x12P\n" + "\asuccess\x18d \x01(\v24.c1.connector.v2.CreateAccountResponse.SuccessResultH\x00R\asuccess\x12f\n" + "\x0faction_required\x18e \x01(\v2;.c1.connector.v2.CreateAccountResponse.ActionRequiredResultH\x00R\x0eactionRequired\x12c\n" + @@ -4636,7 +4599,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\xfaB\ar\x05 \x01(\x80\bR\fresourceType\x12&\n" + "\bresource\x18\x02 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\bresource\x12%\n" + - "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf8\x04\n" + + "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf0\x04\n" + "\bResource\x12+\n" + "\x02id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x02id\x12I\n" + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\x120\n" + @@ -4645,10 +4608,10 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80\x10\xd0\x01\x01R\vdescription\x12%\n" + - "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12@\n" + - "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdB\x02\x18\x01R\n" + - "externalId\x12U\n" + - "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceB\x02\x18\x01R\x0ecreationSource\"\x98\x01\n" + + "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12<\n" + + "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdR\n" + + "externalId\x12Q\n" + + "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceR\x0ecreationSource\"\x98\x01\n" + "\x0eCreationSource\x12\x1f\n" + "\x1bCREATION_SOURCE_UNSPECIFIED\x10\x00\x12,\n" + "(CREATION_SOURCE_CONNECTOR_LIST_RESOURCES\x10\x01\x127\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go index 12dcb8a5..211603ac 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go @@ -35,7 +35,6 @@ const ( ResourceType_TRAIT_APP ResourceType_Trait = 4 ResourceType_TRAIT_SECRET ResourceType_Trait = 5 ResourceType_TRAIT_SECURITY_INSIGHT ResourceType_Trait = 6 - ResourceType_TRAIT_SCOPE_BINDING ResourceType_Trait = 7 ) // Enum value maps for ResourceType_Trait. @@ -48,7 +47,6 @@ var ( 4: "TRAIT_APP", 5: "TRAIT_SECRET", 6: "TRAIT_SECURITY_INSIGHT", - 7: "TRAIT_SCOPE_BINDING", } ResourceType_Trait_value = map[string]int32{ "TRAIT_UNSPECIFIED": 0, @@ -58,7 +56,6 @@ var ( "TRAIT_APP": 4, "TRAIT_SECRET": 5, "TRAIT_SECURITY_INSIGHT": 6, - "TRAIT_SCOPE_BINDING": 7, } ) @@ -84,6 +81,7 @@ func (x ResourceType_Trait) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } +// FIXME(mstanbCO): call this something else? Should it just be a bool? Possibly just use an annotation? type Resource_CreationSource int32 const ( @@ -1874,7 +1872,6 @@ type CreateAccountRequest struct { xxx_hidden_AccountInfo *AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3"` xxx_hidden_CredentialOptions *CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3"` xxx_hidden_EncryptionConfigs *[]*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3"` - xxx_hidden_ResourceTypeId string `protobuf:"bytes,4,opt,name=resource_type_id,json=resourceTypeId,proto3"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1927,13 +1924,6 @@ func (x *CreateAccountRequest) GetEncryptionConfigs() []*EncryptionConfig { return nil } -func (x *CreateAccountRequest) GetResourceTypeId() string { - if x != nil { - return x.xxx_hidden_ResourceTypeId - } - return "" -} - func (x *CreateAccountRequest) SetAccountInfo(v *AccountInfo) { x.xxx_hidden_AccountInfo = v } @@ -1946,10 +1936,6 @@ func (x *CreateAccountRequest) SetEncryptionConfigs(v []*EncryptionConfig) { x.xxx_hidden_EncryptionConfigs = &v } -func (x *CreateAccountRequest) SetResourceTypeId(v string) { - x.xxx_hidden_ResourceTypeId = v -} - func (x *CreateAccountRequest) HasAccountInfo() bool { if x == nil { return false @@ -1978,7 +1964,6 @@ type CreateAccountRequest_builder struct { AccountInfo *AccountInfo CredentialOptions *CredentialOptions EncryptionConfigs []*EncryptionConfig - ResourceTypeId string } func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { @@ -1988,7 +1973,6 @@ func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { x.xxx_hidden_AccountInfo = b.AccountInfo x.xxx_hidden_CredentialOptions = b.CredentialOptions x.xxx_hidden_EncryptionConfigs = &b.EncryptionConfigs - x.xxx_hidden_ResourceTypeId = b.ResourceTypeId return m0 } @@ -2880,7 +2864,6 @@ func (x *Resource) GetBatonResource() bool { return false } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) GetExternalId() *ExternalId { if x != nil { return x.xxx_hidden_ExternalId @@ -2888,7 +2871,6 @@ func (x *Resource) GetExternalId() *ExternalId { return nil } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) GetCreationSource() Resource_CreationSource { if x != nil { return x.xxx_hidden_CreationSource @@ -2920,12 +2902,10 @@ func (x *Resource) SetBatonResource(v bool) { x.xxx_hidden_BatonResource = v } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) SetExternalId(v *ExternalId) { x.xxx_hidden_ExternalId = v } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) SetCreationSource(v Resource_CreationSource) { x.xxx_hidden_CreationSource = v } @@ -2944,7 +2924,6 @@ func (x *Resource) HasParentResourceId() bool { return x.xxx_hidden_ParentResourceId != nil } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) HasExternalId() bool { if x == nil { return false @@ -2960,7 +2939,6 @@ func (x *Resource) ClearParentResourceId() { x.xxx_hidden_ParentResourceId = nil } -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) ClearExternalId() { x.xxx_hidden_ExternalId = nil } @@ -2974,14 +2952,8 @@ type Resource_builder struct { Annotations []*anypb.Any Description string BatonResource bool - // Deprecated. This is no longer used. - // - // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. - ExternalId *ExternalId - // Deprecated. This is no longer used. - // - // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. - CreationSource Resource_CreationSource + ExternalId *ExternalId + CreationSource Resource_CreationSource } func (b0 Resource_builder) Build() *Resource { @@ -4460,7 +4432,7 @@ var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor const file_c1_connector_v2_resource_proto_rawDesc = "" + "\n" + - "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xea\x03\n" + + "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xd1\x03\n" + "\fResourceType\x12\x1a\n" + "\x02id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\x02id\x120\n" + @@ -4470,7 +4442,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80 \xd0\x01\x01R\vdescription\x12-\n" + - "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"\xa5\x01\n" + + "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"\x8c\x01\n" + "\x05Trait\x12\x15\n" + "\x11TRAIT_UNSPECIFIED\x10\x00\x12\x0e\n" + "\n" + @@ -4480,8 +4452,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "TRAIT_ROLE\x10\x03\x12\r\n" + "\tTRAIT_APP\x10\x04\x12\x10\n" + "\fTRAIT_SECRET\x10\x05\x12\x1a\n" + - "\x16TRAIT_SECURITY_INSIGHT\x10\x06\x12\x17\n" + - "\x13TRAIT_SCOPE_BINDING\x10\a\"\xa6\x02\n" + + "\x16TRAIT_SECURITY_INSIGHT\x10\x06\"\xa6\x02\n" + ",ResourceTypesServiceListResourceTypesRequest\x121\n" + "\x06parent\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\x06parent\x12'\n" + "\tpage_size\x18\x02 \x01(\rB\n" + @@ -4567,13 +4538,11 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\aoptions\"L\n" + "\x12PasswordConstraint\x12\x19\n" + "\bchar_set\x18\x01 \x01(\tR\acharSet\x12\x1b\n" + - "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xb5\x02\n" + + "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xfc\x01\n" + "\x14CreateAccountRequest\x12?\n" + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x127\n" + - "\x10resource_type_id\x18\x04 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\x0eresourceTypeId\"\xcc\b\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\"\xcc\b\n" + "\x15CreateAccountResponse\x12P\n" + "\asuccess\x18d \x01(\v24.c1.connector.v2.CreateAccountResponse.SuccessResultH\x00R\asuccess\x12f\n" + "\x0faction_required\x18e \x01(\v2;.c1.connector.v2.CreateAccountResponse.ActionRequiredResultH\x00R\x0eactionRequired\x12c\n" + @@ -4623,7 +4592,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\xfaB\ar\x05 \x01(\x80\bR\fresourceType\x12&\n" + "\bresource\x18\x02 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\bresource\x12%\n" + - "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf8\x04\n" + + "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf0\x04\n" + "\bResource\x12+\n" + "\x02id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x02id\x12I\n" + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\x120\n" + @@ -4632,10 +4601,10 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80\x10\xd0\x01\x01R\vdescription\x12%\n" + - "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12@\n" + - "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdB\x02\x18\x01R\n" + - "externalId\x12U\n" + - "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceB\x02\x18\x01R\x0ecreationSource\"\x98\x01\n" + + "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12<\n" + + "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdR\n" + + "externalId\x12Q\n" + + "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceR\x0ecreationSource\"\x98\x01\n" + "\x0eCreationSource\x12\x1f\n" + "\x1bCREATION_SOURCE_UNSPECIFIED\x10\x00\x12,\n" + "(CREATION_SOURCE_CONNECTOR_LIST_RESOURCES\x10\x01\x127\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go index 02f3090a..9a188337 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go @@ -106,8 +106,6 @@ type Task struct { // *Task_ActionStatus // *Task_CreateSyncDiff // *Task_CompactSyncs_ - // *Task_ListEventFeeds - // *Task_ListEvents TaskType isTask_TaskType `protobuf_oneof:"task_type"` Debug bool `protobuf:"varint,3,opt,name=debug,proto3" json:"debug,omitempty"` unknownFields protoimpl.UnknownFields @@ -349,24 +347,6 @@ func (x *Task) GetCompactSyncs() *Task_CompactSyncs { return nil } -func (x *Task) GetListEventFeeds() *Task_ListEventFeedsTask { - if x != nil { - if x, ok := x.TaskType.(*Task_ListEventFeeds); ok { - return x.ListEventFeeds - } - } - return nil -} - -func (x *Task) GetListEvents() *Task_ListEventsTask { - if x != nil { - if x, ok := x.TaskType.(*Task_ListEvents); ok { - return x.ListEvents - } - } - return nil -} - func (x *Task) GetDebug() bool { if x != nil { return x.Debug @@ -550,22 +530,6 @@ func (x *Task) SetCompactSyncs(v *Task_CompactSyncs) { x.TaskType = &Task_CompactSyncs_{v} } -func (x *Task) SetListEventFeeds(v *Task_ListEventFeedsTask) { - if v == nil { - x.TaskType = nil - return - } - x.TaskType = &Task_ListEventFeeds{v} -} - -func (x *Task) SetListEvents(v *Task_ListEventsTask) { - if v == nil { - x.TaskType = nil - return - } - x.TaskType = &Task_ListEvents{v} -} - func (x *Task) SetDebug(v bool) { x.Debug = v } @@ -745,22 +709,6 @@ func (x *Task) HasCompactSyncs() bool { return ok } -func (x *Task) HasListEventFeeds() bool { - if x == nil { - return false - } - _, ok := x.TaskType.(*Task_ListEventFeeds) - return ok -} - -func (x *Task) HasListEvents() bool { - if x == nil { - return false - } - _, ok := x.TaskType.(*Task_ListEvents) - return ok -} - func (x *Task) ClearTaskType() { x.TaskType = nil } @@ -891,18 +839,6 @@ func (x *Task) ClearCompactSyncs() { } } -func (x *Task) ClearListEventFeeds() { - if _, ok := x.TaskType.(*Task_ListEventFeeds); ok { - x.TaskType = nil - } -} - -func (x *Task) ClearListEvents() { - if _, ok := x.TaskType.(*Task_ListEvents); ok { - x.TaskType = nil - } -} - const Task_TaskType_not_set_case case_Task_TaskType = 0 const Task_None_case case_Task_TaskType = 100 const Task_Hello_case case_Task_TaskType = 101 @@ -925,8 +861,6 @@ const Task_ActionInvoke_case case_Task_TaskType = 117 const Task_ActionStatus_case case_Task_TaskType = 118 const Task_CreateSyncDiff_case case_Task_TaskType = 119 const Task_CompactSyncs_case case_Task_TaskType = 120 -const Task_ListEventFeeds_case case_Task_TaskType = 121 -const Task_ListEvents_case case_Task_TaskType = 122 func (x *Task) WhichTaskType() case_Task_TaskType { if x == nil { @@ -975,10 +909,6 @@ func (x *Task) WhichTaskType() case_Task_TaskType { return Task_CreateSyncDiff_case case *Task_CompactSyncs_: return Task_CompactSyncs_case - case *Task_ListEventFeeds: - return Task_ListEventFeeds_case - case *Task_ListEvents: - return Task_ListEvents_case default: return Task_TaskType_not_set_case } @@ -1011,8 +941,6 @@ type Task_builder struct { ActionStatus *Task_ActionStatusTask CreateSyncDiff *Task_CreateSyncDiffTask CompactSyncs *Task_CompactSyncs - ListEventFeeds *Task_ListEventFeedsTask - ListEvents *Task_ListEventsTask // -- end of TaskType Debug bool } @@ -1086,12 +1014,6 @@ func (b0 Task_builder) Build() *Task { if b.CompactSyncs != nil { x.TaskType = &Task_CompactSyncs_{b.CompactSyncs} } - if b.ListEventFeeds != nil { - x.TaskType = &Task_ListEventFeeds{b.ListEventFeeds} - } - if b.ListEvents != nil { - x.TaskType = &Task_ListEvents{b.ListEvents} - } x.Debug = b.Debug return m0 } @@ -1194,14 +1116,6 @@ type Task_CompactSyncs_ struct { CompactSyncs *Task_CompactSyncs `protobuf:"bytes,120,opt,name=compact_syncs,json=compactSyncs,proto3,oneof"` } -type Task_ListEventFeeds struct { - ListEventFeeds *Task_ListEventFeedsTask `protobuf:"bytes,121,opt,name=list_event_feeds,json=listEventFeeds,proto3,oneof"` -} - -type Task_ListEvents struct { - ListEvents *Task_ListEventsTask `protobuf:"bytes,122,opt,name=list_events,json=listEvents,proto3,oneof"` -} - func (*Task_None) isTask_TaskType() {} func (*Task_Hello) isTask_TaskType() {} @@ -1244,10 +1158,6 @@ func (*Task_CreateSyncDiff) isTask_TaskType() {} func (*Task_CompactSyncs_) isTask_TaskType() {} -func (*Task_ListEventFeeds) isTask_TaskType() {} - -func (*Task_ListEvents) isTask_TaskType() {} - type BatonServiceHelloRequest struct { state protoimpl.MessageState `protogen:"hybrid.v1"` HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"` @@ -2807,187 +2717,6 @@ func (b0 Task_EventFeedTask_builder) Build() *Task_EventFeedTask { return m0 } -type Task_ListEventsTask struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` - Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` - StartAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start_at,json=startAt,proto3" json:"start_at,omitempty"` - EventFeedId string `protobuf:"bytes,4,opt,name=event_feed_id,json=eventFeedId,proto3" json:"event_feed_id,omitempty"` - PageSize uint32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Task_ListEventsTask) Reset() { - *x = Task_ListEventsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Task_ListEventsTask) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Task_ListEventsTask) ProtoMessage() {} - -func (x *Task_ListEventsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Task_ListEventsTask) GetAnnotations() []*anypb.Any { - if x != nil { - return x.Annotations - } - return nil -} - -func (x *Task_ListEventsTask) GetCursor() string { - if x != nil { - return x.Cursor - } - return "" -} - -func (x *Task_ListEventsTask) GetStartAt() *timestamppb.Timestamp { - if x != nil { - return x.StartAt - } - return nil -} - -func (x *Task_ListEventsTask) GetEventFeedId() string { - if x != nil { - return x.EventFeedId - } - return "" -} - -func (x *Task_ListEventsTask) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *Task_ListEventsTask) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *Task_ListEventsTask) SetCursor(v string) { - x.Cursor = v -} - -func (x *Task_ListEventsTask) SetStartAt(v *timestamppb.Timestamp) { - x.StartAt = v -} - -func (x *Task_ListEventsTask) SetEventFeedId(v string) { - x.EventFeedId = v -} - -func (x *Task_ListEventsTask) SetPageSize(v uint32) { - x.PageSize = v -} - -func (x *Task_ListEventsTask) HasStartAt() bool { - if x == nil { - return false - } - return x.StartAt != nil -} - -func (x *Task_ListEventsTask) ClearStartAt() { - x.StartAt = nil -} - -type Task_ListEventsTask_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Annotations []*anypb.Any - Cursor string - StartAt *timestamppb.Timestamp - EventFeedId string - PageSize uint32 -} - -func (b0 Task_ListEventsTask_builder) Build() *Task_ListEventsTask { - m0 := &Task_ListEventsTask{} - b, x := &b0, m0 - _, _ = b, x - x.Annotations = b.Annotations - x.Cursor = b.Cursor - x.StartAt = b.StartAt - x.EventFeedId = b.EventFeedId - x.PageSize = b.PageSize - return m0 -} - -type Task_ListEventFeedsTask struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Task_ListEventFeedsTask) Reset() { - *x = Task_ListEventFeedsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Task_ListEventFeedsTask) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Task_ListEventFeedsTask) ProtoMessage() {} - -func (x *Task_ListEventFeedsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Task_ListEventFeedsTask) GetAnnotations() []*anypb.Any { - if x != nil { - return x.Annotations - } - return nil -} - -func (x *Task_ListEventFeedsTask) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -type Task_ListEventFeedsTask_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Annotations []*anypb.Any -} - -func (b0 Task_ListEventFeedsTask_builder) Build() *Task_ListEventFeedsTask { - m0 := &Task_ListEventFeedsTask{} - b, x := &b0, m0 - _, _ = b, x - x.Annotations = b.Annotations - return m0 -} - type Task_GrantTask struct { state protoimpl.MessageState `protogen:"hybrid.v1"` Entitlement *v2.Entitlement `protobuf:"bytes,1,opt,name=entitlement,proto3" json:"entitlement,omitempty"` @@ -3000,7 +2729,7 @@ type Task_GrantTask struct { func (x *Task_GrantTask) Reset() { *x = Task_GrantTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3012,7 +2741,7 @@ func (x *Task_GrantTask) String() string { func (*Task_GrantTask) ProtoMessage() {} func (x *Task_GrantTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3130,7 +2859,7 @@ type Task_RevokeTask struct { func (x *Task_RevokeTask) Reset() { *x = Task_RevokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3142,7 +2871,7 @@ func (x *Task_RevokeTask) String() string { func (*Task_RevokeTask) ProtoMessage() {} func (x *Task_RevokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3207,14 +2936,13 @@ type Task_CreateAccountTask struct { AccountInfo *v2.AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3" json:"account_info,omitempty"` CredentialOptions *v2.CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` EncryptionConfigs []*v2.EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` - ResourceTypeId string `protobuf:"bytes,4,opt,name=resource_type_id,json=resourceTypeId,proto3" json:"resource_type_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Task_CreateAccountTask) Reset() { *x = Task_CreateAccountTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3226,7 +2954,7 @@ func (x *Task_CreateAccountTask) String() string { func (*Task_CreateAccountTask) ProtoMessage() {} func (x *Task_CreateAccountTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3258,13 +2986,6 @@ func (x *Task_CreateAccountTask) GetEncryptionConfigs() []*v2.EncryptionConfig { return nil } -func (x *Task_CreateAccountTask) GetResourceTypeId() string { - if x != nil { - return x.ResourceTypeId - } - return "" -} - func (x *Task_CreateAccountTask) SetAccountInfo(v *v2.AccountInfo) { x.AccountInfo = v } @@ -3277,10 +2998,6 @@ func (x *Task_CreateAccountTask) SetEncryptionConfigs(v []*v2.EncryptionConfig) x.EncryptionConfigs = v } -func (x *Task_CreateAccountTask) SetResourceTypeId(v string) { - x.ResourceTypeId = v -} - func (x *Task_CreateAccountTask) HasAccountInfo() bool { if x == nil { return false @@ -3309,7 +3026,6 @@ type Task_CreateAccountTask_builder struct { AccountInfo *v2.AccountInfo CredentialOptions *v2.CredentialOptions EncryptionConfigs []*v2.EncryptionConfig - ResourceTypeId string } func (b0 Task_CreateAccountTask_builder) Build() *Task_CreateAccountTask { @@ -3319,7 +3035,6 @@ func (b0 Task_CreateAccountTask_builder) Build() *Task_CreateAccountTask { x.AccountInfo = b.AccountInfo x.CredentialOptions = b.CredentialOptions x.EncryptionConfigs = b.EncryptionConfigs - x.ResourceTypeId = b.ResourceTypeId return m0 } @@ -3332,7 +3047,7 @@ type Task_CreateResourceTask struct { func (x *Task_CreateResourceTask) Reset() { *x = Task_CreateResourceTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3344,7 +3059,7 @@ func (x *Task_CreateResourceTask) String() string { func (*Task_CreateResourceTask) ProtoMessage() {} func (x *Task_CreateResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3401,7 +3116,7 @@ type Task_DeleteResourceTask struct { func (x *Task_DeleteResourceTask) Reset() { *x = Task_DeleteResourceTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3413,7 +3128,7 @@ func (x *Task_DeleteResourceTask) String() string { func (*Task_DeleteResourceTask) ProtoMessage() {} func (x *Task_DeleteResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3495,7 +3210,7 @@ type Task_RotateCredentialsTask struct { func (x *Task_RotateCredentialsTask) Reset() { *x = Task_RotateCredentialsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3507,7 +3222,7 @@ func (x *Task_RotateCredentialsTask) String() string { func (*Task_RotateCredentialsTask) ProtoMessage() {} func (x *Task_RotateCredentialsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3602,7 +3317,7 @@ type Task_CreateTicketTask struct { func (x *Task_CreateTicketTask) Reset() { *x = Task_CreateTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3614,7 +3329,7 @@ func (x *Task_CreateTicketTask) String() string { func (*Task_CreateTicketTask) ProtoMessage() {} func (x *Task_CreateTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3707,7 +3422,7 @@ type Task_BulkCreateTicketsTask struct { func (x *Task_BulkCreateTicketsTask) Reset() { *x = Task_BulkCreateTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3719,7 +3434,7 @@ func (x *Task_BulkCreateTicketsTask) String() string { func (*Task_BulkCreateTicketsTask) ProtoMessage() {} func (x *Task_BulkCreateTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3764,7 +3479,7 @@ type Task_BulkGetTicketsTask struct { func (x *Task_BulkGetTicketsTask) Reset() { *x = Task_BulkGetTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3776,7 +3491,7 @@ func (x *Task_BulkGetTicketsTask) String() string { func (*Task_BulkGetTicketsTask) ProtoMessage() {} func (x *Task_BulkGetTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3821,7 +3536,7 @@ type Task_ListTicketSchemasTask struct { func (x *Task_ListTicketSchemasTask) Reset() { *x = Task_ListTicketSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3833,7 +3548,7 @@ func (x *Task_ListTicketSchemasTask) String() string { func (*Task_ListTicketSchemasTask) ProtoMessage() {} func (x *Task_ListTicketSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3879,7 +3594,7 @@ type Task_GetTicketTask struct { func (x *Task_GetTicketTask) Reset() { *x = Task_GetTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3891,7 +3606,7 @@ func (x *Task_GetTicketTask) String() string { func (*Task_GetTicketTask) ProtoMessage() {} func (x *Task_GetTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3951,7 +3666,7 @@ type Task_ActionListSchemasTask struct { func (x *Task_ActionListSchemasTask) Reset() { *x = Task_ActionListSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3963,7 +3678,7 @@ func (x *Task_ActionListSchemasTask) String() string { func (*Task_ActionListSchemasTask) ProtoMessage() {} func (x *Task_ActionListSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4023,7 +3738,7 @@ type Task_ActionGetSchemaTask struct { func (x *Task_ActionGetSchemaTask) Reset() { *x = Task_ActionGetSchemaTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4035,7 +3750,7 @@ func (x *Task_ActionGetSchemaTask) String() string { func (*Task_ActionGetSchemaTask) ProtoMessage() {} func (x *Task_ActionGetSchemaTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4097,7 +3812,7 @@ type Task_ActionInvokeTask struct { func (x *Task_ActionInvokeTask) Reset() { *x = Task_ActionInvokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4109,7 +3824,7 @@ func (x *Task_ActionInvokeTask) String() string { func (*Task_ActionInvokeTask) ProtoMessage() {} func (x *Task_ActionInvokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4207,7 +3922,7 @@ type Task_ActionStatusTask struct { func (x *Task_ActionStatusTask) Reset() { *x = Task_ActionStatusTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4219,7 +3934,7 @@ func (x *Task_ActionStatusTask) String() string { func (*Task_ActionStatusTask) ProtoMessage() {} func (x *Task_ActionStatusTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4293,7 +4008,7 @@ type Task_CreateSyncDiffTask struct { func (x *Task_CreateSyncDiffTask) Reset() { *x = Task_CreateSyncDiffTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4305,7 +4020,7 @@ func (x *Task_CreateSyncDiffTask) String() string { func (*Task_CreateSyncDiffTask) ProtoMessage() {} func (x *Task_CreateSyncDiffTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4378,7 +4093,7 @@ type Task_CompactSyncs struct { func (x *Task_CompactSyncs) Reset() { *x = Task_CompactSyncs{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4390,7 +4105,7 @@ func (x *Task_CompactSyncs) String() string { func (*Task_CompactSyncs) ProtoMessage() {} func (x *Task_CompactSyncs) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4449,7 +4164,7 @@ type Task_CompactSyncs_CompactableSync struct { func (x *Task_CompactSyncs_CompactableSync) Reset() { *x = Task_CompactSyncs_CompactableSync{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4461,7 +4176,7 @@ func (x *Task_CompactSyncs_CompactableSync) String() string { func (*Task_CompactSyncs_CompactableSync) ProtoMessage() {} func (x *Task_CompactSyncs_CompactableSync) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4521,7 +4236,7 @@ type BatonServiceHelloRequest_BuildInfo struct { func (x *BatonServiceHelloRequest_BuildInfo) Reset() { *x = BatonServiceHelloRequest_BuildInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4533,7 +4248,7 @@ func (x *BatonServiceHelloRequest_BuildInfo) String() string { func (*BatonServiceHelloRequest_BuildInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_BuildInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4611,7 +4326,7 @@ type BatonServiceHelloRequest_OSInfo struct { func (x *BatonServiceHelloRequest_OSInfo) Reset() { *x = BatonServiceHelloRequest_OSInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4623,7 +4338,7 @@ func (x *BatonServiceHelloRequest_OSInfo) String() string { func (*BatonServiceHelloRequest_OSInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_OSInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4761,7 +4476,7 @@ type BatonServiceUploadAssetRequest_UploadMetadata struct { func (x *BatonServiceUploadAssetRequest_UploadMetadata) Reset() { *x = BatonServiceUploadAssetRequest_UploadMetadata{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4773,7 +4488,7 @@ func (x *BatonServiceUploadAssetRequest_UploadMetadata) String() string { func (*BatonServiceUploadAssetRequest_UploadMetadata) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadMetadata) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4845,7 +4560,7 @@ type BatonServiceUploadAssetRequest_UploadData struct { func (x *BatonServiceUploadAssetRequest_UploadData) Reset() { *x = BatonServiceUploadAssetRequest_UploadData{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4857,7 +4572,7 @@ func (x *BatonServiceUploadAssetRequest_UploadData) String() string { func (*BatonServiceUploadAssetRequest_UploadData) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4907,7 +4622,7 @@ type BatonServiceUploadAssetRequest_UploadEOF struct { func (x *BatonServiceUploadAssetRequest_UploadEOF) Reset() { *x = BatonServiceUploadAssetRequest_UploadEOF{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4919,7 +4634,7 @@ func (x *BatonServiceUploadAssetRequest_UploadEOF) String() string { func (*BatonServiceUploadAssetRequest_UploadEOF) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadEOF) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4983,7 +4698,7 @@ type BatonServiceFinishTaskRequest_Error struct { func (x *BatonServiceFinishTaskRequest_Error) Reset() { *x = BatonServiceFinishTaskRequest_Error{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4995,7 +4710,7 @@ func (x *BatonServiceFinishTaskRequest_Error) String() string { func (*BatonServiceFinishTaskRequest_Error) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Error) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5080,7 +4795,7 @@ type BatonServiceFinishTaskRequest_Success struct { func (x *BatonServiceFinishTaskRequest_Success) Reset() { *x = BatonServiceFinishTaskRequest_Success{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5092,7 +4807,7 @@ func (x *BatonServiceFinishTaskRequest_Success) String() string { func (*BatonServiceFinishTaskRequest_Success) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Success) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5157,7 +4872,7 @@ var File_c1_connectorapi_baton_v1_baton_proto protoreflect.FileDescriptor const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + - "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xa2-\n" + + "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\x80)\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12=\n" + "\x06status\x18\x02 \x01(\x0e2%.c1.connectorapi.baton.v1.Task.StatusR\x06status\x12=\n" + @@ -5183,10 +4898,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\raction_invoke\x18u \x01(\v2/.c1.connectorapi.baton.v1.Task.ActionInvokeTaskH\x00R\factionInvoke\x12V\n" + "\raction_status\x18v \x01(\v2/.c1.connectorapi.baton.v1.Task.ActionStatusTaskH\x00R\factionStatus\x12]\n" + "\x10create_sync_diff\x18w \x01(\v21.c1.connectorapi.baton.v1.Task.CreateSyncDiffTaskH\x00R\x0ecreateSyncDiff\x12R\n" + - "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12]\n" + - "\x10list_event_feeds\x18y \x01(\v21.c1.connectorapi.baton.v1.Task.ListEventFeedsTaskH\x00R\x0elistEventFeeds\x12P\n" + - "\vlist_events\x18z \x01(\v2-.c1.connectorapi.baton.v1.Task.ListEventsTaskH\x00R\n" + - "listEvents\x12\x14\n" + + "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12\x14\n" + "\x05debug\x18\x03 \x01(\bR\x05debug\x1aB\n" + "\bNoneTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1aC\n" + @@ -5199,16 +4911,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x17targeted_sync_resources\x18\x04 \x03(\v2\x19.c1.connector.v2.ResourceR\x15targetedSyncResources\x1a~\n" + "\rEventFeedTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x125\n" + - "\bstart_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x1a\xe7\x01\n" + - "\x0eListEventsTask\x126\n" + - "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12%\n" + - "\x06cursor\x18\x02 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80 \xd0\x01\x01R\x06cursor\x125\n" + - "\bstart_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x12\"\n" + - "\revent_feed_id\x18\x04 \x01(\tR\veventFeedId\x12\x1b\n" + - "\tpage_size\x18\x05 \x01(\rR\bpageSize\x1aL\n" + - "\x12ListEventFeedsTask\x126\n" + - "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xf3\x01\n" + + "\bstart_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x1a\xf3\x01\n" + "\tGrantTask\x12>\n" + "\ventitlement\x18\x01 \x01(\v2\x1c.c1.connector.v2.EntitlementR\ventitlement\x127\n" + "\tprincipal\x18\x02 \x01(\v2\x19.c1.connector.v2.ResourceR\tprincipal\x126\n" + @@ -5217,13 +4920,11 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + "RevokeTask\x12,\n" + "\x05grant\x18\x01 \x01(\v2\x16.c1.connector.v2.GrantR\x05grant\x126\n" + - "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xb2\x02\n" + + "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xf9\x01\n" + "\x11CreateAccountTask\x12?\n" + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x127\n" + - "\x10resource_type_id\x18\x04 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\x0eresourceTypeId\x1aK\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x1aK\n" + "\x12CreateResourceTask\x125\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x1a\x9d\x01\n" + "\x12DeleteResourceTask\x12<\n" + @@ -5383,7 +5084,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x0eStartDebugging\x12/.c1.connectorapi.baton.v1.StartDebuggingRequest\x1a0.c1.connectorapi.baton.v1.StartDebuggingResponse\"\x00B7Z5gitlab.com/ductone/c1/pkg/pb/c1/connectorapi/baton/v1b\x06proto3" var file_c1_connectorapi_baton_v1_baton_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 44) +var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 42) var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (Task_Status)(0), // 0: c1.connectorapi.baton.v1.Task.Status (*Task)(nil), // 1: c1.connectorapi.baton.v1.Task @@ -5403,156 +5104,149 @@ var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (*Task_HelloTask)(nil), // 15: c1.connectorapi.baton.v1.Task.HelloTask (*Task_SyncFullTask)(nil), // 16: c1.connectorapi.baton.v1.Task.SyncFullTask (*Task_EventFeedTask)(nil), // 17: c1.connectorapi.baton.v1.Task.EventFeedTask - (*Task_ListEventsTask)(nil), // 18: c1.connectorapi.baton.v1.Task.ListEventsTask - (*Task_ListEventFeedsTask)(nil), // 19: c1.connectorapi.baton.v1.Task.ListEventFeedsTask - (*Task_GrantTask)(nil), // 20: c1.connectorapi.baton.v1.Task.GrantTask - (*Task_RevokeTask)(nil), // 21: c1.connectorapi.baton.v1.Task.RevokeTask - (*Task_CreateAccountTask)(nil), // 22: c1.connectorapi.baton.v1.Task.CreateAccountTask - (*Task_CreateResourceTask)(nil), // 23: c1.connectorapi.baton.v1.Task.CreateResourceTask - (*Task_DeleteResourceTask)(nil), // 24: c1.connectorapi.baton.v1.Task.DeleteResourceTask - (*Task_RotateCredentialsTask)(nil), // 25: c1.connectorapi.baton.v1.Task.RotateCredentialsTask - (*Task_CreateTicketTask)(nil), // 26: c1.connectorapi.baton.v1.Task.CreateTicketTask - (*Task_BulkCreateTicketsTask)(nil), // 27: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - (*Task_BulkGetTicketsTask)(nil), // 28: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - (*Task_ListTicketSchemasTask)(nil), // 29: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - (*Task_GetTicketTask)(nil), // 30: c1.connectorapi.baton.v1.Task.GetTicketTask - (*Task_ActionListSchemasTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionListSchemasTask - (*Task_ActionGetSchemaTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - (*Task_ActionInvokeTask)(nil), // 33: c1.connectorapi.baton.v1.Task.ActionInvokeTask - (*Task_ActionStatusTask)(nil), // 34: c1.connectorapi.baton.v1.Task.ActionStatusTask - (*Task_CreateSyncDiffTask)(nil), // 35: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - (*Task_CompactSyncs)(nil), // 36: c1.connectorapi.baton.v1.Task.CompactSyncs - (*Task_CompactSyncs_CompactableSync)(nil), // 37: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - (*BatonServiceHelloRequest_BuildInfo)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - (*BatonServiceHelloRequest_OSInfo)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - (*BatonServiceUploadAssetRequest_UploadData)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - (*BatonServiceFinishTaskRequest_Error)(nil), // 43: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - (*BatonServiceFinishTaskRequest_Success)(nil), // 44: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - (*v2.ConnectorMetadata)(nil), // 45: c1.connector.v2.ConnectorMetadata - (*anypb.Any)(nil), // 46: google.protobuf.Any - (*durationpb.Duration)(nil), // 47: google.protobuf.Duration - (*status.Status)(nil), // 48: google.rpc.Status - (*v2.Resource)(nil), // 49: c1.connector.v2.Resource - (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp - (*v2.Entitlement)(nil), // 51: c1.connector.v2.Entitlement - (*v2.Grant)(nil), // 52: c1.connector.v2.Grant - (*v2.AccountInfo)(nil), // 53: c1.connector.v2.AccountInfo - (*v2.CredentialOptions)(nil), // 54: c1.connector.v2.CredentialOptions - (*v2.EncryptionConfig)(nil), // 55: c1.connector.v2.EncryptionConfig - (*v2.ResourceId)(nil), // 56: c1.connector.v2.ResourceId - (*v2.TicketRequest)(nil), // 57: c1.connector.v2.TicketRequest - (*v2.TicketSchema)(nil), // 58: c1.connector.v2.TicketSchema - (*structpb.Struct)(nil), // 59: google.protobuf.Struct + (*Task_GrantTask)(nil), // 18: c1.connectorapi.baton.v1.Task.GrantTask + (*Task_RevokeTask)(nil), // 19: c1.connectorapi.baton.v1.Task.RevokeTask + (*Task_CreateAccountTask)(nil), // 20: c1.connectorapi.baton.v1.Task.CreateAccountTask + (*Task_CreateResourceTask)(nil), // 21: c1.connectorapi.baton.v1.Task.CreateResourceTask + (*Task_DeleteResourceTask)(nil), // 22: c1.connectorapi.baton.v1.Task.DeleteResourceTask + (*Task_RotateCredentialsTask)(nil), // 23: c1.connectorapi.baton.v1.Task.RotateCredentialsTask + (*Task_CreateTicketTask)(nil), // 24: c1.connectorapi.baton.v1.Task.CreateTicketTask + (*Task_BulkCreateTicketsTask)(nil), // 25: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + (*Task_BulkGetTicketsTask)(nil), // 26: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + (*Task_ListTicketSchemasTask)(nil), // 27: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + (*Task_GetTicketTask)(nil), // 28: c1.connectorapi.baton.v1.Task.GetTicketTask + (*Task_ActionListSchemasTask)(nil), // 29: c1.connectorapi.baton.v1.Task.ActionListSchemasTask + (*Task_ActionGetSchemaTask)(nil), // 30: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + (*Task_ActionInvokeTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionInvokeTask + (*Task_ActionStatusTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionStatusTask + (*Task_CreateSyncDiffTask)(nil), // 33: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + (*Task_CompactSyncs)(nil), // 34: c1.connectorapi.baton.v1.Task.CompactSyncs + (*Task_CompactSyncs_CompactableSync)(nil), // 35: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + (*BatonServiceHelloRequest_BuildInfo)(nil), // 36: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + (*BatonServiceHelloRequest_OSInfo)(nil), // 37: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + (*BatonServiceUploadAssetRequest_UploadData)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + (*BatonServiceFinishTaskRequest_Error)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + (*BatonServiceFinishTaskRequest_Success)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + (*v2.ConnectorMetadata)(nil), // 43: c1.connector.v2.ConnectorMetadata + (*anypb.Any)(nil), // 44: google.protobuf.Any + (*durationpb.Duration)(nil), // 45: google.protobuf.Duration + (*status.Status)(nil), // 46: google.rpc.Status + (*v2.Resource)(nil), // 47: c1.connector.v2.Resource + (*timestamppb.Timestamp)(nil), // 48: google.protobuf.Timestamp + (*v2.Entitlement)(nil), // 49: c1.connector.v2.Entitlement + (*v2.Grant)(nil), // 50: c1.connector.v2.Grant + (*v2.AccountInfo)(nil), // 51: c1.connector.v2.AccountInfo + (*v2.CredentialOptions)(nil), // 52: c1.connector.v2.CredentialOptions + (*v2.EncryptionConfig)(nil), // 53: c1.connector.v2.EncryptionConfig + (*v2.ResourceId)(nil), // 54: c1.connector.v2.ResourceId + (*v2.TicketRequest)(nil), // 55: c1.connector.v2.TicketRequest + (*v2.TicketSchema)(nil), // 56: c1.connector.v2.TicketSchema + (*structpb.Struct)(nil), // 57: google.protobuf.Struct } var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 0, // 0: c1.connectorapi.baton.v1.Task.status:type_name -> c1.connectorapi.baton.v1.Task.Status 14, // 1: c1.connectorapi.baton.v1.Task.none:type_name -> c1.connectorapi.baton.v1.Task.NoneTask 15, // 2: c1.connectorapi.baton.v1.Task.hello:type_name -> c1.connectorapi.baton.v1.Task.HelloTask 16, // 3: c1.connectorapi.baton.v1.Task.sync_full:type_name -> c1.connectorapi.baton.v1.Task.SyncFullTask - 20, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask - 21, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask - 22, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask - 23, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask - 24, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask - 25, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask + 18, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask + 19, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask + 20, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask + 21, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask + 22, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask + 23, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask 17, // 10: c1.connectorapi.baton.v1.Task.event_feed:type_name -> c1.connectorapi.baton.v1.Task.EventFeedTask - 26, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 29, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - 30, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 27, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - 28, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - 31, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask - 32, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - 33, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask - 34, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask - 35, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - 36, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs - 19, // 22: c1.connectorapi.baton.v1.Task.list_event_feeds:type_name -> c1.connectorapi.baton.v1.Task.ListEventFeedsTask - 18, // 23: c1.connectorapi.baton.v1.Task.list_events:type_name -> c1.connectorapi.baton.v1.Task.ListEventsTask - 38, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - 39, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - 45, // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata - 46, // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any - 46, // 28: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any - 1, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task - 47, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration - 47, // 31: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration - 46, // 32: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any - 46, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any - 47, // 34: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration - 46, // 35: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any - 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - 41, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - 42, // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - 46, // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any - 48, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status - 43, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - 44, // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - 46, // 43: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any - 46, // 44: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any - 46, // 45: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any - 46, // 46: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any - 49, // 47: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource - 46, // 48: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any - 50, // 49: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp - 46, // 50: c1.connectorapi.baton.v1.Task.ListEventsTask.annotations:type_name -> google.protobuf.Any - 50, // 51: c1.connectorapi.baton.v1.Task.ListEventsTask.start_at:type_name -> google.protobuf.Timestamp - 46, // 52: c1.connectorapi.baton.v1.Task.ListEventFeedsTask.annotations:type_name -> google.protobuf.Any - 51, // 53: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement - 49, // 54: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource - 46, // 55: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any - 47, // 56: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration - 52, // 57: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant - 46, // 58: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any - 53, // 59: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo - 54, // 60: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 55, // 61: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 49, // 62: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource - 56, // 63: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 56, // 64: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 56, // 65: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 54, // 66: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 55, // 67: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 57, // 68: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 58, // 69: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 46, // 70: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 26, // 71: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 30, // 72: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 46, // 73: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 46, // 74: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 46, // 75: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any - 46, // 76: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any - 59, // 77: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct - 46, // 78: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any - 46, // 79: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any - 46, // 80: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any - 37, // 81: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - 46, // 82: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any - 46, // 83: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 46, // 84: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 46, // 85: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 46, // 86: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 46, // 87: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 46, // 88: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any - 2, // 89: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest - 4, // 90: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest - 6, // 91: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest - 10, // 92: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest - 8, // 93: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 12, // 94: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest - 3, // 95: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 5, // 96: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 7, // 97: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 11, // 98: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 9, // 99: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 13, // 100: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse - 95, // [95:101] is the sub-list for method output_type - 89, // [89:95] is the sub-list for method input_type - 89, // [89:89] is the sub-list for extension type_name - 89, // [89:89] is the sub-list for extension extendee - 0, // [0:89] is the sub-list for field type_name + 24, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 27, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + 28, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 25, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + 26, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + 29, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask + 30, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + 31, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask + 32, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask + 33, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + 34, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs + 36, // 22: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + 37, // 23: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + 43, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata + 44, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any + 44, // 26: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any + 1, // 27: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task + 45, // 28: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration + 45, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration + 44, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any + 44, // 31: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any + 45, // 32: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration + 44, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any + 38, // 34: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + 39, // 35: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + 44, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any + 46, // 38: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status + 41, // 39: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + 42, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + 44, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any + 44, // 42: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any + 44, // 43: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any + 44, // 44: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any + 47, // 45: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource + 44, // 46: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any + 48, // 47: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp + 49, // 48: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement + 47, // 49: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource + 44, // 50: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any + 45, // 51: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration + 50, // 52: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant + 44, // 53: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any + 51, // 54: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo + 52, // 55: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 53, // 56: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 47, // 57: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource + 54, // 58: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId + 54, // 59: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 54, // 60: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId + 52, // 61: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 53, // 62: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 55, // 63: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest + 56, // 64: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema + 44, // 65: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any + 24, // 66: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 28, // 67: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 44, // 68: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any + 44, // 69: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any + 44, // 70: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any + 44, // 71: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any + 57, // 72: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct + 44, // 73: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any + 44, // 74: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any + 44, // 75: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any + 35, // 76: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + 44, // 77: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any + 44, // 78: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any + 44, // 79: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any + 44, // 80: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any + 44, // 81: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any + 44, // 82: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any + 44, // 83: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any + 2, // 84: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest + 4, // 85: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest + 6, // 86: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest + 10, // 87: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest + 8, // 88: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest + 12, // 89: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest + 3, // 90: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse + 5, // 91: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse + 7, // 92: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse + 11, // 93: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse + 9, // 94: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse + 13, // 95: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse + 90, // [90:96] is the sub-list for method output_type + 84, // [84:90] is the sub-list for method input_type + 84, // [84:84] is the sub-list for extension type_name + 84, // [84:84] is the sub-list for extension extendee + 0, // [0:84] is the sub-list for field type_name } func init() { file_c1_connectorapi_baton_v1_baton_proto_init() } @@ -5582,8 +5276,6 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { (*Task_ActionStatus)(nil), (*Task_CreateSyncDiff)(nil), (*Task_CompactSyncs_)(nil), - (*Task_ListEventFeeds)(nil), - (*Task_ListEvents)(nil), } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[7].OneofWrappers = []any{ (*BatonServiceUploadAssetRequest_Metadata)(nil), @@ -5600,7 +5292,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connectorapi_baton_v1_baton_proto_rawDesc), len(file_c1_connectorapi_baton_v1_baton_proto_rawDesc)), NumEnums: 1, - NumMessages: 44, + NumMessages: 42, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go index df8c1b94..bdf204f7 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go @@ -317,24 +317,6 @@ func (x *Task) GetCompactSyncs() *Task_CompactSyncs { return nil } -func (x *Task) GetListEventFeeds() *Task_ListEventFeedsTask { - if x != nil { - if x, ok := x.xxx_hidden_TaskType.(*task_ListEventFeeds); ok { - return x.ListEventFeeds - } - } - return nil -} - -func (x *Task) GetListEvents() *Task_ListEventsTask { - if x != nil { - if x, ok := x.xxx_hidden_TaskType.(*task_ListEvents); ok { - return x.ListEvents - } - } - return nil -} - func (x *Task) GetDebug() bool { if x != nil { return x.xxx_hidden_Debug @@ -518,22 +500,6 @@ func (x *Task) SetCompactSyncs(v *Task_CompactSyncs) { x.xxx_hidden_TaskType = &task_CompactSyncs_{v} } -func (x *Task) SetListEventFeeds(v *Task_ListEventFeedsTask) { - if v == nil { - x.xxx_hidden_TaskType = nil - return - } - x.xxx_hidden_TaskType = &task_ListEventFeeds{v} -} - -func (x *Task) SetListEvents(v *Task_ListEventsTask) { - if v == nil { - x.xxx_hidden_TaskType = nil - return - } - x.xxx_hidden_TaskType = &task_ListEvents{v} -} - func (x *Task) SetDebug(v bool) { x.xxx_hidden_Debug = v } @@ -713,22 +679,6 @@ func (x *Task) HasCompactSyncs() bool { return ok } -func (x *Task) HasListEventFeeds() bool { - if x == nil { - return false - } - _, ok := x.xxx_hidden_TaskType.(*task_ListEventFeeds) - return ok -} - -func (x *Task) HasListEvents() bool { - if x == nil { - return false - } - _, ok := x.xxx_hidden_TaskType.(*task_ListEvents) - return ok -} - func (x *Task) ClearTaskType() { x.xxx_hidden_TaskType = nil } @@ -859,18 +809,6 @@ func (x *Task) ClearCompactSyncs() { } } -func (x *Task) ClearListEventFeeds() { - if _, ok := x.xxx_hidden_TaskType.(*task_ListEventFeeds); ok { - x.xxx_hidden_TaskType = nil - } -} - -func (x *Task) ClearListEvents() { - if _, ok := x.xxx_hidden_TaskType.(*task_ListEvents); ok { - x.xxx_hidden_TaskType = nil - } -} - const Task_TaskType_not_set_case case_Task_TaskType = 0 const Task_None_case case_Task_TaskType = 100 const Task_Hello_case case_Task_TaskType = 101 @@ -893,8 +831,6 @@ const Task_ActionInvoke_case case_Task_TaskType = 117 const Task_ActionStatus_case case_Task_TaskType = 118 const Task_CreateSyncDiff_case case_Task_TaskType = 119 const Task_CompactSyncs_case case_Task_TaskType = 120 -const Task_ListEventFeeds_case case_Task_TaskType = 121 -const Task_ListEvents_case case_Task_TaskType = 122 func (x *Task) WhichTaskType() case_Task_TaskType { if x == nil { @@ -943,10 +879,6 @@ func (x *Task) WhichTaskType() case_Task_TaskType { return Task_CreateSyncDiff_case case *task_CompactSyncs_: return Task_CompactSyncs_case - case *task_ListEventFeeds: - return Task_ListEventFeeds_case - case *task_ListEvents: - return Task_ListEvents_case default: return Task_TaskType_not_set_case } @@ -979,8 +911,6 @@ type Task_builder struct { ActionStatus *Task_ActionStatusTask CreateSyncDiff *Task_CreateSyncDiffTask CompactSyncs *Task_CompactSyncs - ListEventFeeds *Task_ListEventFeedsTask - ListEvents *Task_ListEventsTask // -- end of xxx_hidden_TaskType Debug bool } @@ -1054,12 +984,6 @@ func (b0 Task_builder) Build() *Task { if b.CompactSyncs != nil { x.xxx_hidden_TaskType = &task_CompactSyncs_{b.CompactSyncs} } - if b.ListEventFeeds != nil { - x.xxx_hidden_TaskType = &task_ListEventFeeds{b.ListEventFeeds} - } - if b.ListEvents != nil { - x.xxx_hidden_TaskType = &task_ListEvents{b.ListEvents} - } x.xxx_hidden_Debug = b.Debug return m0 } @@ -1162,14 +1086,6 @@ type task_CompactSyncs_ struct { CompactSyncs *Task_CompactSyncs `protobuf:"bytes,120,opt,name=compact_syncs,json=compactSyncs,proto3,oneof"` } -type task_ListEventFeeds struct { - ListEventFeeds *Task_ListEventFeedsTask `protobuf:"bytes,121,opt,name=list_event_feeds,json=listEventFeeds,proto3,oneof"` -} - -type task_ListEvents struct { - ListEvents *Task_ListEventsTask `protobuf:"bytes,122,opt,name=list_events,json=listEvents,proto3,oneof"` -} - func (*task_None) isTask_TaskType() {} func (*task_Hello) isTask_TaskType() {} @@ -1212,10 +1128,6 @@ func (*task_CreateSyncDiff) isTask_TaskType() {} func (*task_CompactSyncs_) isTask_TaskType() {} -func (*task_ListEventFeeds) isTask_TaskType() {} - -func (*task_ListEvents) isTask_TaskType() {} - type BatonServiceHelloRequest struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3"` @@ -2776,191 +2688,6 @@ func (b0 Task_EventFeedTask_builder) Build() *Task_EventFeedTask { return m0 } -type Task_ListEventsTask struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Annotations *[]*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3"` - xxx_hidden_Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3"` - xxx_hidden_StartAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start_at,json=startAt,proto3"` - xxx_hidden_EventFeedId string `protobuf:"bytes,4,opt,name=event_feed_id,json=eventFeedId,proto3"` - xxx_hidden_PageSize uint32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Task_ListEventsTask) Reset() { - *x = Task_ListEventsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Task_ListEventsTask) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Task_ListEventsTask) ProtoMessage() {} - -func (x *Task_ListEventsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Task_ListEventsTask) GetAnnotations() []*anypb.Any { - if x != nil { - if x.xxx_hidden_Annotations != nil { - return *x.xxx_hidden_Annotations - } - } - return nil -} - -func (x *Task_ListEventsTask) GetCursor() string { - if x != nil { - return x.xxx_hidden_Cursor - } - return "" -} - -func (x *Task_ListEventsTask) GetStartAt() *timestamppb.Timestamp { - if x != nil { - return x.xxx_hidden_StartAt - } - return nil -} - -func (x *Task_ListEventsTask) GetEventFeedId() string { - if x != nil { - return x.xxx_hidden_EventFeedId - } - return "" -} - -func (x *Task_ListEventsTask) GetPageSize() uint32 { - if x != nil { - return x.xxx_hidden_PageSize - } - return 0 -} - -func (x *Task_ListEventsTask) SetAnnotations(v []*anypb.Any) { - x.xxx_hidden_Annotations = &v -} - -func (x *Task_ListEventsTask) SetCursor(v string) { - x.xxx_hidden_Cursor = v -} - -func (x *Task_ListEventsTask) SetStartAt(v *timestamppb.Timestamp) { - x.xxx_hidden_StartAt = v -} - -func (x *Task_ListEventsTask) SetEventFeedId(v string) { - x.xxx_hidden_EventFeedId = v -} - -func (x *Task_ListEventsTask) SetPageSize(v uint32) { - x.xxx_hidden_PageSize = v -} - -func (x *Task_ListEventsTask) HasStartAt() bool { - if x == nil { - return false - } - return x.xxx_hidden_StartAt != nil -} - -func (x *Task_ListEventsTask) ClearStartAt() { - x.xxx_hidden_StartAt = nil -} - -type Task_ListEventsTask_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Annotations []*anypb.Any - Cursor string - StartAt *timestamppb.Timestamp - EventFeedId string - PageSize uint32 -} - -func (b0 Task_ListEventsTask_builder) Build() *Task_ListEventsTask { - m0 := &Task_ListEventsTask{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Annotations = &b.Annotations - x.xxx_hidden_Cursor = b.Cursor - x.xxx_hidden_StartAt = b.StartAt - x.xxx_hidden_EventFeedId = b.EventFeedId - x.xxx_hidden_PageSize = b.PageSize - return m0 -} - -type Task_ListEventFeedsTask struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Annotations *[]*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Task_ListEventFeedsTask) Reset() { - *x = Task_ListEventFeedsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Task_ListEventFeedsTask) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Task_ListEventFeedsTask) ProtoMessage() {} - -func (x *Task_ListEventFeedsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Task_ListEventFeedsTask) GetAnnotations() []*anypb.Any { - if x != nil { - if x.xxx_hidden_Annotations != nil { - return *x.xxx_hidden_Annotations - } - } - return nil -} - -func (x *Task_ListEventFeedsTask) SetAnnotations(v []*anypb.Any) { - x.xxx_hidden_Annotations = &v -} - -type Task_ListEventFeedsTask_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Annotations []*anypb.Any -} - -func (b0 Task_ListEventFeedsTask_builder) Build() *Task_ListEventFeedsTask { - m0 := &Task_ListEventFeedsTask{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Annotations = &b.Annotations - return m0 -} - type Task_GrantTask struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_Entitlement *v2.Entitlement `protobuf:"bytes,1,opt,name=entitlement,proto3"` @@ -2973,7 +2700,7 @@ type Task_GrantTask struct { func (x *Task_GrantTask) Reset() { *x = Task_GrantTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2985,7 +2712,7 @@ func (x *Task_GrantTask) String() string { func (*Task_GrantTask) ProtoMessage() {} func (x *Task_GrantTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3105,7 +2832,7 @@ type Task_RevokeTask struct { func (x *Task_RevokeTask) Reset() { *x = Task_RevokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3117,7 +2844,7 @@ func (x *Task_RevokeTask) String() string { func (*Task_RevokeTask) ProtoMessage() {} func (x *Task_RevokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3184,14 +2911,13 @@ type Task_CreateAccountTask struct { xxx_hidden_AccountInfo *v2.AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3"` xxx_hidden_CredentialOptions *v2.CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3"` xxx_hidden_EncryptionConfigs *[]*v2.EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3"` - xxx_hidden_ResourceTypeId string `protobuf:"bytes,4,opt,name=resource_type_id,json=resourceTypeId,proto3"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Task_CreateAccountTask) Reset() { *x = Task_CreateAccountTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3203,7 +2929,7 @@ func (x *Task_CreateAccountTask) String() string { func (*Task_CreateAccountTask) ProtoMessage() {} func (x *Task_CreateAccountTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3237,13 +2963,6 @@ func (x *Task_CreateAccountTask) GetEncryptionConfigs() []*v2.EncryptionConfig { return nil } -func (x *Task_CreateAccountTask) GetResourceTypeId() string { - if x != nil { - return x.xxx_hidden_ResourceTypeId - } - return "" -} - func (x *Task_CreateAccountTask) SetAccountInfo(v *v2.AccountInfo) { x.xxx_hidden_AccountInfo = v } @@ -3256,10 +2975,6 @@ func (x *Task_CreateAccountTask) SetEncryptionConfigs(v []*v2.EncryptionConfig) x.xxx_hidden_EncryptionConfigs = &v } -func (x *Task_CreateAccountTask) SetResourceTypeId(v string) { - x.xxx_hidden_ResourceTypeId = v -} - func (x *Task_CreateAccountTask) HasAccountInfo() bool { if x == nil { return false @@ -3288,7 +3003,6 @@ type Task_CreateAccountTask_builder struct { AccountInfo *v2.AccountInfo CredentialOptions *v2.CredentialOptions EncryptionConfigs []*v2.EncryptionConfig - ResourceTypeId string } func (b0 Task_CreateAccountTask_builder) Build() *Task_CreateAccountTask { @@ -3298,7 +3012,6 @@ func (b0 Task_CreateAccountTask_builder) Build() *Task_CreateAccountTask { x.xxx_hidden_AccountInfo = b.AccountInfo x.xxx_hidden_CredentialOptions = b.CredentialOptions x.xxx_hidden_EncryptionConfigs = &b.EncryptionConfigs - x.xxx_hidden_ResourceTypeId = b.ResourceTypeId return m0 } @@ -3311,7 +3024,7 @@ type Task_CreateResourceTask struct { func (x *Task_CreateResourceTask) Reset() { *x = Task_CreateResourceTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3323,7 +3036,7 @@ func (x *Task_CreateResourceTask) String() string { func (*Task_CreateResourceTask) ProtoMessage() {} func (x *Task_CreateResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3380,7 +3093,7 @@ type Task_DeleteResourceTask struct { func (x *Task_DeleteResourceTask) Reset() { *x = Task_DeleteResourceTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3392,7 +3105,7 @@ func (x *Task_DeleteResourceTask) String() string { func (*Task_DeleteResourceTask) ProtoMessage() {} func (x *Task_DeleteResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3474,7 +3187,7 @@ type Task_RotateCredentialsTask struct { func (x *Task_RotateCredentialsTask) Reset() { *x = Task_RotateCredentialsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3486,7 +3199,7 @@ func (x *Task_RotateCredentialsTask) String() string { func (*Task_RotateCredentialsTask) ProtoMessage() {} func (x *Task_RotateCredentialsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3583,7 +3296,7 @@ type Task_CreateTicketTask struct { func (x *Task_CreateTicketTask) Reset() { *x = Task_CreateTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3595,7 +3308,7 @@ func (x *Task_CreateTicketTask) String() string { func (*Task_CreateTicketTask) ProtoMessage() {} func (x *Task_CreateTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3690,7 +3403,7 @@ type Task_BulkCreateTicketsTask struct { func (x *Task_BulkCreateTicketsTask) Reset() { *x = Task_BulkCreateTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3702,7 +3415,7 @@ func (x *Task_BulkCreateTicketsTask) String() string { func (*Task_BulkCreateTicketsTask) ProtoMessage() {} func (x *Task_BulkCreateTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3749,7 +3462,7 @@ type Task_BulkGetTicketsTask struct { func (x *Task_BulkGetTicketsTask) Reset() { *x = Task_BulkGetTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3761,7 +3474,7 @@ func (x *Task_BulkGetTicketsTask) String() string { func (*Task_BulkGetTicketsTask) ProtoMessage() {} func (x *Task_BulkGetTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3808,7 +3521,7 @@ type Task_ListTicketSchemasTask struct { func (x *Task_ListTicketSchemasTask) Reset() { *x = Task_ListTicketSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3820,7 +3533,7 @@ func (x *Task_ListTicketSchemasTask) String() string { func (*Task_ListTicketSchemasTask) ProtoMessage() {} func (x *Task_ListTicketSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3868,7 +3581,7 @@ type Task_GetTicketTask struct { func (x *Task_GetTicketTask) Reset() { *x = Task_GetTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3880,7 +3593,7 @@ func (x *Task_GetTicketTask) String() string { func (*Task_GetTicketTask) ProtoMessage() {} func (x *Task_GetTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3941,7 +3654,7 @@ type Task_ActionListSchemasTask struct { func (x *Task_ActionListSchemasTask) Reset() { *x = Task_ActionListSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3953,7 +3666,7 @@ func (x *Task_ActionListSchemasTask) String() string { func (*Task_ActionListSchemasTask) ProtoMessage() {} func (x *Task_ActionListSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4015,7 +3728,7 @@ type Task_ActionGetSchemaTask struct { func (x *Task_ActionGetSchemaTask) Reset() { *x = Task_ActionGetSchemaTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4027,7 +3740,7 @@ func (x *Task_ActionGetSchemaTask) String() string { func (*Task_ActionGetSchemaTask) ProtoMessage() {} func (x *Task_ActionGetSchemaTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4090,7 +3803,7 @@ type Task_ActionInvokeTask struct { func (x *Task_ActionInvokeTask) Reset() { *x = Task_ActionInvokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4102,7 +3815,7 @@ func (x *Task_ActionInvokeTask) String() string { func (*Task_ActionInvokeTask) ProtoMessage() {} func (x *Task_ActionInvokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4202,7 +3915,7 @@ type Task_ActionStatusTask struct { func (x *Task_ActionStatusTask) Reset() { *x = Task_ActionStatusTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4214,7 +3927,7 @@ func (x *Task_ActionStatusTask) String() string { func (*Task_ActionStatusTask) ProtoMessage() {} func (x *Task_ActionStatusTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4289,7 +4002,7 @@ type Task_CreateSyncDiffTask struct { func (x *Task_CreateSyncDiffTask) Reset() { *x = Task_CreateSyncDiffTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4301,7 +4014,7 @@ func (x *Task_CreateSyncDiffTask) String() string { func (*Task_CreateSyncDiffTask) ProtoMessage() {} func (x *Task_CreateSyncDiffTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4376,7 +4089,7 @@ type Task_CompactSyncs struct { func (x *Task_CompactSyncs) Reset() { *x = Task_CompactSyncs{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4388,7 +4101,7 @@ func (x *Task_CompactSyncs) String() string { func (*Task_CompactSyncs) ProtoMessage() {} func (x *Task_CompactSyncs) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4451,7 +4164,7 @@ type Task_CompactSyncs_CompactableSync struct { func (x *Task_CompactSyncs_CompactableSync) Reset() { *x = Task_CompactSyncs_CompactableSync{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4463,7 +4176,7 @@ func (x *Task_CompactSyncs_CompactableSync) String() string { func (*Task_CompactSyncs_CompactableSync) ProtoMessage() {} func (x *Task_CompactSyncs_CompactableSync) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4523,7 +4236,7 @@ type BatonServiceHelloRequest_BuildInfo struct { func (x *BatonServiceHelloRequest_BuildInfo) Reset() { *x = BatonServiceHelloRequest_BuildInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4535,7 +4248,7 @@ func (x *BatonServiceHelloRequest_BuildInfo) String() string { func (*BatonServiceHelloRequest_BuildInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_BuildInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4613,7 +4326,7 @@ type BatonServiceHelloRequest_OSInfo struct { func (x *BatonServiceHelloRequest_OSInfo) Reset() { *x = BatonServiceHelloRequest_OSInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4625,7 +4338,7 @@ func (x *BatonServiceHelloRequest_OSInfo) String() string { func (*BatonServiceHelloRequest_OSInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_OSInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4763,7 +4476,7 @@ type BatonServiceUploadAssetRequest_UploadMetadata struct { func (x *BatonServiceUploadAssetRequest_UploadMetadata) Reset() { *x = BatonServiceUploadAssetRequest_UploadMetadata{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4775,7 +4488,7 @@ func (x *BatonServiceUploadAssetRequest_UploadMetadata) String() string { func (*BatonServiceUploadAssetRequest_UploadMetadata) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadMetadata) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4848,7 +4561,7 @@ type BatonServiceUploadAssetRequest_UploadData struct { func (x *BatonServiceUploadAssetRequest_UploadData) Reset() { *x = BatonServiceUploadAssetRequest_UploadData{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4860,7 +4573,7 @@ func (x *BatonServiceUploadAssetRequest_UploadData) String() string { func (*BatonServiceUploadAssetRequest_UploadData) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4910,7 +4623,7 @@ type BatonServiceUploadAssetRequest_UploadEOF struct { func (x *BatonServiceUploadAssetRequest_UploadEOF) Reset() { *x = BatonServiceUploadAssetRequest_UploadEOF{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4922,7 +4635,7 @@ func (x *BatonServiceUploadAssetRequest_UploadEOF) String() string { func (*BatonServiceUploadAssetRequest_UploadEOF) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadEOF) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4987,7 +4700,7 @@ type BatonServiceFinishTaskRequest_Error struct { func (x *BatonServiceFinishTaskRequest_Error) Reset() { *x = BatonServiceFinishTaskRequest_Error{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4999,7 +4712,7 @@ func (x *BatonServiceFinishTaskRequest_Error) String() string { func (*BatonServiceFinishTaskRequest_Error) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Error) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5085,7 +4798,7 @@ type BatonServiceFinishTaskRequest_Success struct { func (x *BatonServiceFinishTaskRequest_Success) Reset() { *x = BatonServiceFinishTaskRequest_Success{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5097,7 +4810,7 @@ func (x *BatonServiceFinishTaskRequest_Success) String() string { func (*BatonServiceFinishTaskRequest_Success) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Success) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5164,7 +4877,7 @@ var File_c1_connectorapi_baton_v1_baton_proto protoreflect.FileDescriptor const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + - "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xa2-\n" + + "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\x80)\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12=\n" + "\x06status\x18\x02 \x01(\x0e2%.c1.connectorapi.baton.v1.Task.StatusR\x06status\x12=\n" + @@ -5190,10 +4903,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\raction_invoke\x18u \x01(\v2/.c1.connectorapi.baton.v1.Task.ActionInvokeTaskH\x00R\factionInvoke\x12V\n" + "\raction_status\x18v \x01(\v2/.c1.connectorapi.baton.v1.Task.ActionStatusTaskH\x00R\factionStatus\x12]\n" + "\x10create_sync_diff\x18w \x01(\v21.c1.connectorapi.baton.v1.Task.CreateSyncDiffTaskH\x00R\x0ecreateSyncDiff\x12R\n" + - "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12]\n" + - "\x10list_event_feeds\x18y \x01(\v21.c1.connectorapi.baton.v1.Task.ListEventFeedsTaskH\x00R\x0elistEventFeeds\x12P\n" + - "\vlist_events\x18z \x01(\v2-.c1.connectorapi.baton.v1.Task.ListEventsTaskH\x00R\n" + - "listEvents\x12\x14\n" + + "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12\x14\n" + "\x05debug\x18\x03 \x01(\bR\x05debug\x1aB\n" + "\bNoneTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1aC\n" + @@ -5206,16 +4916,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x17targeted_sync_resources\x18\x04 \x03(\v2\x19.c1.connector.v2.ResourceR\x15targetedSyncResources\x1a~\n" + "\rEventFeedTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x125\n" + - "\bstart_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x1a\xe7\x01\n" + - "\x0eListEventsTask\x126\n" + - "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12%\n" + - "\x06cursor\x18\x02 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80 \xd0\x01\x01R\x06cursor\x125\n" + - "\bstart_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x12\"\n" + - "\revent_feed_id\x18\x04 \x01(\tR\veventFeedId\x12\x1b\n" + - "\tpage_size\x18\x05 \x01(\rR\bpageSize\x1aL\n" + - "\x12ListEventFeedsTask\x126\n" + - "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xf3\x01\n" + + "\bstart_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x1a\xf3\x01\n" + "\tGrantTask\x12>\n" + "\ventitlement\x18\x01 \x01(\v2\x1c.c1.connector.v2.EntitlementR\ventitlement\x127\n" + "\tprincipal\x18\x02 \x01(\v2\x19.c1.connector.v2.ResourceR\tprincipal\x126\n" + @@ -5224,13 +4925,11 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + "RevokeTask\x12,\n" + "\x05grant\x18\x01 \x01(\v2\x16.c1.connector.v2.GrantR\x05grant\x126\n" + - "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xb2\x02\n" + + "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xf9\x01\n" + "\x11CreateAccountTask\x12?\n" + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x127\n" + - "\x10resource_type_id\x18\x04 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\x0eresourceTypeId\x1aK\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x1aK\n" + "\x12CreateResourceTask\x125\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x1a\x9d\x01\n" + "\x12DeleteResourceTask\x12<\n" + @@ -5390,7 +5089,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x0eStartDebugging\x12/.c1.connectorapi.baton.v1.StartDebuggingRequest\x1a0.c1.connectorapi.baton.v1.StartDebuggingResponse\"\x00B7Z5gitlab.com/ductone/c1/pkg/pb/c1/connectorapi/baton/v1b\x06proto3" var file_c1_connectorapi_baton_v1_baton_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 44) +var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 42) var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (Task_Status)(0), // 0: c1.connectorapi.baton.v1.Task.Status (*Task)(nil), // 1: c1.connectorapi.baton.v1.Task @@ -5410,156 +5109,149 @@ var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (*Task_HelloTask)(nil), // 15: c1.connectorapi.baton.v1.Task.HelloTask (*Task_SyncFullTask)(nil), // 16: c1.connectorapi.baton.v1.Task.SyncFullTask (*Task_EventFeedTask)(nil), // 17: c1.connectorapi.baton.v1.Task.EventFeedTask - (*Task_ListEventsTask)(nil), // 18: c1.connectorapi.baton.v1.Task.ListEventsTask - (*Task_ListEventFeedsTask)(nil), // 19: c1.connectorapi.baton.v1.Task.ListEventFeedsTask - (*Task_GrantTask)(nil), // 20: c1.connectorapi.baton.v1.Task.GrantTask - (*Task_RevokeTask)(nil), // 21: c1.connectorapi.baton.v1.Task.RevokeTask - (*Task_CreateAccountTask)(nil), // 22: c1.connectorapi.baton.v1.Task.CreateAccountTask - (*Task_CreateResourceTask)(nil), // 23: c1.connectorapi.baton.v1.Task.CreateResourceTask - (*Task_DeleteResourceTask)(nil), // 24: c1.connectorapi.baton.v1.Task.DeleteResourceTask - (*Task_RotateCredentialsTask)(nil), // 25: c1.connectorapi.baton.v1.Task.RotateCredentialsTask - (*Task_CreateTicketTask)(nil), // 26: c1.connectorapi.baton.v1.Task.CreateTicketTask - (*Task_BulkCreateTicketsTask)(nil), // 27: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - (*Task_BulkGetTicketsTask)(nil), // 28: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - (*Task_ListTicketSchemasTask)(nil), // 29: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - (*Task_GetTicketTask)(nil), // 30: c1.connectorapi.baton.v1.Task.GetTicketTask - (*Task_ActionListSchemasTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionListSchemasTask - (*Task_ActionGetSchemaTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - (*Task_ActionInvokeTask)(nil), // 33: c1.connectorapi.baton.v1.Task.ActionInvokeTask - (*Task_ActionStatusTask)(nil), // 34: c1.connectorapi.baton.v1.Task.ActionStatusTask - (*Task_CreateSyncDiffTask)(nil), // 35: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - (*Task_CompactSyncs)(nil), // 36: c1.connectorapi.baton.v1.Task.CompactSyncs - (*Task_CompactSyncs_CompactableSync)(nil), // 37: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - (*BatonServiceHelloRequest_BuildInfo)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - (*BatonServiceHelloRequest_OSInfo)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - (*BatonServiceUploadAssetRequest_UploadData)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - (*BatonServiceFinishTaskRequest_Error)(nil), // 43: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - (*BatonServiceFinishTaskRequest_Success)(nil), // 44: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - (*v2.ConnectorMetadata)(nil), // 45: c1.connector.v2.ConnectorMetadata - (*anypb.Any)(nil), // 46: google.protobuf.Any - (*durationpb.Duration)(nil), // 47: google.protobuf.Duration - (*status.Status)(nil), // 48: google.rpc.Status - (*v2.Resource)(nil), // 49: c1.connector.v2.Resource - (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp - (*v2.Entitlement)(nil), // 51: c1.connector.v2.Entitlement - (*v2.Grant)(nil), // 52: c1.connector.v2.Grant - (*v2.AccountInfo)(nil), // 53: c1.connector.v2.AccountInfo - (*v2.CredentialOptions)(nil), // 54: c1.connector.v2.CredentialOptions - (*v2.EncryptionConfig)(nil), // 55: c1.connector.v2.EncryptionConfig - (*v2.ResourceId)(nil), // 56: c1.connector.v2.ResourceId - (*v2.TicketRequest)(nil), // 57: c1.connector.v2.TicketRequest - (*v2.TicketSchema)(nil), // 58: c1.connector.v2.TicketSchema - (*structpb.Struct)(nil), // 59: google.protobuf.Struct + (*Task_GrantTask)(nil), // 18: c1.connectorapi.baton.v1.Task.GrantTask + (*Task_RevokeTask)(nil), // 19: c1.connectorapi.baton.v1.Task.RevokeTask + (*Task_CreateAccountTask)(nil), // 20: c1.connectorapi.baton.v1.Task.CreateAccountTask + (*Task_CreateResourceTask)(nil), // 21: c1.connectorapi.baton.v1.Task.CreateResourceTask + (*Task_DeleteResourceTask)(nil), // 22: c1.connectorapi.baton.v1.Task.DeleteResourceTask + (*Task_RotateCredentialsTask)(nil), // 23: c1.connectorapi.baton.v1.Task.RotateCredentialsTask + (*Task_CreateTicketTask)(nil), // 24: c1.connectorapi.baton.v1.Task.CreateTicketTask + (*Task_BulkCreateTicketsTask)(nil), // 25: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + (*Task_BulkGetTicketsTask)(nil), // 26: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + (*Task_ListTicketSchemasTask)(nil), // 27: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + (*Task_GetTicketTask)(nil), // 28: c1.connectorapi.baton.v1.Task.GetTicketTask + (*Task_ActionListSchemasTask)(nil), // 29: c1.connectorapi.baton.v1.Task.ActionListSchemasTask + (*Task_ActionGetSchemaTask)(nil), // 30: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + (*Task_ActionInvokeTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionInvokeTask + (*Task_ActionStatusTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionStatusTask + (*Task_CreateSyncDiffTask)(nil), // 33: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + (*Task_CompactSyncs)(nil), // 34: c1.connectorapi.baton.v1.Task.CompactSyncs + (*Task_CompactSyncs_CompactableSync)(nil), // 35: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + (*BatonServiceHelloRequest_BuildInfo)(nil), // 36: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + (*BatonServiceHelloRequest_OSInfo)(nil), // 37: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + (*BatonServiceUploadAssetRequest_UploadData)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + (*BatonServiceFinishTaskRequest_Error)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + (*BatonServiceFinishTaskRequest_Success)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + (*v2.ConnectorMetadata)(nil), // 43: c1.connector.v2.ConnectorMetadata + (*anypb.Any)(nil), // 44: google.protobuf.Any + (*durationpb.Duration)(nil), // 45: google.protobuf.Duration + (*status.Status)(nil), // 46: google.rpc.Status + (*v2.Resource)(nil), // 47: c1.connector.v2.Resource + (*timestamppb.Timestamp)(nil), // 48: google.protobuf.Timestamp + (*v2.Entitlement)(nil), // 49: c1.connector.v2.Entitlement + (*v2.Grant)(nil), // 50: c1.connector.v2.Grant + (*v2.AccountInfo)(nil), // 51: c1.connector.v2.AccountInfo + (*v2.CredentialOptions)(nil), // 52: c1.connector.v2.CredentialOptions + (*v2.EncryptionConfig)(nil), // 53: c1.connector.v2.EncryptionConfig + (*v2.ResourceId)(nil), // 54: c1.connector.v2.ResourceId + (*v2.TicketRequest)(nil), // 55: c1.connector.v2.TicketRequest + (*v2.TicketSchema)(nil), // 56: c1.connector.v2.TicketSchema + (*structpb.Struct)(nil), // 57: google.protobuf.Struct } var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 0, // 0: c1.connectorapi.baton.v1.Task.status:type_name -> c1.connectorapi.baton.v1.Task.Status 14, // 1: c1.connectorapi.baton.v1.Task.none:type_name -> c1.connectorapi.baton.v1.Task.NoneTask 15, // 2: c1.connectorapi.baton.v1.Task.hello:type_name -> c1.connectorapi.baton.v1.Task.HelloTask 16, // 3: c1.connectorapi.baton.v1.Task.sync_full:type_name -> c1.connectorapi.baton.v1.Task.SyncFullTask - 20, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask - 21, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask - 22, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask - 23, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask - 24, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask - 25, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask + 18, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask + 19, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask + 20, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask + 21, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask + 22, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask + 23, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask 17, // 10: c1.connectorapi.baton.v1.Task.event_feed:type_name -> c1.connectorapi.baton.v1.Task.EventFeedTask - 26, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 29, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - 30, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 27, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - 28, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - 31, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask - 32, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - 33, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask - 34, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask - 35, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - 36, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs - 19, // 22: c1.connectorapi.baton.v1.Task.list_event_feeds:type_name -> c1.connectorapi.baton.v1.Task.ListEventFeedsTask - 18, // 23: c1.connectorapi.baton.v1.Task.list_events:type_name -> c1.connectorapi.baton.v1.Task.ListEventsTask - 38, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - 39, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - 45, // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata - 46, // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any - 46, // 28: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any - 1, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task - 47, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration - 47, // 31: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration - 46, // 32: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any - 46, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any - 47, // 34: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration - 46, // 35: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any - 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - 41, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - 42, // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - 46, // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any - 48, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status - 43, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - 44, // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - 46, // 43: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any - 46, // 44: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any - 46, // 45: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any - 46, // 46: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any - 49, // 47: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource - 46, // 48: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any - 50, // 49: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp - 46, // 50: c1.connectorapi.baton.v1.Task.ListEventsTask.annotations:type_name -> google.protobuf.Any - 50, // 51: c1.connectorapi.baton.v1.Task.ListEventsTask.start_at:type_name -> google.protobuf.Timestamp - 46, // 52: c1.connectorapi.baton.v1.Task.ListEventFeedsTask.annotations:type_name -> google.protobuf.Any - 51, // 53: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement - 49, // 54: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource - 46, // 55: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any - 47, // 56: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration - 52, // 57: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant - 46, // 58: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any - 53, // 59: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo - 54, // 60: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 55, // 61: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 49, // 62: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource - 56, // 63: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 56, // 64: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 56, // 65: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 54, // 66: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 55, // 67: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 57, // 68: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 58, // 69: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 46, // 70: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 26, // 71: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 30, // 72: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 46, // 73: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 46, // 74: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 46, // 75: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any - 46, // 76: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any - 59, // 77: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct - 46, // 78: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any - 46, // 79: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any - 46, // 80: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any - 37, // 81: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - 46, // 82: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any - 46, // 83: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 46, // 84: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 46, // 85: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 46, // 86: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 46, // 87: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 46, // 88: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any - 2, // 89: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest - 4, // 90: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest - 6, // 91: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest - 10, // 92: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest - 8, // 93: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 12, // 94: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest - 3, // 95: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 5, // 96: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 7, // 97: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 11, // 98: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 9, // 99: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 13, // 100: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse - 95, // [95:101] is the sub-list for method output_type - 89, // [89:95] is the sub-list for method input_type - 89, // [89:89] is the sub-list for extension type_name - 89, // [89:89] is the sub-list for extension extendee - 0, // [0:89] is the sub-list for field type_name + 24, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 27, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + 28, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 25, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + 26, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + 29, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask + 30, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + 31, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask + 32, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask + 33, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + 34, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs + 36, // 22: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + 37, // 23: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + 43, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata + 44, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any + 44, // 26: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any + 1, // 27: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task + 45, // 28: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration + 45, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration + 44, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any + 44, // 31: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any + 45, // 32: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration + 44, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any + 38, // 34: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + 39, // 35: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + 44, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any + 46, // 38: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status + 41, // 39: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + 42, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + 44, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any + 44, // 42: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any + 44, // 43: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any + 44, // 44: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any + 47, // 45: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource + 44, // 46: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any + 48, // 47: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp + 49, // 48: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement + 47, // 49: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource + 44, // 50: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any + 45, // 51: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration + 50, // 52: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant + 44, // 53: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any + 51, // 54: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo + 52, // 55: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 53, // 56: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 47, // 57: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource + 54, // 58: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId + 54, // 59: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 54, // 60: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId + 52, // 61: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 53, // 62: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 55, // 63: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest + 56, // 64: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema + 44, // 65: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any + 24, // 66: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 28, // 67: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 44, // 68: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any + 44, // 69: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any + 44, // 70: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any + 44, // 71: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any + 57, // 72: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct + 44, // 73: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any + 44, // 74: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any + 44, // 75: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any + 35, // 76: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + 44, // 77: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any + 44, // 78: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any + 44, // 79: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any + 44, // 80: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any + 44, // 81: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any + 44, // 82: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any + 44, // 83: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any + 2, // 84: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest + 4, // 85: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest + 6, // 86: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest + 10, // 87: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest + 8, // 88: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest + 12, // 89: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest + 3, // 90: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse + 5, // 91: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse + 7, // 92: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse + 11, // 93: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse + 9, // 94: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse + 13, // 95: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse + 90, // [90:96] is the sub-list for method output_type + 84, // [84:90] is the sub-list for method input_type + 84, // [84:84] is the sub-list for extension type_name + 84, // [84:84] is the sub-list for extension extendee + 0, // [0:84] is the sub-list for field type_name } func init() { file_c1_connectorapi_baton_v1_baton_proto_init() } @@ -5589,8 +5281,6 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { (*task_ActionStatus)(nil), (*task_CreateSyncDiff)(nil), (*task_CompactSyncs_)(nil), - (*task_ListEventFeeds)(nil), - (*task_ListEvents)(nil), } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[7].OneofWrappers = []any{ (*batonServiceUploadAssetRequest_Metadata)(nil), @@ -5607,7 +5297,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connectorapi_baton_v1_baton_proto_rawDesc), len(file_c1_connectorapi_baton_v1_baton_proto_rawDesc)), NumEnums: 1, - NumMessages: 44, + NumMessages: 42, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go b/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go index 5d997718..ca26d7e4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go @@ -8,7 +8,6 @@ import ( "sync" "time" - config "github.com/conductorone/baton-sdk/pb/c1/config/v1" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" "github.com/conductorone/baton-sdk/pkg/annotations" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" @@ -419,20 +418,11 @@ func (a *ActionManager) InvokeAction( func (a *ActionManager) invokeGlobalAction(ctx context.Context, name string, args *structpb.Struct) (string, v2.BatonActionStatus, *structpb.Struct, annotations.Annotations, error) { a.mu.RLock() handler, ok := a.handlers[name] - schema, schemaOk := a.schemas[name] a.mu.RUnlock() if !ok { return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.NotFound, fmt.Sprintf("handler for action %s not found", name)) } - if !schemaOk || schema == nil { - return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.Internal, fmt.Sprintf("schema for action %s not found", name)) - } - - // Validate constraints - if err := validateActionConstraints(schema.GetConstraints(), args); err != nil { - return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.InvalidArgument, err.Error()) - } oa := a.GetNewAction(name) @@ -442,7 +432,6 @@ func (a *ActionManager) invokeGlobalAction(ctx context.Context, name string, arg // If handler takes longer than 1 second, return status pending. // If handler takes longer than an hour, return status failed. go func() { - defer close(done) oa.SetStatus(ctx, v2.BatonActionStatus_BATON_ACTION_STATUS_RUNNING) handlerCtx, cancel := context.WithTimeoutCause(context.Background(), 1*time.Hour, errors.New("action handler timed out")) defer cancel() @@ -453,6 +442,7 @@ func (a *ActionManager) invokeGlobalAction(ctx context.Context, name string, arg } else { oa.SetError(ctx, oaErr) } + done <- struct{}{} }() select { @@ -496,33 +486,15 @@ func (a *ActionManager) invokeResourceAction( nil, status.Error(codes.NotFound, fmt.Sprintf("handler for action %s not found for resource type %s", actionName, resourceTypeID)) } - - schemas, ok := a.resourceSchemas[resourceTypeID] - if !ok { - a.mu.RUnlock() - return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.Internal, fmt.Sprintf("schemas not found for resource type %s", resourceTypeID)) - } - - schema, ok := schemas[actionName] - if !ok { - a.mu.RUnlock() - return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.Internal, fmt.Sprintf("schema not found for action %s", actionName)) - } a.mu.RUnlock() - // Validate constraints - if err := validateActionConstraints(schema.GetConstraints(), args); err != nil { - return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.InvalidArgument, err.Error()) - } - oa := a.GetNewAction(actionName) done := make(chan struct{}) // Invoke handler in goroutine go func() { - defer close(done) oa.SetStatus(ctx, v2.BatonActionStatus_BATON_ACTION_STATUS_RUNNING) - handlerCtx, cancel := context.WithTimeoutCause(ctxzap.ToContext(context.Background(), ctxzap.Extract(ctx)), 1*time.Hour, errors.New("action handler timed out")) + handlerCtx, cancel := context.WithTimeoutCause(context.Background(), 1*time.Hour, errors.New("action handler timed out")) defer cancel() var oaErr error oa.Rv, oa.Annos, oaErr = handler(handlerCtx, args) @@ -531,6 +503,7 @@ func (a *ActionManager) invokeResourceAction( } else { oa.SetError(ctx, oaErr) } + done <- struct{}{} }() // Wait for completion or timeout @@ -544,92 +517,3 @@ func (a *ActionManager) invokeResourceAction( return oa.Id, oa.Status, oa.Rv, oa.Annos, ctx.Err() } } - -// validateActionConstraints validates that the provided args satisfy the schema constraints. -func validateActionConstraints(constraints []*config.Constraint, args *structpb.Struct) error { - if len(constraints) == 0 { - return nil - } - - // Build map of present fields (non-null values in struct) - present := make(map[string]bool) - if args != nil { - for fieldName, value := range args.GetFields() { - if !isNullValue(value) { - present[fieldName] = true - } - } - } - - // Validate each constraint - for _, constraint := range constraints { - if err := validateConstraint(constraint, present); err != nil { - return err - } - } - return nil -} - -func validateConstraint(c *config.Constraint, present map[string]bool) error { - // Deduplicate field names to handle cases where the same field is listed multiple times - uniqueFieldNames := deduplicateStrings(c.GetFieldNames()) - - // Count how many unique primary fields are present - var primaryPresent int - for _, name := range uniqueFieldNames { - if present[name] { - primaryPresent++ - } - } - - switch c.GetKind() { - case config.ConstraintKind_CONSTRAINT_KIND_REQUIRED_TOGETHER: - if primaryPresent > 0 && primaryPresent < len(uniqueFieldNames) { - return fmt.Errorf("fields required together: %v", uniqueFieldNames) - } - case config.ConstraintKind_CONSTRAINT_KIND_MUTUALLY_EXCLUSIVE: - if primaryPresent > 1 { - return fmt.Errorf("fields are mutually exclusive: %v", uniqueFieldNames) - } - case config.ConstraintKind_CONSTRAINT_KIND_AT_LEAST_ONE: - if primaryPresent == 0 { - return fmt.Errorf("at least one required: %v", uniqueFieldNames) - } - case config.ConstraintKind_CONSTRAINT_KIND_DEPENDENT_ON: - if primaryPresent > 0 { - // Deduplicate secondary field names and check they are all present - uniqueSecondaryFieldNames := deduplicateStrings(c.GetSecondaryFieldNames()) - for _, name := range uniqueSecondaryFieldNames { - if !present[name] { - return fmt.Errorf("fields %v depend on %v which must also be present", uniqueFieldNames, uniqueSecondaryFieldNames) - } - } - } - case config.ConstraintKind_CONSTRAINT_KIND_UNSPECIFIED: - return nil - default: - return fmt.Errorf("unknown constraint kind: %v", c.GetKind()) - } - return nil -} - -// deduplicateStrings returns a new slice with duplicate strings removed, preserving order. -func deduplicateStrings(input []string) []string { - seen := make(map[string]bool) - result := make([]string, 0, len(input)) - for _, s := range input { - if !seen[s] { - seen[s] = true - result = append(result, s) - } - } - return result -} - -func isNullValue(v *structpb.Value) bool { - if v == nil { - return true - } - _, isNull := v.GetKind().(*structpb.Value_NullValue) - return isNull -} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/actions/args.go b/vendor/github.com/conductorone/baton-sdk/pkg/actions/args.go index 995a4cb2..367b3287 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/actions/args.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/actions/args.go @@ -541,231 +541,3 @@ func NewReturnValues(success bool, fields ...ReturnField) *structpb.Struct { return rv } - -// entitlementToBasicEntitlement converts a v2.Entitlement to a config.Entitlement. -func entitlementToBasicEntitlement(entitlement *v2.Entitlement) *config.Entitlement { - var grantableToResourceTypeIDs []string - for _, rt := range entitlement.GetGrantableTo() { - grantableToResourceTypeIDs = append(grantableToResourceTypeIDs, rt.GetId()) - } - - var resourceId, resourceTypeId string - if entitlement.GetResource() != nil && entitlement.GetResource().GetId() != nil { - resourceId = entitlement.GetResource().GetId().GetResource() - resourceTypeId = entitlement.GetResource().GetId().GetResourceType() - } - - return config.Entitlement_builder{ - Id: entitlement.GetId(), - DisplayName: entitlement.GetDisplayName(), - Description: entitlement.GetDescription(), - Slug: entitlement.GetSlug(), - Purpose: entitlement.GetPurpose().String(), - GrantableToResourceTypeIds: grantableToResourceTypeIDs, - ResourceId: resourceId, - ResourceTypeId: resourceTypeId, - }.Build() -} - -// basicEntitlementToEntitlement converts a config.Entitlement to a v2.Entitlement. -func basicEntitlementToEntitlement(basicEntitlement *config.Entitlement) *v2.Entitlement { - var grantableTo []*v2.ResourceType - for _, rtId := range basicEntitlement.GetGrantableToResourceTypeIds() { - grantableTo = append(grantableTo, &v2.ResourceType{Id: rtId}) - } - - var resource *v2.Resource - if basicEntitlement.GetResourceId() != "" && basicEntitlement.GetResourceTypeId() != "" { - resource = &v2.Resource{ - Id: &v2.ResourceId{ - Resource: basicEntitlement.GetResourceId(), - ResourceType: basicEntitlement.GetResourceTypeId(), - }, - } - } - - // Parse purpose from string - purposeValue := v2.Entitlement_PURPOSE_VALUE_UNSPECIFIED - switch basicEntitlement.GetPurpose() { - case "PURPOSE_VALUE_ASSIGNMENT": - purposeValue = v2.Entitlement_PURPOSE_VALUE_ASSIGNMENT - case "PURPOSE_VALUE_PERMISSION": - purposeValue = v2.Entitlement_PURPOSE_VALUE_PERMISSION - case "PURPOSE_VALUE_OWNERSHIP": - purposeValue = v2.Entitlement_PURPOSE_VALUE_OWNERSHIP - } - - return &v2.Entitlement{ - Id: basicEntitlement.GetId(), - DisplayName: basicEntitlement.GetDisplayName(), - Description: basicEntitlement.GetDescription(), - Slug: basicEntitlement.GetSlug(), - Purpose: purposeValue, - GrantableTo: grantableTo, - Resource: resource, - } -} - -// grantToBasicGrant converts a v2.Grant to a config.Grant. -func grantToBasicGrant(grant *v2.Grant) *config.Grant { - var entitlementRef *config.EntitlementRef - if grant.GetEntitlement() != nil { - entitlementRef = config.EntitlementRef_builder{ - Id: grant.GetEntitlement().GetId(), - }.Build() - } - - var principal *config.Resource - if grant.GetPrincipal() != nil { - principal = resourceToBasicResource(grant.GetPrincipal()) - } - - return config.Grant_builder{ - Id: grant.GetId(), - Entitlement: entitlementRef, - Principal: principal, - }.Build() -} - -// basicGrantToGrant converts a config.Grant to a v2.Grant. -func basicGrantToGrant(basicGrant *config.Grant) *v2.Grant { - var entitlement *v2.Entitlement - if basicGrant.GetEntitlement() != nil { - entitlement = &v2.Entitlement{ - Id: basicGrant.GetEntitlement().GetId(), - } - } - - var principal *v2.Resource - if basicGrant.GetPrincipal() != nil { - principal = basicResourceToResource(basicGrant.GetPrincipal()) - } - - return &v2.Grant{ - Id: basicGrant.GetId(), - Entitlement: entitlement, - Principal: principal, - } -} - -// GetEntitlementListFieldArg extracts a list of Entitlement proto messages from the args struct by key. -// Each Entitlement is expected to be stored as a JSON-serialized struct value. -// Returns the list of Entitlement and true if found and valid, or nil and false otherwise. -func GetEntitlementListFieldArg(args *structpb.Struct, key string) ([]*v2.Entitlement, bool) { - if args == nil || args.Fields == nil { - return nil, false - } - value, ok := args.Fields[key] - if !ok { - return nil, false - } - listValue, ok := value.GetKind().(*structpb.Value_ListValue) - if !ok { - return nil, false - } - var entitlements []*v2.Entitlement - for _, v := range listValue.ListValue.Values { - structValue, ok := v.GetKind().(*structpb.Value_StructValue) - if !ok { - return nil, false - } - - // Marshal the struct value back to JSON, then unmarshal into the proto message - jsonBytes, err := protojson.Marshal(structValue.StructValue) - if err != nil { - return nil, false - } - - basicEntitlement := &config.Entitlement{} - if err := protojson.Unmarshal(jsonBytes, basicEntitlement); err != nil { - return nil, false - } - - entitlements = append(entitlements, basicEntitlementToEntitlement(basicEntitlement)) - } - return entitlements, true -} - -// GetGrantListFieldArg extracts a list of Grant proto messages from the args struct by key. -// Each Grant is expected to be stored as a JSON-serialized struct value. -// Returns the list of Grant and true if found and valid, or nil and false otherwise. -func GetGrantListFieldArg(args *structpb.Struct, key string) ([]*v2.Grant, bool) { - if args == nil || args.Fields == nil { - return nil, false - } - value, ok := args.Fields[key] - if !ok { - return nil, false - } - listValue, ok := value.GetKind().(*structpb.Value_ListValue) - if !ok { - return nil, false - } - var grants []*v2.Grant - for _, v := range listValue.ListValue.Values { - structValue, ok := v.GetKind().(*structpb.Value_StructValue) - if !ok { - return nil, false - } - - // Marshal the struct value back to JSON, then unmarshal into the proto message - jsonBytes, err := protojson.Marshal(structValue.StructValue) - if err != nil { - return nil, false - } - - basicGrant := &config.Grant{} - if err := protojson.Unmarshal(jsonBytes, basicGrant); err != nil { - return nil, false - } - - grants = append(grants, basicGrantToGrant(basicGrant)) - } - return grants, true -} - -// NewEntitlementListReturnField creates a return field with a list of Entitlement proto values. -func NewEntitlementListReturnField(key string, entitlements []*v2.Entitlement) (ReturnField, error) { - listValues := make([]*structpb.Value, len(entitlements)) - for i, entitlement := range entitlements { - if entitlement == nil { - return ReturnField{}, fmt.Errorf("entitlement at index %d cannot be nil", i) - } - basicEntitlement := entitlementToBasicEntitlement(entitlement) - jsonBytes, err := protojson.Marshal(basicEntitlement) - if err != nil { - return ReturnField{}, fmt.Errorf("failed to marshal entitlement: %w", err) - } - - structValue := &structpb.Struct{} - if err := protojson.Unmarshal(jsonBytes, structValue); err != nil { - return ReturnField{}, fmt.Errorf("failed to unmarshal entitlement to struct: %w", err) - } - - listValues[i] = structpb.NewStructValue(structValue) - } - return ReturnField{Key: key, Value: structpb.NewListValue(&structpb.ListValue{Values: listValues})}, nil -} - -// NewGrantListReturnField creates a return field with a list of Grant proto values. -func NewGrantListReturnField(key string, grants []*v2.Grant) (ReturnField, error) { - listValues := make([]*structpb.Value, len(grants)) - for i, grant := range grants { - if grant == nil { - return ReturnField{}, fmt.Errorf("grant at index %d cannot be nil", i) - } - basicGrant := grantToBasicGrant(grant) - jsonBytes, err := protojson.Marshal(basicGrant) - if err != nil { - return ReturnField{}, fmt.Errorf("failed to marshal grant: %w", err) - } - - structValue := &structpb.Struct{} - if err := protojson.Unmarshal(jsonBytes, structValue); err != nil { - return ReturnField{}, fmt.Errorf("failed to unmarshal grant to struct: %w", err) - } - - listValues[i] = structpb.NewStructValue(structValue) - } - return ReturnField{Key: key, Value: structpb.NewListValue(&structpb.ListValue{Values: listValues})}, nil -} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go index 8adde283..93a6e3ba 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go @@ -16,9 +16,8 @@ import ( ) type RunTimeOpts struct { - SessionStore sessions.SessionStore - TokenSource oauth2.TokenSource - SelectedAuthMethod string + SessionStore sessions.SessionStore + TokenSource oauth2.TokenSource } // GetConnectorFunc is a function type that creates a connector instance. @@ -36,8 +35,7 @@ func WithSessionCache(ctx context.Context, constructor sessions.SessionStoreCons } type ConnectorOpts struct { - TokenSource oauth2.TokenSource - SelectedAuthMethod string + TokenSource oauth2.TokenSource } type NewConnector[T field.Configurable] func(ctx context.Context, cfg T, opts *ConnectorOpts) (connectorbuilder.ConnectorBuilderV2, []connectorbuilder.Opt, error) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go index 1b7aadcd..93c0e5b8 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go @@ -9,8 +9,6 @@ import ( "os" "time" - "github.com/conductorone/baton-sdk/pkg/connectorbuilder" - "github.com/conductorone/baton-sdk/pkg/types" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "github.com/maypok86/otter/v2" "github.com/spf13/cobra" @@ -179,13 +177,6 @@ func MakeMainCommand[T field.Configurable]( if v.GetBool("skip-full-sync") { opts = append(opts, connectorrunner.WithFullSyncDisabled()) } - if v.GetBool("health-check") { - opts = append(opts, connectorrunner.WithHealthCheck( - true, - v.GetInt("health-check-port"), - v.GetString("health-check-bind-address"), - )) - } } else { switch { case v.GetString("grant-entitlement") != "": @@ -243,7 +234,6 @@ func MakeMainCommand[T field.Configurable]( login, email, profile, - v.GetString("create-account-resource-type"), )) case v.GetString("create-account-login") != "": // should only be here if no create-account-profile is provided, so lets make one. @@ -261,7 +251,6 @@ func MakeMainCommand[T field.Configurable]( v.GetString("create-account-login"), v.GetString("create-account-email"), profile, - v.GetString("create-account-resource-type"), )) case v.GetString("invoke-action") != "": invokeActionArgsStr := v.GetString("invoke-action-args") @@ -380,8 +369,7 @@ func MakeMainCommand[T field.Configurable]( opts = append(opts, connectorrunner.WithSkipGrants(v.GetBool("skip-grants"))) } - // Save the selected authentication method and get the connector. - c, err := getconnector(runCtx, t, RunTimeOpts{SelectedAuthMethod: v.GetString("auth-method")}) + c, err := getconnector(runCtx, t, RunTimeOpts{}) if err != nil { return err } @@ -550,7 +538,6 @@ func MakeGRPCServerCommand[T field.Configurable]( otterOptions.MaximumWeight = uint64(sessionStoreMaximumSize) } }), - SelectedAuthMethod: v.GetString("auth-method"), }) if err != nil { return err @@ -616,7 +603,6 @@ func MakeCapabilitiesCommand[T field.Configurable]( v *viper.Viper, confschema field.Configuration, getconnector GetConnectorFunc2[T], - opts ...connectorrunner.Option, ) func(*cobra.Command, []string) error { return func(cmd *cobra.Command, args []string) error { // NOTE(shackra): bind all the flags (persistent and @@ -638,60 +624,29 @@ func MakeCapabilitiesCommand[T field.Configurable]( return err } - var c types.ConnectorServer - - c, err = defaultConnectorBuilder(ctx, opts...) + readFromPath := true + decodeOpts := field.WithAdditionalDecodeHooks(field.FileUploadDecodeHook(readFromPath)) + t, err := MakeGenericConfiguration[T](v, decodeOpts) if err != nil { - return fmt.Errorf("failed to build default connector: %w", err) - } - - if c == nil { - readFromPath := true - decodeOpts := field.WithAdditionalDecodeHooks(field.FileUploadDecodeHook(readFromPath)) - t, err := MakeGenericConfiguration[T](v, decodeOpts) - if err != nil { - return fmt.Errorf("failed to make configuration: %w", err) - } - authMethod := v.GetString("auth-method") - // validate required fields and relationship constraints - if err := field.Validate(confschema, t, field.WithAuthMethod(authMethod)); err != nil { - return err - } - - c, err = getconnector(runCtx, t, RunTimeOpts{SelectedAuthMethod: authMethod}) - if err != nil { - return err - } + return fmt.Errorf("failed to make configuration: %w", err) } - - if c == nil { - return fmt.Errorf("could not create connector %w", err) + // validate required fields and relationship constraints + if err := field.Validate(confschema, t, field.WithAuthMethod(v.GetString("auth-method"))); err != nil { + return err } - type getter interface { - GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilities, error) + c, err := getconnector(runCtx, t, RunTimeOpts{}) + if err != nil { + return err } - var capabilities *v2.ConnectorCapabilities - - if getCap, ok := c.(getter); ok { - capabilities, err = getCap.GetCapabilities(runCtx) - if err != nil { - return err - } + md, err := c.GetMetadata(runCtx, &v2.ConnectorServiceGetMetadataRequest{}) + if err != nil { + return err } - if capabilities == nil { - md, err := c.GetMetadata(runCtx, &v2.ConnectorServiceGetMetadataRequest{}) - if err != nil { - return err - } - - if !md.GetMetadata().HasCapabilities() { - return fmt.Errorf("connector does not support capabilities") - } - - capabilities = md.GetMetadata().GetCapabilities() + if !md.GetMetadata().HasCapabilities() { + return fmt.Errorf("connector does not support capabilities") } protoMarshaller := protojson.MarshalOptions{ @@ -700,7 +655,7 @@ func MakeCapabilitiesCommand[T field.Configurable]( } a := &anypb.Any{} - err = anypb.MarshalFrom(a, capabilities, proto.MarshalOptions{Deterministic: true}) + err = anypb.MarshalFrom(a, md.GetMetadata().GetCapabilities(), proto.MarshalOptions{Deterministic: true}) if err != nil { return err } @@ -739,20 +694,3 @@ func MakeConfigSchemaCommand[T field.Configurable]( return nil } } - -func defaultConnectorBuilder(ctx context.Context, opts ...connectorrunner.Option) (types.ConnectorServer, error) { - defaultConnector, err := connectorrunner.ExtractDefaultConnector(ctx, opts...) - if err != nil { - return nil, err - } - - if defaultConnector == nil { - return nil, nil - } - - c, err := connectorbuilder.NewConnector(ctx, defaultConnector) - if err != nil { - return nil, err - } - return c, nil -} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go index 3d9cf060..c2fd1848 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go @@ -178,24 +178,12 @@ func OptionallyAddLambdaCommand[T field.Configurable]( configStructMap := configStruct.AsMap() - var ( - fieldOptions []field.Option - schemaFields []field.SchemaField - authMethodStr string - ) + var fieldOptions []field.Option if authMethod, ok := configStructMap["auth-method"]; ok { - if authMethodStr, ok = authMethod.(string); ok { + if authMethodStr, ok := authMethod.(string); ok { fieldOptions = append(fieldOptions, field.WithAuthMethod(authMethodStr)) } } - schemaFieldsMap := connectorSchema.FieldGroupFields(authMethodStr) - for _, field := range schemaFieldsMap { - schemaFields = append(schemaFields, field) - } - - if len(schemaFields) == 0 { - schemaFields = connectorSchema.Fields - } if err := field.Validate(connectorSchema, t, fieldOptions...); err != nil { return fmt.Errorf("lambda-run: failed to validate config: %w", err) @@ -226,10 +214,9 @@ func OptionallyAddLambdaCommand[T field.Configurable]( otterOptions.MaximumWeight = uint64(sessionStoreMaximumSize) } }), - SelectedAuthMethod: authMethodStr, } - if hasOauthField(schemaFields) { + if hasOauthField(connectorSchema.Fields) { ops.TokenSource = &lambdaTokenSource{ ctx: runCtx, webKey: webKey, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go index f6ae6be2..d9304524 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go @@ -30,8 +30,7 @@ func RunConnector[T field.Configurable]( ) { f := func(ctx context.Context, cfg T, runTimeOpts cli.RunTimeOpts) (types.ConnectorServer, error) { l := ctxzap.Extract(ctx) - connector, builderOpts, err := cf(ctx, cfg, &cli.ConnectorOpts{TokenSource: runTimeOpts.TokenSource, - SelectedAuthMethod: runTimeOpts.SelectedAuthMethod}) + connector, builderOpts, err := cf(ctx, cfg, &cli.ConnectorOpts{TokenSource: runTimeOpts.TokenSource}) if err != nil { return nil, err } @@ -208,28 +207,15 @@ func DefineConfigurationV2[T field.Configurable]( return nil, nil, err } - defaultConnector, err := connectorrunner.ExtractDefaultConnector(ctx, options...) + _, err = cli.AddCommand(mainCMD, v, &schema, &cobra.Command{ + Use: "capabilities", + Short: "Get connector capabilities", + RunE: cli.MakeCapabilitiesCommand(ctx, connectorName, v, confschema, connector), + }) + if err != nil { return nil, nil, err } - if defaultConnector == nil { - _, err = cli.AddCommand(mainCMD, v, &schema, &cobra.Command{ - Use: "capabilities", - Short: "Get connector capabilities", - RunE: cli.MakeCapabilitiesCommand(ctx, connectorName, v, confschema, connector), - }) - if err != nil { - return nil, nil, err - } - } else { - // We don't want to use cli.AddCommand here because we don't want to validate config flags - // So we can call capabilities even with incomplete config - mainCMD.AddCommand(&cobra.Command{ - Use: "capabilities", - Short: "Get connector capabilities", - RunE: cli.MakeCapabilitiesCommand(ctx, connectorName, v, confschema, connector, options...), - }) - } _, err = cli.AddCommand(mainCMD, v, nil, &cobra.Command{ Use: "config", @@ -241,30 +227,6 @@ func DefineConfigurationV2[T field.Configurable]( return nil, nil, err } - // Health check client command - doesn't need connector config validation - healthCheckCmd := &cobra.Command{ - Use: "health-check", - Short: "Check the health of a running connector", - Long: `Query the health check server of a running connector. - -This command is designed for use in container/Kubernetes health check scenarios. -It queries the specified endpoint and exits with code 0 if healthy, or non-zero otherwise. - -Examples: - # Check health using defaults (localhost:8081/health) - connector-name health-check - - # Check readiness endpoint - connector-name health-check --endpoint=ready - - # Check liveness with custom port - connector-name health-check --endpoint=live --health-check-port=9090`, - RunE: cli.MakeHealthCheckCommand(ctx, v), - } - healthCheckCmd.Flags().String("endpoint", "health", "Endpoint to check: health, ready, or live") - healthCheckCmd.Flags().Int("timeout", 5, "Request timeout in seconds") - mainCMD.AddCommand(healthCheckCmd) - return v, mainCMD, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go index adccd2ef..e9c59e63 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go @@ -59,64 +59,30 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe start := b.nowFunc() tt := tasks.CreateAccountType l := ctxzap.Extract(ctx) - - if len(b.accountManagers) == 0 { + if b.accountManager == nil { l.Error("error: connector does not have account manager configured") - err := status.Error(codes.Unimplemented, "connector does not have account manager configured") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err - } - - var accountManager AccountManagerLimited - if request.GetResourceTypeId() == "" { - if len(b.accountManagers) == 1 { - // If there's only one account manager, use it. - for _, am := range b.accountManagers { - accountManager = am - break - } - } else { - // If there are multiple account managers, default to user resource type. - var ok bool - accountManager, ok = b.accountManagers["user"] - if !ok { - err := status.Error(codes.Unimplemented, "connector has multiple account managers configured, but no resource type specified, and no default account manager configured") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err - } - } - } - - // If resource type is specified, use the account manager for that resource type. - if accountManager == nil { - var ok bool - accountManager, ok = b.accountManagers[request.GetResourceTypeId()] - if !ok { - l.Error("error: connector does not have account manager configured") - err := status.Errorf(codes.Unimplemented, "connector does not have account manager configured for resource type: %s", request.GetResourceTypeId()) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err - } + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.Unimplemented, "connector does not have account manager configured") } opts, err := crypto.ConvertCredentialOptions(ctx, b.clientSecret, request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: converting credential options failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: converting credential options failed: %w", err) } - result, plaintexts, annos, err := accountManager.CreateAccount(ctx, request.GetAccountInfo(), opts) + result, plaintexts, annos, err := b.accountManager.CreateAccount(ctx, request.GetAccountInfo(), opts) if err != nil { l.Error("error: create account failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: create account failed: %w", err) } pkem, err := crypto.NewEncryptionManager(request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: creating encryption manager failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: creating encryption manager failed: %w", err) } @@ -124,7 +90,7 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe for _, plaintextCredential := range plaintexts { encryptedData, err := pkem.Encrypt(ctx, plaintextCredential) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, err } encryptedDatas = append(encryptedDatas, encryptedData...) @@ -145,25 +111,26 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe case *v2.CreateAccountResponse_InProgressResult: rv.SetInProgress(proto.ValueOrDefault(r)) default: - err := status.Error(codes.Unimplemented, fmt.Sprintf("unknown result type: %T", result)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.Unimplemented, fmt.Sprintf("unknown result type: %T", result)) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) return rv, nil } -func (b *builder) addAccountManager(_ context.Context, typeId string, in any) error { +func (b *builder) addAccountManager(_ context.Context, typeId string, in interface{}) error { if _, ok := in.(OldAccountManager); ok { return fmt.Errorf("error: old account manager interface implemented for %s", typeId) } if accountManager, ok := in.(AccountManagerLimited); ok { - if _, ok := b.accountManagers[typeId]; ok { + // NOTE(kans): currently unused - but these should probably be (resource) typed + b.accountManagers[typeId] = accountManager + if b.accountManager != nil { return fmt.Errorf("error: duplicate resource type found for account manager %s", typeId) } - b.accountManagers[typeId] = accountManager + b.accountManager = accountManager } return nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/actions.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/actions.go index b24adff3..0edab281 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/actions.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/actions.go @@ -108,7 +108,7 @@ func (b *builder) ListActionSchemas(ctx context.Context, request *v2.ListActionS actionSchemas, _, err := b.actionManager.ListActionSchemas(ctx, resourceTypeID) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: listing action schemas failed: %w", err) } @@ -129,7 +129,7 @@ func (b *builder) GetActionSchema(ctx context.Context, request *v2.GetActionSche actionSchema, annos, err := b.actionManager.GetActionSchema(ctx, request.GetName()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: action schema %s not found: %w", request.GetName(), err) } @@ -152,7 +152,7 @@ func (b *builder) InvokeAction(ctx context.Context, request *v2.InvokeActionRequ id, actionStatus, resp, annos, err := b.actionManager.InvokeAction(ctx, request.GetName(), resourceTypeID, request.GetArgs()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: invoking action failed: %w", err) } @@ -177,7 +177,7 @@ func (b *builder) GetActionStatus(ctx context.Context, request *v2.GetActionStat actionStatus, name, rv, annos, err := b.actionManager.GetActionStatus(ctx, request.GetId()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: action status for id %s not found: %w", request.GetId(), err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go index e5fc4f9b..40df7dfd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go @@ -68,6 +68,7 @@ type builder struct { metadataProvider MetadataProvider validateProvider ValidateProvider ticketManager TicketManagerLimited + accountManager AccountManagerLimited resourceSyncers map[string]ResourceSyncerV2 resourceProvisioners map[string]ResourceProvisionerV2Limited resourceManagers map[string]ResourceManagerV2Limited @@ -75,8 +76,8 @@ type builder struct { resourceTargetedSyncers map[string]ResourceTargetedSyncerLimited credentialManagers map[string]CredentialManagerLimited eventFeeds map[string]EventFeed - accountManagers map[string]AccountManagerLimited - actionManager ActionManager // Unified action manager for all actions + accountManagers map[string]AccountManagerLimited // NOTE(kans): currently unused + actionManager ActionManager // Unified action manager for all actions } // NewConnector creates a new ConnectorServer for a new resource. @@ -104,6 +105,7 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne metadataProvider: nil, validateProvider: nil, ticketManager: nil, + accountManager: nil, nowFunc: time.Now, clientSecret: clientSecretJWK, resourceSyncers: make(map[string]ResourceSyncerV2), @@ -263,13 +265,13 @@ func (b *builder) GetMetadata(ctx context.Context, request *v2.ConnectorServiceG tt := tasks.GetMetadataType md, err := b.metadataProvider.Metadata(ctx) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, err } - md.Capabilities, err = b.GetCapabilities(ctx) + md.Capabilities, err = b.getCapabilities(ctx) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, err } @@ -332,8 +334,8 @@ func (b *builder) Cleanup(ctx context.Context, request *v2.ConnectorServiceClean return resp, err } -// GetCapabilities gets all capabilities for a connector. -func (b *builder) GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilities, error) { +// getCapabilities gets all capabilities for a connector. +func (b *builder) getCapabilities(ctx context.Context) (*v2.ConnectorCapabilities, error) { connectorCaps := make(map[v2.Capability]struct{}) resourceTypeCapabilities := []*v2.ResourceTypeCapability{} @@ -343,7 +345,6 @@ func (b *builder) GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilitie if _, exists := b.resourceTargetedSyncers[resourceTypeID]; exists { caps = append(caps, v2.Capability_CAPABILITY_TARGETED_SYNC) - connectorCaps[v2.Capability_CAPABILITY_SERVICE_MODE_TARGETED_SYNC] = struct{}{} } if _, exists := b.resourceProvisioners[resourceTypeID]; exists { @@ -385,7 +386,7 @@ func (b *builder) GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilitie } // Check for account provisioning capability (global, not per resource type) - if len(b.accountManagers) > 0 { + if b.accountManager != nil { connectorCaps[v2.Capability_CAPABILITY_ACCOUNT_PROVISIONING] = struct{}{} } sort.Slice(resourceTypeCapabilities, func(i, j int) bool { @@ -451,14 +452,13 @@ func getCredentialDetails(ctx context.Context, b *builder) (*v2.CredentialDetail rv := &v2.CredentialDetails{} // Check for account provisioning capability details - for _, am := range b.accountManagers { - accountProvisioningCapabilityDetails, _, err := am.CreateAccountCapabilityDetails(ctx) + if b.accountManager != nil { + accountProvisioningCapabilityDetails, _, err := b.accountManager.CreateAccountCapabilityDetails(ctx) if err != nil { l.Error("error: getting account provisioning details", zap.Error(err)) return nil, fmt.Errorf("error: getting account provisioning details: %w", err) } rv.SetCapabilityAccountProvisioning(accountProvisioningCapabilityDetails) - break // Only need one account manager's details } // Check for credential rotation capability details diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go index ad8ea9af..4f303e94 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go @@ -47,29 +47,28 @@ func (b *builder) RotateCredential(ctx context.Context, request *v2.RotateCreden manager, ok := b.credentialManagers[rt] if !ok { l.Error("error: resource type does not have credential manager configured", zap.String("resource_type", rt)) - err := status.Error(codes.Unimplemented, "resource type does not have credential manager configured") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.Unimplemented, "resource type does not have credential manager configured") } opts, err := crypto.ConvertCredentialOptions(ctx, b.clientSecret, request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: converting credential options failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: converting credential options failed: %w", err) } plaintexts, annos, err := manager.Rotate(ctx, request.GetResourceId(), opts) if err != nil { l.Error("error: rotate credentials on resource failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: rotate credentials on resource failed: %w", err) } pkem, err := crypto.NewEncryptionManager(request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: creating encryption manager failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: creating encryption manager failed: %w", err) } @@ -77,7 +76,7 @@ func (b *builder) RotateCredential(ctx context.Context, request *v2.RotateCreden for _, plaintextCredential := range plaintexts { encryptedData, err := pkem.Encrypt(ctx, plaintextCredential) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, err } encryptedDatas = append(encryptedDatas, encryptedData...) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/events.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/events.go index 7b5bc745..c6bf352f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/events.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/events.go @@ -122,7 +122,7 @@ func (b *builder) ListEvents(ctx context.Context, request *v2.ListEventsRequest) Cursor: request.GetCursor(), }) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: listing events failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go index 2f28d591..4c47e653 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go @@ -37,7 +37,7 @@ type ResourceManagerV2Limited interface { // // This is the recommended interface for implementing resource creation operations in new connectors. type ResourceManagerV2 interface { - ResourceSyncerV2 + ResourceSyncer ResourceManagerV2Limited } @@ -62,7 +62,7 @@ type ResourceDeleterLimited interface { // This is the recommended interface for implementing resource deletion operations in new connectors. // It differs from ResourceDeleter by having the resource, not just the id. type ResourceDeleterV2 interface { - ResourceSyncerV2 + ResourceSyncer ResourceDeleterV2Limited } @@ -82,14 +82,13 @@ func (b *builder) CreateResource(ctx context.Context, request *v2.CreateResource manager, ok := b.resourceManagers[rt] if !ok { l.Error("error: resource type does not have resource Create() configured", zap.String("resource_type", rt)) - err := status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Create() configured", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Create() configured", rt)) } resource, annos, err := manager.Create(ctx, request.GetResource()) if err != nil { l.Error("error: create resource failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: create resource failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -115,15 +114,14 @@ func (b *builder) DeleteResource(ctx context.Context, request *v2.DeleteResource if !ok { l.Error("error: resource type does not have resource Delete() configured", zap.String("resource_type", rt)) - err := status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Delete() configured", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Delete() configured", rt)) } annos, err := rsDeleter.Delete(ctx, request.GetResourceId(), request.GetParentResourceId()) if err != nil { l.Error("error: deleteV2 resource failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: delete resource failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -149,15 +147,14 @@ func (b *builder) DeleteResourceV2(ctx context.Context, request *v2.DeleteResour if !ok { l.Error("error: resource type does not have resource Delete() configured", zap.String("resource_type", rt)) - err := status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Delete() configured", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Delete() configured", rt)) } annos, err := rsDeleter.Delete(ctx, request.GetResourceId(), request.GetParentResourceId()) if err != nil { l.Error("error: deleteV2 resource failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: delete resource failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go index 6f09907d..d0f8cf2e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go @@ -11,8 +11,6 @@ import ( "github.com/conductorone/baton-sdk/pkg/types/tasks" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.uber.org/zap" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) // ResourceProvisioner extends ResourceSyncer to add capabilities for granting and revoking access. @@ -46,7 +44,7 @@ type GrantProvisioner interface { // This is the recommended interface for implementing provisioning operations in new connectors. // It differs from ResourceProvisioner by returning a list of grants from the Grant method. type ResourceProvisionerV2 interface { - ResourceSyncerV2 + ResourceSyncer ResourceProvisionerV2Limited } @@ -73,9 +71,8 @@ func (b *builder) Grant(ctx context.Context, request *v2.GrantManagerServiceGran if !ok { l.Error("error: resource type does not have provisioner configured", zap.String("resource_type", rt)) - err := status.Errorf(codes.Unimplemented, "resource type %s does not have provisioner configured", rt) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: resource type does not have provisioner configured") } retryer := retry.NewRetryer(ctx, retry.RetryConfig{ @@ -93,7 +90,7 @@ func (b *builder) Grant(ctx context.Context, request *v2.GrantManagerServiceGran if retryer.ShouldWaitAndRetry(ctx, err) { continue } - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("grant failed: %w", err) } } @@ -117,9 +114,8 @@ func (b *builder) Revoke(ctx context.Context, request *v2.GrantManagerServiceRev if revokeProvisioner == nil { l.Error("error: resource type does not have provisioner configured", zap.String("resource_type", rt)) - err := status.Errorf(codes.Unimplemented, "resource type %s does not have provisioner configured", rt) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: resource type does not have provisioner configured") } retryer := retry.NewRetryer(ctx, retry.RetryConfig{ @@ -137,7 +133,7 @@ func (b *builder) Revoke(ctx context.Context, request *v2.GrantManagerServiceRev if retryer.ShouldWaitAndRetry(ctx, err) { continue } - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("revoke failed: %w", err) } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_syncer.go index 4378730f..4d52b830 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_syncer.go @@ -89,9 +89,8 @@ func (b *builder) ListResourceTypes( var out []*v2.ResourceType if len(b.resourceSyncers) == 0 { - err := status.Error(codes.FailedPrecondition, "no resource builders found") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: no resource builders found") } for _, rb := range b.resourceSyncers { @@ -99,9 +98,8 @@ func (b *builder) ListResourceTypes( } if len(out) == 0 { - err := status.Error(codes.FailedPrecondition, "no resource types found") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: no resource types found") } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -117,9 +115,8 @@ func (b *builder) ListResources(ctx context.Context, request *v2.ResourcesServic tt := tasks.ListResourcesType rb, ok := b.resourceSyncers[request.GetResourceTypeId()] if !ok { - err := fmt.Errorf("error: list resources with unknown resource type %s", request.GetResourceTypeId()) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: list resources with unknown resource type %s", request.GetResourceTypeId()) } token := pagination.Token{ @@ -138,15 +135,14 @@ func (b *builder) ListResources(ctx context.Context, request *v2.ResourcesServic Annotations: retOptions.Annotations, }.Build() if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return resp, fmt.Errorf("error: listing resources failed: %w", err) } if request.GetPageToken() != "" && request.GetPageToken() == retOptions.NextPageToken { - err := status.Errorf(codes.Internal, - "listing resources failed: next page token unchanged (token=%s, type=%s, parent=%s) - likely a connector bug", + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + errMsg := fmt.Sprintf(" with page token %s resource type id %s and resource parent id: %s this is most likely a connector bug", request.GetPageToken(), request.GetResourceTypeId(), request.GetParentResourceId()) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return resp, err + return resp, fmt.Errorf("error: listing resources failed: next page token is the same as the current page token %s", errMsg) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -162,19 +158,17 @@ func (b *builder) GetResource(ctx context.Context, request *v2.ResourceGetterSer resourceType := request.GetResourceId().GetResourceType() rb, ok := b.resourceTargetedSyncers[resourceType] if !ok { - err := status.Errorf(codes.Unimplemented, "error: get resource with unknown resource type %s", resourceType) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Errorf(codes.Unimplemented, "error: get resource with unknown resource type %s", resourceType) } resource, annos, err := rb.Get(ctx, request.GetResourceId(), request.GetParentResourceId()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: get resource failed: %w", err) } if resource == nil { - err := status.Error(codes.NotFound, "error: get resource returned nil") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.NotFound, "error: get resource returned nil") } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -194,9 +188,8 @@ func (b *builder) ListStaticEntitlements(ctx context.Context, request *v2.Entitl tt := tasks.ListStaticEntitlementsType rb, ok := b.resourceSyncers[request.GetResourceTypeId()] if !ok { - err := fmt.Errorf("error: list static entitlements with unknown resource type %s", request.GetResourceTypeId()) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: list static entitlements with unknown resource type %s", request.GetResourceTypeId()) } rbse, ok := rb.(StaticEntitlementSyncerV2) if !ok { @@ -224,13 +217,12 @@ func (b *builder) ListStaticEntitlements(ctx context.Context, request *v2.Entitl Annotations: retOptions.Annotations, }.Build() if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: listing static entitlements failed: %w", err) } if request.GetPageToken() != "" && request.GetPageToken() == retOptions.NextPageToken { - err := status.Error(codes.Internal, "listing static entitlements failed: next page token unchanged - likely a connector bug") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return resp, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return resp, fmt.Errorf("error: listing static entitlements failed: next page token is the same as the current page token. this is most likely a connector bug") } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -246,9 +238,8 @@ func (b *builder) ListEntitlements(ctx context.Context, request *v2.Entitlements tt := tasks.ListEntitlementsType rb, ok := b.resourceSyncers[request.GetResource().GetId().GetResourceType()] if !ok { - err := fmt.Errorf("error: list entitlements with unknown resource type %s", request.GetResource().GetId().GetResourceType()) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: list entitlements with unknown resource type %s", request.GetResource().GetId().GetResourceType()) } token := pagination.Token{ Size: int(request.GetPageSize()), @@ -266,13 +257,12 @@ func (b *builder) ListEntitlements(ctx context.Context, request *v2.Entitlements Annotations: retOptions.Annotations, }.Build() if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return resp, fmt.Errorf("error: listing entitlements failed: %w", err) } if request.GetPageToken() != "" && request.GetPageToken() == retOptions.NextPageToken { - err := status.Error(codes.Internal, "listing entitlements failed: next page token unchanged - likely a connector bug") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return resp, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return resp, fmt.Errorf("error: listing entitlements failed: next page token is the same as the current page token. this is most likely a connector bug") } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -289,9 +279,8 @@ func (b *builder) ListGrants(ctx context.Context, request *v2.GrantsServiceListG rid := request.GetResource().GetId() rb, ok := b.resourceSyncers[rid.GetResourceType()] if !ok { - err := fmt.Errorf("error: list grants with unknown resource type %s", rid.GetResourceType()) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: list grants with unknown resource type %s", rid.GetResourceType()) } token := pagination.Token{ @@ -311,15 +300,14 @@ func (b *builder) ListGrants(ctx context.Context, request *v2.GrantsServiceListG }.Build() if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return resp, fmt.Errorf("error: listing grants for resource %s/%s failed: %w", rid.GetResourceType(), rid.GetResource(), err) } if request.GetPageToken() != "" && request.GetPageToken() == retOptions.NextPageToken { - err := status.Errorf(codes.Internal, - "listing grants for resource %s/%s failed: next page token unchanged - likely a connector bug", - rid.GetResourceType(), rid.GetResource()) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return resp, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return resp, fmt.Errorf("error: listing grants for resource %s/%s failed: next page token is the same as the current page token. this is most likely a connector bug", + rid.GetResourceType(), + rid.GetResource()) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/tickets.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/tickets.go index e1ea8bf5..740cc3c5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/tickets.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/tickets.go @@ -10,8 +10,6 @@ import ( "github.com/conductorone/baton-sdk/pkg/pagination" "github.com/conductorone/baton-sdk/pkg/retry" "github.com/conductorone/baton-sdk/pkg/types/tasks" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) // TicketManager extends ConnectorBuilder to add capabilities for ticket management. @@ -39,21 +37,19 @@ func (b *builder) BulkCreateTickets(ctx context.Context, request *v2.TicketsServ start := b.nowFunc() tt := tasks.BulkCreateTicketsType if b.ticketManager == nil { - err := status.Error(codes.Unimplemented, "ticket manager not implemented") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: ticket manager not implemented") } reqBody := request.GetTicketRequests() if len(reqBody) == 0 { - err := status.Error(codes.InvalidArgument, "request body had no items") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: request body had no items") } ticketsResponse, err := b.ticketManager.BulkCreateTickets(ctx, request) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: creating tickets failed: %w", err) } @@ -70,21 +66,19 @@ func (b *builder) BulkGetTickets(ctx context.Context, request *v2.TicketsService start := b.nowFunc() tt := tasks.BulkGetTicketsType if b.ticketManager == nil { - err := status.Error(codes.Unimplemented, "ticket manager not implemented") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: ticket manager not implemented") } reqBody := request.GetTicketRequests() if len(reqBody) == 0 { - err := status.Error(codes.InvalidArgument, "request body had no items") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: request body had no items") } ticketsResponse, err := b.ticketManager.BulkGetTickets(ctx, request) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: fetching tickets failed: %w", err) } @@ -101,9 +95,8 @@ func (b *builder) ListTicketSchemas(ctx context.Context, request *v2.TicketsServ start := b.nowFunc() tt := tasks.ListTicketSchemasType if b.ticketManager == nil { - err := status.Error(codes.Unimplemented, "ticket manager not implemented") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: ticket manager not implemented") } retryer := retry.NewRetryer(ctx, retry.RetryConfig{ @@ -119,9 +112,8 @@ func (b *builder) ListTicketSchemas(ctx context.Context, request *v2.TicketsServ }) if err == nil { if request.GetPageToken() != "" && request.GetPageToken() == nextPageToken { - err := status.Error(codes.Internal, "listing ticket schemas failed: next page token unchanged - likely a connector bug") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: listing ticket schemas failed: next page token is the same as the current page token. this is most likely a connector bug") } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -134,7 +126,7 @@ func (b *builder) ListTicketSchemas(ctx context.Context, request *v2.TicketsServ if retryer.ShouldWaitAndRetry(ctx, err) { continue } - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: listing ticket schemas failed: %w", err) } } @@ -146,16 +138,14 @@ func (b *builder) CreateTicket(ctx context.Context, request *v2.TicketsServiceCr start := b.nowFunc() tt := tasks.CreateTicketType if b.ticketManager == nil { - err := status.Error(codes.Unimplemented, "ticket manager not implemented") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: ticket manager not implemented") } reqBody := request.GetRequest() if reqBody == nil { - err := status.Error(codes.InvalidArgument, "request body is nil") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: request body is nil") } cTicket := v2.Ticket_builder{ DisplayName: reqBody.GetDisplayName(), @@ -169,7 +159,7 @@ func (b *builder) CreateTicket(ctx context.Context, request *v2.TicketsServiceCr ticket, annos, err := b.ticketManager.CreateTicket(ctx, cTicket, request.GetSchema()) var resp *v2.TicketsServiceCreateTicketResponse if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) if ticket != nil { resp = v2.TicketsServiceCreateTicketResponse_builder{ Ticket: ticket, @@ -193,15 +183,14 @@ func (b *builder) GetTicket(ctx context.Context, request *v2.TicketsServiceGetTi start := b.nowFunc() tt := tasks.GetTicketType if b.ticketManager == nil { - err := status.Error(codes.Unimplemented, "ticket manager not implemented") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: ticket manager not implemented") } var resp *v2.TicketsServiceGetTicketResponse ticket, annos, err := b.ticketManager.GetTicket(ctx, request.GetId()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) if ticket != nil { resp = v2.TicketsServiceGetTicketResponse_builder{ Ticket: ticket, @@ -225,14 +214,13 @@ func (b *builder) GetTicketSchema(ctx context.Context, request *v2.TicketsServic start := b.nowFunc() tt := tasks.GetTicketSchemaType if b.ticketManager == nil { - err := status.Error(codes.Unimplemented, "ticket manager not implemented") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) - return nil, err + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, fmt.Errorf("error: ticket manager not implemented") } ticketSchema, annos, err := b.ticketManager.GetTicketSchema(ctx, request.GetId()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, fmt.Errorf("error: getting ticket metadata failed: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go index 4c724a2c..7974ef45 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go @@ -8,12 +8,9 @@ import ( "os/signal" "path/filepath" "strings" - "sync" "time" "github.com/conductorone/baton-sdk/pkg/bid" - "github.com/conductorone/baton-sdk/pkg/connectorbuilder" - "github.com/conductorone/baton-sdk/pkg/healthcheck" "github.com/conductorone/baton-sdk/pkg/synccompactor" "golang.org/x/sync/semaphore" "google.golang.org/protobuf/types/known/structpb" @@ -40,103 +37,55 @@ const ( ) type connectorRunner struct { - cw types.ClientWrapper - oneShot bool - tasks tasks.Manager - debugFile *os.File - debugFileMutex sync.Mutex - healthServer *healthcheck.Server + cw types.ClientWrapper + oneShot bool + tasks tasks.Manager + debugFile *os.File } var ErrSigTerm = errors.New("context cancelled by process shutdown") -// setupPersistentLog ensures that a log file on disk is created, -// when required by either the stored Manager or by a Task. -// A log file created by a stored Manager persists for our entire run, -// while a log file created for a Task only lasts for that Task. -// (There is currently no good way for a Manager to require this.) -// -// This function always returns a valid context, even if -// a persistent log file could not be created. -func (c *connectorRunner) setupPersistentLog(ctx context.Context, requiredByTask bool) (context.Context, error) { - var err error - - // We lock around manipulation of the debug file field for safety, - // but make no attempt to serialize logging of concurrent tasks. - c.debugFileMutex.Lock() - defer c.debugFileMutex.Unlock() - +// Run starts a connector and creates a new C1Z file. +func (c *connectorRunner) Run(ctx context.Context) error { l := ctxzap.Extract(ctx) + ctx, cancel := context.WithCancelCause(ctx) + defer cancel(ErrSigTerm) - requiredByManager := c.tasks.ShouldDebug() - if !requiredByTask && !requiredByManager { - // If we're not being required to create a persistent log by a task - // and our runner doesn't want one, we have nothing to do. - return ctx, nil - } else if c.debugFile != nil && requiredByManager { - // If a log file already exists from our runner, - // we also have nothing to do. - return ctx, nil - } + if c.tasks.ShouldDebug() && c.debugFile == nil { + var err error + tempDir := c.tasks.GetTempDir() + if tempDir == "" { + wd, err := os.Getwd() + if err != nil { + l.Warn("unable to get the current working directory", zap.Error(err)) + } - if c.debugFile != nil { - // A log file already exists from a previous task, and it is time to rotate it. - // The file is likely already closed, but we attempt to Close() it to be sure - // and rotate it by calling Create() on it below - this is equivalent to open(O_TRUNC). - l.Info("Rotating existing log file") - err = c.debugFile.Close() - if err != nil { - l.Warn("cannot close existing log file, continuing to rotate log...", zap.Error(err)) + if wd != "" { + l.Warn("no temporal folder found on this system according to our task manager,"+ + " we may create files in the current working directory by mistake as a result", + zap.String("current working directory", wd)) + } else { + l.Warn("no temporal folder found on this system according to our task manager") + } } - - c.debugFile = nil - } - - // Create/truncate the log file, and open it. - tempDir := c.tasks.GetTempDir() - if tempDir == "" { - wd, err := os.Getwd() + debugFile := filepath.Join(tempDir, "debug.log") + c.debugFile, err = os.Create(debugFile) if err != nil { - l.Warn("unable to get the current working directory", zap.Error(err)) - } - - if wd != "" { - l.Warn("no temporal folder found on this system according to our task manager,"+ - " we may create files in the current working directory by mistake as a result", - zap.String("current working directory", wd)) - } else { - l.Warn("no temporal folder found on this system according to our task manager") + l.Warn("cannot create file", zap.String("full file path", debugFile), zap.Error(err)) } } - debugFile := filepath.Join(tempDir, "debug.log") - c.debugFile, err = os.Create(debugFile) - if err != nil { - l.Warn("cannot create debug log file", zap.String("file_path", debugFile), zap.Error(err)) - return ctx, err - } - - // Modify the context to insert a logger directed to that file. - writeSyncer := zapcore.AddSync(c.debugFile) - encoder := zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig()) - core := zapcore.NewCore(encoder, writeSyncer, zapcore.DebugLevel) - - l = l.WithOptions(zap.WrapCore(func(c zapcore.Core) zapcore.Core { - return zapcore.NewTee(c, core) - })) - return ctxzap.ToContext(ctx, l), nil -} + // modify the context to insert a logger directed to a file + if c.debugFile != nil { + writeSyncer := zapcore.AddSync(c.debugFile) + encoder := zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig()) + core := zapcore.NewCore(encoder, writeSyncer, zapcore.DebugLevel) -// Run starts a connector and creates a new C1Z file. -func (c *connectorRunner) Run(ctx context.Context) error { - ctx, cancel := context.WithCancelCause(ctx) - defer cancel(ErrSigTerm) + l = l.WithOptions(zap.WrapCore(func(c zapcore.Core) zapcore.Core { + return zapcore.NewTee(c, core) + })) - var err error - ctx, err = c.setupPersistentLog(ctx, false) - if err != nil { - l := ctxzap.Extract(ctx) - l.Warn("Persistent logging could not be set up.", zap.Error(err)) + ctx = ctxzap.ToContext(ctx, l) } sigChan := make(chan os.Signal, 1) @@ -147,7 +96,7 @@ func (c *connectorRunner) Run(ctx context.Context) error { } }() - err = c.run(ctx) + err := c.run(ctx) if err != nil { return err } @@ -178,16 +127,6 @@ func (c *connectorRunner) processTask(ctx context.Context, task *v1.Task) error return fmt.Errorf("runner: error creating connector client: %w", err) } - // While we may not have already set up a persistent log file, - // if the task requires one, we set it up here. - if task.GetDebug() { - ctx, err = c.setupPersistentLog(ctx, true) - if err != nil { - l := ctxzap.Extract(ctx) - l.Warn("Persistent logging for this Task could not be set up.", zap.Error(err)) - } - } - err = c.tasks.Process(ctx, task, cc) if err != nil { return fmt.Errorf("runner: error processing task: %w", err) @@ -300,14 +239,6 @@ func (c *connectorRunner) run(ctx context.Context) error { func (c *connectorRunner) Close(ctx context.Context) error { var retErr error - // Stop health check server if running - if c.healthServer != nil { - if err := c.healthServer.Stop(ctx); err != nil { - retErr = errors.Join(retErr, err) - } - c.healthServer = nil - } - if err := c.cw.Close(); err != nil { retErr = errors.Join(retErr, err) } @@ -349,10 +280,9 @@ type revokeConfig struct { } type createAccountConfig struct { - login string - email string - profile *structpb.Struct - resourceTypeID string // Optional: if set, creates an account for the specified resource type. + login string + email string + profile *structpb.Struct } type invokeActionConfig struct { @@ -393,44 +323,39 @@ type syncCompactorConfig struct { } type runnerConfig struct { - rlCfg *ratelimitV1.RateLimiterConfig - rlDescriptors []*ratelimitV1.RateLimitDescriptors_Entry - onDemand bool - c1zPath string - clientAuth bool - clientID string - clientSecret string - provisioningEnabled bool - ticketingEnabled bool - actionsEnabled bool - grantConfig *grantConfig - revokeConfig *revokeConfig - eventFeedConfig *eventStreamConfig - tempDir string - createAccountConfig *createAccountConfig - invokeActionConfig *invokeActionConfig - listActionSchemasConfig *listActionSchemasConfig - deleteResourceConfig *deleteResourceConfig - rotateCredentialsConfig *rotateCredentialsConfig - createTicketConfig *createTicketConfig - bulkCreateTicketConfig *bulkCreateTicketConfig - listTicketSchemasConfig *listTicketSchemasConfig - getTicketConfig *getTicketConfig - syncDifferConfig *syncDifferConfig - syncCompactorConfig *syncCompactorConfig - skipFullSync bool - targetedSyncResourceIDs []string - externalResourceC1Z string - externalResourceEntitlementIdFilter string - skipEntitlementsAndGrants bool - skipGrants bool - sessionStoreEnabled bool - syncResourceTypeIDs []string - defaultCapabilitiesConnectorBuilder connectorbuilder.ConnectorBuilder - defaultCapabilitiesConnectorBuilderV2 connectorbuilder.ConnectorBuilderV2 - healthCheckEnabled bool - healthCheckPort int - healthCheckBindAddress string + rlCfg *ratelimitV1.RateLimiterConfig + rlDescriptors []*ratelimitV1.RateLimitDescriptors_Entry + onDemand bool + c1zPath string + clientAuth bool + clientID string + clientSecret string + provisioningEnabled bool + ticketingEnabled bool + actionsEnabled bool + grantConfig *grantConfig + revokeConfig *revokeConfig + eventFeedConfig *eventStreamConfig + tempDir string + createAccountConfig *createAccountConfig + invokeActionConfig *invokeActionConfig + listActionSchemasConfig *listActionSchemasConfig + deleteResourceConfig *deleteResourceConfig + rotateCredentialsConfig *rotateCredentialsConfig + createTicketConfig *createTicketConfig + bulkCreateTicketConfig *bulkCreateTicketConfig + listTicketSchemasConfig *listTicketSchemasConfig + getTicketConfig *getTicketConfig + syncDifferConfig *syncDifferConfig + syncCompactorConfig *syncCompactorConfig + skipFullSync bool + targetedSyncResourceIDs []string + externalResourceC1Z string + externalResourceEntitlementIdFilter string + skipEntitlementsAndGrants bool + skipGrants bool + sessionStoreEnabled bool + syncResourceTypeIDs []string } func WithSessionStoreEnabled() Option { @@ -545,15 +470,14 @@ func WithOnDemandRevoke(c1zPath string, grantID string) Option { } } -func WithOnDemandCreateAccount(c1zPath string, login string, email string, profile *structpb.Struct, resourceTypeId string) Option { +func WithOnDemandCreateAccount(c1zPath string, login string, email string, profile *structpb.Struct) Option { return func(ctx context.Context, cfg *runnerConfig) error { cfg.onDemand = true cfg.c1zPath = c1zPath cfg.createAccountConfig = &createAccountConfig{ - login: login, - email: email, - profile: profile, - resourceTypeID: resourceTypeId, + login: login, + email: email, + profile: profile, } return nil } @@ -775,55 +699,6 @@ func WithSkipGrants(skip bool) Option { } } -// WithDefaultCapabilitiesConnectorBuilder sets the default connector builder for the runner -// This is used by the "capabilities" sub-command to instantiate the connector. -func WithDefaultCapabilitiesConnectorBuilder(t connectorbuilder.ConnectorBuilder) Option { - return func(ctx context.Context, cfg *runnerConfig) error { - cfg.defaultCapabilitiesConnectorBuilder = t - return nil - } -} - -// WithDefaultCapabilitiesConnectorBuilderV2 sets the default connector builder for the runner -// This is used by the "capabilities" sub-command to instantiate the connector. -func WithDefaultCapabilitiesConnectorBuilderV2(t connectorbuilder.ConnectorBuilderV2) Option { - return func(ctx context.Context, cfg *runnerConfig) error { - cfg.defaultCapabilitiesConnectorBuilderV2 = t - return nil - } -} - -// WithHealthCheck enables the HTTP health check server. -func WithHealthCheck(enabled bool, port int, bindAddress string) Option { - return func(ctx context.Context, cfg *runnerConfig) error { - cfg.healthCheckEnabled = enabled - cfg.healthCheckPort = port - cfg.healthCheckBindAddress = bindAddress - return nil - } -} - -func ExtractDefaultConnector(ctx context.Context, options ...Option) (any, error) { - cfg := &runnerConfig{} - - for _, o := range options { - err := o(ctx, cfg) - if err != nil { - return nil, err - } - } - - if cfg.defaultCapabilitiesConnectorBuilder != nil { - return cfg.defaultCapabilitiesConnectorBuilder, nil - } - - if cfg.defaultCapabilitiesConnectorBuilderV2 != nil { - return cfg.defaultCapabilitiesConnectorBuilderV2, nil - } - - return nil, nil -} - func IsSessionStoreEnabled(ctx context.Context, options ...Option) (bool, error) { cfg := &runnerConfig{} @@ -922,7 +797,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op tm = local.NewRevoker(ctx, cfg.c1zPath, cfg.revokeConfig.grantID) case cfg.createAccountConfig != nil: - tm = local.NewCreateAccountManager(ctx, cfg.c1zPath, cfg.createAccountConfig.login, cfg.createAccountConfig.email, cfg.createAccountConfig.profile, cfg.createAccountConfig.resourceTypeID) + tm = local.NewCreateAccountManager(ctx, cfg.c1zPath, cfg.createAccountConfig.login, cfg.createAccountConfig.email, cfg.createAccountConfig.profile) case cfg.invokeActionConfig != nil: tm = local.NewActionInvoker(ctx, cfg.c1zPath, cfg.invokeActionConfig.action, cfg.invokeActionConfig.resourceTypeID, cfg.invokeActionConfig.args) @@ -997,20 +872,5 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op } runner.tasks = tm - // Start health check server if enabled (only for daemon mode) - if cfg.healthCheckEnabled { - healthCfg := healthcheck.Config{ - Enabled: true, - Port: cfg.healthCheckPort, - BindAddress: cfg.healthCheckBindAddress, - } - healthServer := healthcheck.NewServer(healthCfg, cw.C) - if err := healthServer.Start(ctx); err != nil { - _ = cw.Close() // Clean up connector wrapper on failure - return nil, fmt.Errorf("failed to start health check server: %w", err) - } - runner.healthServer = healthServer - } - return runner, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go index 19876916..5de57194 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go @@ -11,8 +11,6 @@ import ( "time" "github.com/doug-martin/goqu/v9" - "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" - "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -47,22 +45,17 @@ type C1File struct { pragmas []pragma readOnly bool encoderConcurrency int - closed bool - closedMu sync.Mutex // Cached sync run for listConnectorObjects (avoids N+1 queries) - cachedViewSyncRun *syncRun - cachedViewSyncMu sync.Mutex - cachedViewSyncErr error + cachedViewSyncRun *syncRun + cachedViewSyncOnce sync.Once + cachedViewSyncErr error // Slow query tracking slowQueryLogTimes map[string]time.Time slowQueryLogTimesMu sync.Mutex slowQueryThreshold time.Duration slowQueryLogFrequency time.Duration - - // Sync cleanup settings - syncLimit int } var _ connectorstore.Writer = (*C1File)(nil) @@ -96,14 +89,6 @@ func WithC1FEncoderConcurrency(concurrency int) C1FOption { } } -// WithC1FSyncCountLimit sets the number of syncs to keep during cleanup. -// If not set, defaults to 2 (or BATON_KEEP_SYNC_COUNT env var if set). -func WithC1FSyncCountLimit(limit int) C1FOption { - return func(o *C1File) { - o.syncLimit = limit - } -} - // Returns a C1File instance for the given db filepath. func NewC1File(ctx context.Context, dbFilePath string, opts ...C1FOption) (*C1File, error) { ctx, span := tracer.Start(ctx, "NewC1File") @@ -150,9 +135,7 @@ type c1zOptions struct { decoderOptions []DecoderOption readOnly bool encoderConcurrency int - syncLimit int } - type C1ZOption func(*c1zOptions) // WithTmpDir sets the temporary directory to extract the c1z file to. @@ -192,14 +175,6 @@ func WithEncoderConcurrency(concurrency int) C1ZOption { } } -// WithSyncLimit sets the number of syncs to keep during cleanup. -// If not set, defaults to 2 (or BATON_KEEP_SYNC_COUNT env var if set). -func WithSyncLimit(limit int) C1ZOption { - return func(o *c1zOptions) { - o.syncLimit = limit - } -} - // Returns a new C1File instance with its state stored at the provided filename. func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) (*C1File, error) { ctx, span := tracer.Start(ctx, "NewC1ZFile") @@ -212,7 +187,7 @@ func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) ( opt(options) } - dbFilePath, _, err := decompressC1z(outputFilePath, options.tmpDir, options.decoderOptions...) + dbFilePath, err := loadC1z(outputFilePath, options.tmpDir, options.decoderOptions...) if err != nil { return nil, err } @@ -228,9 +203,6 @@ func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) ( return nil, fmt.Errorf("encoder concurrency must be greater than 0") } c1fopts = append(c1fopts, WithC1FEncoderConcurrency(options.encoderConcurrency)) - if options.syncLimit > 0 { - c1fopts = append(c1fopts, WithC1FSyncCountLimit(options.syncLimit)) - } c1File, err := NewC1File(ctx, dbFilePath, c1fopts...) if err != nil { @@ -253,45 +225,11 @@ func cleanupDbDir(dbFilePath string, err error) error { var ErrReadOnly = errors.New("c1z: read only mode") // Close ensures that the sqlite database is flushed to disk, and if any changes were made we update the original database -// with our changes. The provided context is used for the WAL checkpoint operation. -func (c *C1File) Close(ctx context.Context) error { +// with our changes. +func (c *C1File) Close() error { var err error - c.closedMu.Lock() - defer c.closedMu.Unlock() - if c.closed { - l := ctxzap.Extract(ctx) - l.Warn("close called on already-closed c1file", zap.String("db_path", c.dbFilePath)) - return nil - } - if c.rawDb != nil { - // CRITICAL: Force a full WAL checkpoint before closing the database. - // This ensures all WAL data is written back to the main database file - // and the writes are synced to disk. Without this, on filesystems with - // aggressive caching (like ZFS with large ARC), the subsequent saveC1z() - // read could see stale data because the checkpoint writes may still be - // in kernel buffers. - // - // TRUNCATE mode: checkpoint as many frames as possible, then truncate - // the WAL file to zero bytes. This guarantees all data is in the main - // database file before we read it for compression. - if c.dbUpdated && !c.readOnly { - _, err = c.rawDb.ExecContext(ctx, "PRAGMA wal_checkpoint(TRUNCATE)") - if err != nil { - l := ctxzap.Extract(ctx) - // Checkpoint failed - log and continue. The subsequent Close() - // will attempt a passive checkpoint. If that also fails, we'll - // get an error from Close() or saveC1z() will read stale data. - // We log here for debugging but don't fail because: - // 1. Close() will still attempt its own checkpoint - // 2. The error might be transient (busy) - l.Warn("WAL checkpoint failed before close", - zap.Error(err), - zap.String("db_path", c.dbFilePath)) - } - } - err = c.rawDb.Close() if err != nil { return cleanupDbDir(c.dbFilePath, err) @@ -311,13 +249,7 @@ func (c *C1File) Close(ctx context.Context) error { } } - err = cleanupDbDir(c.dbFilePath, err) - if err != nil { - return err - } - c.closed = true - - return nil + return cleanupDbDir(c.dbFilePath, err) } // init ensures that the database has all of the required schema. @@ -335,19 +267,6 @@ func (c *C1File) init(ctx context.Context) error { return err } - if c.readOnly { - // Disable journaling in read only mode, since we're not writing to the database. - _, err = c.db.ExecContext(ctx, "PRAGMA journal_mode = OFF") - if err != nil { - return err - } - // Disable synchronous writes in read only mode, since we're not writing to the database. - _, err = c.db.ExecContext(ctx, "PRAGMA synchronous = OFF") - if err != nil { - return err - } - } - for _, pragma := range c.pragmas { _, err := c.db.ExecContext(ctx, fmt.Sprintf("PRAGMA %s = %s", pragma.name, pragma.value)) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go index c091d747..69096da3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go @@ -63,6 +63,29 @@ func (r *grantsTable) Migrations(ctx context.Context, db *goqu.Database) error { return nil } +// DropGrantIndexes drops the indexes on the grants table. +// This should only be called when compacting the grants table. +// These indexes are re-created when we open the database again. +func (c *C1File) DropGrantIndexes(ctx context.Context) error { + ctx, span := tracer.Start(ctx, "C1File.DropGrantsIndexes") + defer span.End() + + indexes := []string{ + fmt.Sprintf("idx_grants_resource_type_id_resource_id_v%s", grants.Version()), + fmt.Sprintf("idx_grants_principal_id_v%s", grants.Version()), + fmt.Sprintf("idx_grants_entitlement_id_principal_id_v%s", grants.Version()), + fmt.Sprintf("idx_grants_external_sync_v%s", grants.Version()), + } + + for _, index := range indexes { + _, err := c.db.ExecContext(ctx, fmt.Sprintf("DROP INDEX IF EXISTS %s", index)) + if err != nil { + return err + } + } + return nil +} + func (c *C1File) ListGrants(ctx context.Context, request *v2.GrantsServiceListGrantsRequest) (*v2.GrantsServiceListGrantsResponse, error) { ctx, span := tracer.Start(ctx, "C1File.ListGrants") defer span.End() diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/session_store.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/session_store.go index c20be9d6..796c0648 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/session_store.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/session_store.go @@ -216,8 +216,7 @@ func (c *C1File) Clear(ctx context.Context, opt ...sessions.SessionStoreOption) q = q.Where(goqu.C("sync_id").Eq(bag.SyncID)) if bag.Prefix != "" { - pattern := escapeLike(bag.Prefix) + "%" - q = q.Where(goqu.L("key LIKE ? ESCAPE '\\'", pattern)) + q = q.Where(goqu.C("key").Like(escapeLike(bag.Prefix) + "%")) } sql, params, err := q.ToSQL() @@ -367,8 +366,7 @@ func (c *C1File) getAllChunk(ctx context.Context, pageToken string, sizeLimit in Limit(100) if bag.Prefix != "" { - pattern := escapeLike(bag.Prefix) + "%" - q = q.Where(goqu.L("key LIKE ? ESCAPE '\\'", pattern)) + q = q.Where(goqu.C("key").Like(escapeLike(bag.Prefix) + "%")) } if pageToken != "" { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go index 8528537b..9c3efa34 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go @@ -83,11 +83,6 @@ type hasPrincipalResourceTypeIDsListRequest interface { GetPrincipalResourceTypeIds() []string } -type hasParentResourceIdListRequest interface { - listRequest - GetParentResourceId() *v2.ResourceId -} - type protoHasID interface { proto.Message GetId() string @@ -194,14 +189,6 @@ func listConnectorObjects[T proto.Message](ctx context.Context, c *C1File, table } } - if parentResourceIdReq, ok := req.(hasParentResourceIdListRequest); ok { - p := parentResourceIdReq.GetParentResourceId() - if p != nil && p.GetResource() != "" { - q = q.Where(goqu.C("parent_resource_id").Eq(p.GetResource())) - q = q.Where(goqu.C("parent_resource_type_id").Eq(p.GetResourceType())) - } - } - // If a sync is running, be sure we only select from the current values switch { case reqSyncID != "": @@ -292,8 +279,7 @@ func listConnectorObjects[T proto.Message](ctx context.Context, c *C1File, table return ret, nextPageToken, nil } -// This is required for sync diffs to work. Its not much slower. -var protoMarshaler = proto.MarshalOptions{Deterministic: true} +var protoMarshaler = proto.MarshalOptions{Deterministic: false} // prepareSingleConnectorObjectRow processes a single message and returns the prepared record. func prepareSingleConnectorObjectRow[T proto.Message]( @@ -358,8 +344,8 @@ func prepareConnectorObjectRowsParallel[T proto.Message]( protoMarshallers := make([]proto.MarshalOptions, numWorkers) for i := range numWorkers { - // Deterministic marshaling is required for sync diffs to work. Its not much slower. - protoMarshallers[i] = proto.MarshalOptions{Deterministic: true} + // Don't enable deterministic marshaling, as it sorts keys in lexicographical order which hurts performance. + protoMarshallers[i] = proto.MarshalOptions{} } rows := make([]*goqu.Record, len(msgs)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go index 4426a3e5..c8a7b11a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go @@ -32,8 +32,7 @@ create table if not exists %s ( ended_at datetime, sync_token text not null, sync_type text not null default 'full', - parent_sync_id text not null default '', - linked_sync_id text not null default '' + parent_sync_id text not null default '' ); create unique index if not exists %s on %s (sync_id);` @@ -84,19 +83,6 @@ func (r *syncRunsTable) Migrations(ctx context.Context, db *goqu.Database) error } } - // Check if linked_sync_id column exists - var linkedSyncIDExists int - err = db.QueryRowContext(ctx, fmt.Sprintf("select count(*) from pragma_table_info('%s') where name='linked_sync_id'", r.Name())).Scan(&linkedSyncIDExists) - if err != nil { - return err - } - if linkedSyncIDExists == 0 { - _, err = db.ExecContext(ctx, fmt.Sprintf("alter table %s add column linked_sync_id text not null default ''", r.Name())) - if err != nil { - return err - } - } - return nil } @@ -107,45 +93,31 @@ type syncRun struct { SyncToken string Type connectorstore.SyncType ParentSyncID string - LinkedSyncID string } // getCachedViewSyncRun returns the cached sync run for read operations. // This avoids N+1 queries when paginating through listConnectorObjects. -// The cache is invalidated when a sync starts or ends. +// The result is computed once and cached for the lifetime of the C1File. func (c *C1File) getCachedViewSyncRun(ctx context.Context) (*syncRun, error) { ctx, span := tracer.Start(ctx, "C1File.getCachedViewSyncRun") defer span.End() - c.cachedViewSyncMu.Lock() - defer c.cachedViewSyncMu.Unlock() - - if c.cachedViewSyncRun != nil || c.cachedViewSyncErr != nil { - return c.cachedViewSyncRun, c.cachedViewSyncErr - } - - // First try to get a finished full sync - c.cachedViewSyncRun, c.cachedViewSyncErr = c.getFinishedSync(ctx, 0, connectorstore.SyncTypeFull) - if c.cachedViewSyncErr != nil { - return c.cachedViewSyncRun, c.cachedViewSyncErr - } + c.cachedViewSyncOnce.Do(func() { + // First try to get a finished full sync + c.cachedViewSyncRun, c.cachedViewSyncErr = c.getFinishedSync(ctx, 0, connectorstore.SyncTypeFull) + if c.cachedViewSyncErr != nil { + return + } - // If no finished sync, try to get an unfinished one - if c.cachedViewSyncRun == nil { - c.cachedViewSyncRun, c.cachedViewSyncErr = c.getLatestUnfinishedSync(ctx, connectorstore.SyncTypeAny) - } + // If no finished sync, try to get an unfinished one + if c.cachedViewSyncRun == nil { + c.cachedViewSyncRun, c.cachedViewSyncErr = c.getLatestUnfinishedSync(ctx, connectorstore.SyncTypeAny) + } + }) return c.cachedViewSyncRun, c.cachedViewSyncErr } -// invalidateCachedViewSyncRun clears the cached sync run so it will be recomputed on next access. -func (c *C1File) invalidateCachedViewSyncRun() { - c.cachedViewSyncMu.Lock() - defer c.cachedViewSyncMu.Unlock() - c.cachedViewSyncRun = nil - c.cachedViewSyncErr = nil -} - func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connectorstore.SyncType) (*syncRun, error) { ctx, span := tracer.Start(ctx, "C1File.getLatestUnfinishedSync") defer span.End() @@ -159,7 +131,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connector oneWeekAgo := time.Now().AddDate(0, 0, -7) ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id") + q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") q = q.Where(goqu.C("ended_at").IsNull()) q = q.Where(goqu.C("started_at").Gte(oneWeekAgo)) q = q.Order(goqu.C("started_at").Desc()) @@ -175,7 +147,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connector row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -202,7 +174,7 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType conn ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id") + q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") q = q.Where(goqu.C("ended_at").IsNotNull()) if syncType != connectorstore.SyncTypeAny { q = q.Where(goqu.C("sync_type").Eq(syncType)) @@ -221,7 +193,7 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType conn row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -242,7 +214,7 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui } q := c.db.From(syncRuns.Name()).Prepared(true) - q = q.Select("id", "sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id") + q = q.Select("id", "sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") if pageToken != "" { q = q.Where(goqu.C("id").Gte(pageToken)) @@ -277,7 +249,7 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui } rowId := 0 data := &syncRun{} - err := rows.Scan(&rowId, &data.ID, &data.StartedAt, &data.EndedAt, &data.SyncToken, &data.Type, &data.ParentSyncID, &data.LinkedSyncID) + err := rows.Scan(&rowId, &data.ID, &data.StartedAt, &data.EndedAt, &data.SyncToken, &data.Type, &data.ParentSyncID) if err != nil { return nil, "", err } @@ -366,7 +338,7 @@ func (c *C1File) getSync(ctx context.Context, syncID string) (*syncRun, error) { ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id") + q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") q = q.Where(goqu.C("sync_id").Eq(syncID)) query, args, err := q.ToSQL() @@ -374,7 +346,7 @@ func (c *C1File) getSync(ctx context.Context, syncID string) (*syncRun, error) { return nil, err } row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) if err != nil { return nil, err } @@ -567,16 +539,11 @@ func (c *C1File) StartNewSync(ctx context.Context, syncType connectorstore.SyncT } c.currentSyncID = syncID - c.invalidateCachedViewSyncRun() return c.currentSyncID, nil } func (c *C1File) insertSyncRun(ctx context.Context, syncID string, syncType connectorstore.SyncType, parentSyncID string) error { - return c.insertSyncRunWithLink(ctx, syncID, syncType, parentSyncID, "") -} - -func (c *C1File) insertSyncRunWithLink(ctx context.Context, syncID string, syncType connectorstore.SyncType, parentSyncID string, linkedSyncID string) error { if c.readOnly { return ErrReadOnly } @@ -588,7 +555,6 @@ func (c *C1File) insertSyncRunWithLink(ctx context.Context, syncID string, syncT "sync_token": "", "sync_type": syncType, "parent_sync_id": parentSyncID, - "linked_sync_id": linkedSyncID, }) query, args, err := q.ToSQL() @@ -631,7 +597,6 @@ func (c *C1File) EndSync(ctx context.Context) error { } c.currentSyncID = "" - c.invalidateCachedViewSyncRun() return nil } @@ -679,9 +644,8 @@ func (c *C1File) Cleanup(ctx context.Context) error { return nil } - var fullSyncs []*syncRun + var ret []*syncRun var partials []*syncRun - var diffSyncs []*syncRun pageToken := "" for { @@ -694,13 +658,10 @@ func (c *C1File) Cleanup(ctx context.Context) error { if sr.EndedAt == nil { continue } - switch sr.Type { - case connectorstore.SyncTypePartial, connectorstore.SyncTypeResourcesOnly: + if sr.Type == connectorstore.SyncTypePartial || sr.Type == connectorstore.SyncTypeResourcesOnly { partials = append(partials, sr) - case connectorstore.SyncTypePartialUpserts, connectorstore.SyncTypePartialDeletions: - diffSyncs = append(diffSyncs, sr) - default: - fullSyncs = append(fullSyncs, sr) + } else { + ret = append(ret, sr) } } @@ -711,31 +672,27 @@ func (c *C1File) Cleanup(ctx context.Context) error { } syncLimit := 2 - if c.syncLimit > 0 { - syncLimit = c.syncLimit - } else if customSyncLimit, err := strconv.ParseInt(os.Getenv("BATON_KEEP_SYNC_COUNT"), 10, 64); err == nil && customSyncLimit > 0 { + if customSyncLimit, err := strconv.ParseInt(os.Getenv("BATON_KEEP_SYNC_COUNT"), 10, 64); err == nil && customSyncLimit > 0 { syncLimit = int(customSyncLimit) } - l.Debug("found syncs", - zap.Int("full_count", len(fullSyncs)), - zap.Int("partial_count", len(partials)), - zap.Int("diff_count", len(diffSyncs)), - zap.Int("sync_limit", syncLimit)) + l.Debug("found syncs", zap.Int("count", len(ret)), zap.Int("sync_limit", syncLimit)) + if len(ret) <= syncLimit { + return nil + } - // Clean up old full syncs beyond the limit - if len(fullSyncs) > syncLimit { - l.Info("Cleaning up old sync data...") - for i := 0; i < len(fullSyncs)-syncLimit; i++ { - err = c.DeleteSyncRun(ctx, fullSyncs[i].ID) - if err != nil { - return err - } - l.Info("Removed old sync data.", zap.String("sync_date", fullSyncs[i].EndedAt.Format(time.RFC3339)), zap.String("sync_id", fullSyncs[i].ID)) + l.Info("Cleaning up old sync data...") + for i := 0; i < len(ret)-syncLimit; i++ { + err = c.DeleteSyncRun(ctx, ret[i].ID) + if err != nil { + return err } + l.Info("Removed old sync data.", zap.String("sync_date", ret[i].EndedAt.Format(time.RFC3339)), zap.String("sync_id", ret[i].ID)) + } - // Delete partial syncs that ended before the earliest-kept full sync started - earliestKeptSync := fullSyncs[len(fullSyncs)-syncLimit] + // Delete non-full syncs that ended before the earliest-kept full sync started + if len(ret) > syncLimit { + earliestKeptSync := ret[len(ret)-syncLimit] l.Debug("Earliest kept sync", zap.String("sync_id", earliestKeptSync.ID), zap.Time("started_at", *earliestKeptSync.StartedAt)) for _, partial := range partials { @@ -752,56 +709,6 @@ func (c *C1File) Cleanup(ctx context.Context) error { } } - // Clean up old diff syncs - keep only the most recent diff sync (upserts or deletions) and its linked pair (if present) - if len(diffSyncs) > 2 { - // Build a map for quick lookup by ID - syncByID := make(map[string]*syncRun) - for _, ds := range diffSyncs { - syncByID[ds.ID] = ds - } - - // Determine which syncs to keep. diffSyncs are ordered by row id (ascending), - // so the last element is the most recently created diff sync. - keepIDs := make(map[string]bool) - latestDiff := diffSyncs[len(diffSyncs)-1] - keepIDs[latestDiff.ID] = true - l.Debug("keeping latest diff sync", - zap.String("sync_id", latestDiff.ID), - zap.String("sync_type", string(latestDiff.Type))) - - // Also keep its linked pair if it exists. - // NOTE: We intentionally do NOT require a bidirectional link; if the latest diff sync exists, - // it's better to keep it and best-effort keep its linked partner (if present). - if latestDiff.LinkedSyncID != "" { - if linkedSync := syncByID[latestDiff.LinkedSyncID]; linkedSync != nil { - keepIDs[linkedSync.ID] = true - l.Debug("keeping linked diff sync", - zap.String("sync_id", linkedSync.ID), - zap.String("sync_type", string(linkedSync.Type))) - if linkedSync.LinkedSyncID != latestDiff.ID { - l.Warn("diff sync link is not bidirectional", - zap.String("sync_id", latestDiff.ID), - zap.String("linked_sync_id", latestDiff.LinkedSyncID), - zap.String("linked_sync_linked_sync_id", linkedSync.LinkedSyncID)) - } - } - } - - // Delete all diff syncs except the ones we're keeping - for _, ds := range diffSyncs { - if keepIDs[ds.ID] { - continue - } - err = c.DeleteSyncRun(ctx, ds.ID) - if err != nil { - return err - } - l.Info("Removed old diff sync.", - zap.String("sync_type", string(ds.Type)), - zap.String("sync_id", ds.ID)) - } - } - l.Debug("vacuuming database") err = c.Vacuum(ctx) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go index 6136cc84..bc995d11 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go @@ -39,10 +39,6 @@ var DefaultRelationships = []SchemaFieldRelationship{ []SchemaField{skipGrants}, []SchemaField{targetedSyncResourceIDs}, ), - FieldsDependentOn( - []SchemaField{healthCheckPortField, healthCheckBindAddressField}, - []SchemaField{healthCheckField}, - ), } func EnsureDefaultRelationships(original []SchemaFieldRelationship) []SchemaFieldRelationship { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go index d08a0c8b..5805b9f0 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go @@ -49,12 +49,6 @@ var ( WithHidden(true), WithDescription("JSON-formatted object of map keys and values like '{ 'key': 'value' }'"), WithPersistent(true), WithExportTarget(ExportTargetNone)) - createAccountResourceTypeField = StringField("create-account-resource-type", - WithHidden(true), - WithDescription("The resource type ID of the account to create"), - WithPersistent(true), - WithExportTarget(ExportTargetNone), - ) deleteResourceField = StringField("delete-resource", WithHidden(true), WithDescription("The id of the resource to delete"), WithPersistent(true), WithExportTarget(ExportTargetNone)) deleteResourceTypeField = StringField("delete-resource-type", WithHidden(true), WithDescription("The type of the resource to delete"), WithPersistent(true), WithExportTarget(ExportTargetNone)) eventFeedField = StringField("event-feed", WithHidden(true), WithDescription("Read feed events to stdout"), WithPersistent(true), WithExportTarget(ExportTargetNone)) @@ -290,25 +284,6 @@ var ( WithExportTarget(ExportTargetOps), WithHidden(true), WithPersistent(true)) - - healthCheckField = BoolField("health-check", - WithDescription("Enable the HTTP health check endpoint"), - WithDefaultValue(false), - WithPersistent(true), - WithExportTarget(ExportTargetOps)) - - healthCheckPortField = IntField("health-check-port", - WithDescription("Port for the HTTP health check endpoint"), - WithDefaultValue(8081), - WithPersistent(true), - WithExportTarget(ExportTargetOps)) - - healthCheckBindAddressField = StringField("health-check-bind-address", - WithDescription("Bind address for health check server (127.0.0.1 for localhost-only)"), - WithDefaultValue("127.0.0.1"), - WithPersistent(true), - WithHidden(true), - WithExportTarget(ExportTargetOps)) ) func LambdaServerFields() []SchemaField { @@ -340,7 +315,6 @@ var DefaultFields = []SchemaField{ createAccountEmailField, createAccountLoginField, createAccountProfileField, - createAccountResourceTypeField, deleteResourceField, deleteResourceTypeField, eventFeedField, @@ -392,10 +366,6 @@ var DefaultFields = []SchemaField{ otelLoggingDisabled, authMethod, - - healthCheckField, - healthCheckPortField, - healthCheckBindAddressField, } func IsFieldAmongDefaultList(f SchemaField) bool { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go b/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go index e69463df..263f1bad 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go @@ -34,10 +34,9 @@ type Provisioner struct { revokeGrantID string - createAccountLogin string - createAccountEmail string - createAccountProfile *structpb.Struct - createAccountResourceType string + createAccountLogin string + createAccountEmail string + createAccountProfile *structpb.Struct deleteResourceID string deleteResourceType string @@ -119,7 +118,7 @@ func (p *Provisioner) Close(ctx context.Context) error { var err error if p.store != nil { - storeErr := p.store.Close(ctx) + storeErr := p.store.Close() if storeErr != nil { err = errors.Join(err, storeErr) } @@ -184,7 +183,7 @@ func (p *Provisioner) grant(ctx context.Context) error { DisplayName: principal.GetResource().GetDisplayName(), Annotations: principal.GetResource().GetAnnotations(), Description: principal.GetResource().GetDescription(), - ExternalId: principal.GetResource().GetExternalId(), //nolint:staticcheck // Deprecated. + ExternalId: principal.GetResource().GetExternalId(), // Omit parent resource ID so that behavior is the same as ConductorOne's provisioning mode ParentResourceId: nil, }.Build() @@ -247,7 +246,7 @@ func (p *Provisioner) revoke(ctx context.Context) error { DisplayName: principal.GetResource().GetDisplayName(), Annotations: principal.GetResource().GetAnnotations(), Description: principal.GetResource().GetDescription(), - ExternalId: principal.GetResource().GetExternalId(), //nolint:staticcheck // Deprecated. + ExternalId: principal.GetResource().GetExternalId(), // Omit parent resource ID so that behavior is the same as ConductorOne's provisioning mode ParentResourceId: nil, }.Build() @@ -286,7 +285,6 @@ func (p *Provisioner) createAccount(ctx context.Context) error { } _, err = p.connector.CreateAccount(ctx, v2.CreateAccountRequest_builder{ - ResourceTypeId: p.createAccountResourceType, AccountInfo: v2.AccountInfo_builder{ Emails: emails, Login: p.createAccountLogin, @@ -299,11 +297,7 @@ func (p *Provisioner) createAccount(ctx context.Context) error { return err } - l.Debug("account created", - zap.String("login", p.createAccountLogin), - zap.String("email", p.createAccountEmail), - zap.String("resource_type", p.createAccountResourceType), - ) + l.Debug("account created", zap.String("login", p.createAccountLogin), zap.String("email", p.createAccountEmail)) return nil } @@ -379,14 +373,13 @@ func NewResourceDeleter(c types.ConnectorClient, dbPath string, resourceId strin } } -func NewCreateAccountManager(c types.ConnectorClient, dbPath string, login string, email string, profile *structpb.Struct, resourceType string) *Provisioner { +func NewCreateAccountManager(c types.ConnectorClient, dbPath string, login string, email string, profile *structpb.Struct) *Provisioner { return &Provisioner{ - dbPath: dbPath, - connector: c, - createAccountLogin: login, - createAccountEmail: email, - createAccountProfile: profile, - createAccountResourceType: resourceType, + dbPath: dbPath, + connector: c, + createAccountLogin: login, + createAccountEmail: email, + createAccountProfile: profile, } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go index 3474d751..5f7db3e1 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go @@ -1,3 +1,3 @@ package sdk -const Version = "v0.7.13" +const Version = "v0.6.8" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go index 532cc8e4..110efa35 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -12,8 +12,6 @@ import ( "slices" "strconv" "strings" - native_sync "sync" - "sync/atomic" "time" "github.com/Masterminds/semver/v3" @@ -48,39 +46,6 @@ var tracer = otel.Tracer("baton-sdk/sync") var dontFixCycles, _ = strconv.ParseBool(os.Getenv("BATON_DONT_FIX_CYCLES")) var ErrSyncNotComplete = fmt.Errorf("sync exited without finishing") -var ErrTooManyWarnings = fmt.Errorf("too many warnings, exiting sync") -var ErrNoSyncIDFound = fmt.Errorf("no syncID found after starting or resuming sync") - -// IsSyncPreservable returns true if the error returned by Sync() means that the sync artifact is useful. -// This either means that there was no error, or that the error is recoverable (we can resume the sync and possibly succeed next time). -func IsSyncPreservable(err error) bool { - if err == nil { - return true - } - // ErrSyncNotComplete means we hit the run duration timeout. - // ErrTooManyWarnings means we hit too many warnings. - // Both are recoverable errors. - if errors.Is(err, ErrSyncNotComplete) || errors.Is(err, ErrTooManyWarnings) { - return true - } - statusErr, ok := status.FromError(err) - if !ok { - return false - } - switch statusErr.Code() { - case codes.OK, - codes.NotFound, - codes.PermissionDenied, - codes.ResourceExhausted, - codes.FailedPrecondition, - codes.Aborted, - codes.Unavailable, - codes.Unauthenticated: - return true - default: - return false - } -} type Syncer interface { Sync(context.Context) error @@ -255,8 +220,6 @@ type syncer struct { injectSyncIDAnnotation bool setSessionStore sessions.SetSessionStore syncResourceTypes []string - previousSyncMu native_sync.Mutex - previousSyncIDPtr atomic.Pointer[string] } const minCheckpointInterval = 10 * time.Second @@ -282,33 +245,6 @@ func (s *syncer) Checkpoint(ctx context.Context, force bool) error { return nil } -func (s *syncer) getPreviousFullSyncID(ctx context.Context) (string, error) { - if ptr := s.previousSyncIDPtr.Load(); ptr != nil { - return *ptr, nil - } - - s.previousSyncMu.Lock() - defer s.previousSyncMu.Unlock() - - if ptr := s.previousSyncIDPtr.Load(); ptr != nil { - return *ptr, nil - } - - psf, ok := s.store.(latestSyncFetcher) - if !ok { - empty := "" - s.previousSyncIDPtr.Store(&empty) - return "", nil - } - - previousSyncID, err := psf.LatestFinishedSync(ctx, connectorstore.SyncTypeFull) - if err == nil { - s.previousSyncIDPtr.Store(&previousSyncID) - } - - return previousSyncID, err -} - func (s *syncer) handleInitialActionForStep(ctx context.Context, a Action) { if s.transitionHandler != nil { s.transitionHandler(a) @@ -462,7 +398,7 @@ func (s *syncer) Sync(ctx context.Context) error { // Set the syncID on the wrapper after we have it if syncID == "" { - err = ErrNoSyncIDFound + err = errors.New("no syncID found after starting or resuming sync") l.Error("no syncID found after starting or resuming sync", zap.Error(err)) return err } @@ -537,7 +473,7 @@ func (s *syncer) Sync(ctx context.Context) error { if len(warnings) > 10 { completedActionsCount := s.state.GetCompletedActionsCount() if completedActionsCount > 0 && float64(len(warnings))/float64(completedActionsCount) > 0.1 { - return fmt.Errorf("%w: warnings: %v completed actions: %d", ErrTooManyWarnings, warnings, completedActionsCount) + return fmt.Errorf("too many warnings, exiting sync. warnings: %v completed actions: %d", warnings, completedActionsCount) } } select { @@ -907,12 +843,6 @@ func validateSyncResourceTypesFilter(resourceTypesFilter []string, validResource return nil } -func (s *syncer) hasChildResources(resource *v2.Resource) bool { - annos := annotations.Annotations(resource.GetAnnotations()) - - return annos.Contains((*v2.ChildResourceType)(nil)) -} - // getSubResources fetches the sub resource types from a resources' annotations. func (s *syncer) getSubResources(ctx context.Context, parent *v2.Resource) error { ctx, span := tracer.Start(ctx, "syncer.getSubResources") @@ -1134,40 +1064,26 @@ func (s *syncer) syncResources(ctx context.Context) error { bulkPutResoruces := []*v2.Resource{} for _, r := range resp.GetList() { - validatedResource := false - // Check if we've already synced this resource, skip it if we have _, err = s.store.GetResource(ctx, reader_v2.ResourcesReaderServiceGetResourceRequest_builder{ ResourceId: v2.ResourceId_builder{ResourceType: r.GetId().GetResourceType(), Resource: r.GetId().GetResource()}.Build(), }.Build()) if err == nil { - err = s.validateResourceTraits(ctx, r) - if err != nil { - return err - } - validatedResource = true - - // We must *ALSO* check if we have any child resources. - if !s.hasChildResources(r) { - // Since we only have the resource type IDs of child resources, - // we can't tell if we already have synced those child resources. - // Those children may also have their own child resources, - // so we are conservative here and just re-sync this resource. - continue - } + continue } - if err != nil && !errors.Is(err, sql.ErrNoRows) { + if !errors.Is(err, sql.ErrNoRows) { return err } - if !validatedResource { - err = s.validateResourceTraits(ctx, r) - if err != nil { - return err - } + err = s.validateResourceTraits(ctx, r) + if err != nil { + return err } + // Set the resource creation source + r.SetCreationSource(v2.Resource_CREATION_SOURCE_CONNECTOR_LIST_RESOURCES) + bulkPutResoruces = append(bulkPutResoruces, r) err = s.getSubResources(ctx, r) @@ -1944,9 +1860,14 @@ func (s *syncer) fetchResourceForPreviousSync(ctx context.Context, resourceID *v l := ctxzap.Extract(ctx) - previousSyncID, err := s.getPreviousFullSyncID(ctx) - if err != nil { - return "", nil, err + var previousSyncID string + var err error + + if psf, ok := s.store.(latestSyncFetcher); ok { + previousSyncID, err = psf.LatestFinishedSync(ctx, connectorstore.SyncTypeFull) + if err != nil { + return "", nil, err + } } if previousSyncID == "" { @@ -2011,7 +1932,6 @@ func (s *syncer) fetchEtaggedGrantsForResource( var ret []*v2.Grant // No previous etag, so an etag match is not possible - // TODO(kans): do the request again to get the grants, but this time don't use the etag match! if prevEtag == nil { return nil, false, errors.New("connector returned an etag match but there is no previous sync generation to use") } @@ -2518,11 +2438,6 @@ func (s *syncer) listExternalEntitlementsForResource(ctx context.Context, resour break } } - for _, ent := range ents { - annos := annotations.Annotations(ent.GetAnnotations()) - annos.Update(&v2.EntitlementImmutable{}) - ent.SetAnnotations(annos) - } return ents, nil } @@ -2540,12 +2455,6 @@ func (s *syncer) listExternalGrantsForEntitlement(ctx context.Context, ent *v2.E } grants := grantsForEntitlementResp.GetList() if len(grants) > 0 { - // Add immutable annotation to external resource grants. - for _, grant := range grants { - annos := annotations.Annotations(grant.GetAnnotations()) - annos.Update(&v2.GrantImmutable{}) - grant.SetAnnotations(annos) - } if !yield(grants, err) { return } @@ -2977,14 +2886,14 @@ func (s *syncer) Close(ctx context.Context) error { var err error if s.store != nil { - err = s.store.Close(ctx) + err = s.store.Close() if err != nil { return fmt.Errorf("error closing store: %w", err) } } if s.externalResourceReader != nil { - err = s.externalResourceReader.Close(ctx) + err = s.externalResourceReader.Close() if err != nil { return fmt.Errorf("error closing external resource reader: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go index 4542f26d..cb675996 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" "github.com/conductorone/baton-sdk/pkg/connectorstore" "github.com/conductorone/baton-sdk/pkg/dotc1z" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" @@ -14,74 +13,49 @@ import ( type Compactor struct { base *dotc1z.C1File applied *dotc1z.C1File + dest *dotc1z.C1File } -func NewAttachedCompactor(base *dotc1z.C1File, applied *dotc1z.C1File) *Compactor { +func NewAttachedCompactor(base *dotc1z.C1File, applied *dotc1z.C1File, dest *dotc1z.C1File) *Compactor { return &Compactor{ base: base, applied: applied, + dest: dest, } } -func latestFinishedCompactableSync(ctx context.Context, f *dotc1z.C1File) (*reader_v2.SyncRun, error) { - // Compaction must NOT operate on diff syncs (partial_upserts / partial_deletions). - // We want the latest finished "snapshot-like" sync. - candidates := []connectorstore.SyncType{ - connectorstore.SyncTypeFull, - connectorstore.SyncTypeResourcesOnly, - connectorstore.SyncTypePartial, +func (c *Compactor) CompactWithSyncID(ctx context.Context, destSyncID string) error { + baseSyncID, err := c.base.LatestFinishedSyncID(ctx, connectorstore.SyncTypeAny) + if err != nil { + return fmt.Errorf("failed to get base sync ID: %w", err) } - - var best *reader_v2.SyncRun - for _, st := range candidates { - resp, err := f.GetLatestFinishedSync(ctx, reader_v2.SyncsReaderServiceGetLatestFinishedSyncRequest_builder{ - SyncType: string(st), - }.Build()) - if err != nil { - return nil, err - } - s := resp.GetSync() - if s == nil { - continue - } - - if best == nil || s.GetEndedAt().AsTime().After(best.GetEndedAt().AsTime()) { - best = s - } + if baseSyncID == "" { + return fmt.Errorf("no finished sync found in base") } - return best, nil -} - -func (c *Compactor) Compact(ctx context.Context) error { - baseSync, err := latestFinishedCompactableSync(ctx, c.base) + appliedSyncID, err := c.applied.LatestFinishedSyncID(ctx, connectorstore.SyncTypeAny) if err != nil { - return fmt.Errorf("failed to get base sync: %w", err) + return fmt.Errorf("failed to get applied sync ID: %w", err) } - if baseSync == nil { - return fmt.Errorf( - "no finished compactable sync found in base (diff sync types %q/%q are not compactable)", - string(connectorstore.SyncTypePartialUpserts), - string(connectorstore.SyncTypePartialDeletions), - ) + if appliedSyncID == "" { + return fmt.Errorf("no finished sync found in applied") } - appliedSync, err := latestFinishedCompactableSync(ctx, c.applied) + // Attach both the base and applied databases to the destination + base, err := c.dest.AttachFile(c.base, "base") if err != nil { - return fmt.Errorf("failed to get applied sync: %w", err) - } - if appliedSync == nil { - return fmt.Errorf( - "no finished compactable sync found in applied (diff sync types %q/%q are not compactable)", - string(connectorstore.SyncTypePartialUpserts), - string(connectorstore.SyncTypePartialDeletions), - ) + return fmt.Errorf("failed to attach databases to destination: %w", err) } - l := ctxzap.Extract(ctx) + defer func() { + _, err := base.DetachFile("base") + if err != nil { + l.Error("failed to detach file", zap.Error(err)) + } + }() // Attach both the base and applied databases to the destination - attached, err := c.base.AttachFile(c.applied, "attached") + attached, err := c.dest.AttachFile(c.applied, "attached") if err != nil { return fmt.Errorf("failed to attach databases to destination: %w", err) } @@ -92,36 +66,40 @@ func (c *Compactor) Compact(ctx context.Context) error { } }() - if err := c.processRecords(ctx, attached, baseSync, appliedSync); err != nil { + // Drop grants indexes to improve performance. + err = c.dest.DropGrantIndexes(ctx) + if err != nil { + return fmt.Errorf("failed to drop grants indexes: %w", err) + } + + if err := c.processRecords(ctx, attached, destSyncID, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to process records: %w", err) } + // Re-create the destination database to re-create the grant indexes. + err = c.dest.InitTables(ctx) + if err != nil { + return fmt.Errorf("failed to re-create destination database: %w", err) + } + return nil } -func (c *Compactor) processRecords(ctx context.Context, attached *dotc1z.C1FileAttached, baseSync *reader_v2.SyncRun, appliedSync *reader_v2.SyncRun) error { - baseSyncID := baseSync.GetId() - appliedSyncID := appliedSync.GetId() - - // Update the base sync type to the union of the base and applied sync types. - if err := attached.UpdateSync(ctx, baseSync, appliedSync); err != nil { - return fmt.Errorf("failed to update sync %s: %w", baseSyncID, err) - } - +func (c *Compactor) processRecords(ctx context.Context, attached *dotc1z.C1FileAttached, destSyncID string, baseSyncID string, appliedSyncID string) error { // Compact all tables: copy base records and merge newer applied records using raw SQL - if err := attached.CompactResourceTypes(ctx, baseSyncID, appliedSyncID); err != nil { + if err := attached.CompactResourceTypes(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to compact resource types: %w", err) } - if err := attached.CompactResources(ctx, baseSyncID, appliedSyncID); err != nil { + if err := attached.CompactResources(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to compact resources: %w", err) } - if err := attached.CompactEntitlements(ctx, baseSyncID, appliedSyncID); err != nil { + if err := attached.CompactEntitlements(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to compact entitlements: %w", err) } - if err := attached.CompactGrants(ctx, baseSyncID, appliedSyncID); err != nil { + if err := attached.CompactGrants(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to compact grants: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go index 3a43622f..dc8a070d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go @@ -16,6 +16,7 @@ import ( "github.com/conductorone/baton-sdk/pkg/sdk" "github.com/conductorone/baton-sdk/pkg/sync" "github.com/conductorone/baton-sdk/pkg/synccompactor/attached" + "github.com/conductorone/baton-sdk/pkg/synccompactor/naive" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.opentelemetry.io/otel" "go.uber.org/zap" @@ -26,18 +27,17 @@ var tracer = otel.Tracer("baton-sdk/pkg.synccompactor") type CompactorType string const ( + CompactorTypeNaive CompactorType = "naive" CompactorTypeAttached CompactorType = "attached" ) type Compactor struct { compactorType CompactorType entries []*CompactableSync - compactedC1z *dotc1z.C1File tmpDir string destDir string runDuration time.Duration - syncLimit int } type CompactableSync struct { @@ -69,13 +69,6 @@ func WithRunDuration(runDuration time.Duration) Option { } } -// WithSyncLimit sets the number of syncs to keep after compaction cleanup. -func WithSyncLimit(limit int) Option { - return func(c *Compactor) { - c.syncLimit = limit - } -} - func NewCompactor(ctx context.Context, outputDir string, compactableSyncs []*CompactableSync, opts ...Option) (*Compactor, func() error, error) { if len(compactableSyncs) < 2 { return nil, nil, ErrNotEnoughFilesToCompact @@ -143,98 +136,65 @@ func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { default: } - opts := []dotc1z.C1ZOption{ - dotc1z.WithTmpDir(c.tmpDir), - // Performance improvements: - // NOTE: We do not close this c1z after compaction, so syncer will have these pragmas when expanding grants. - // We should re-evaluate these pragmas when partial syncs sync grants. - // Disable journaling. - dotc1z.WithPragma("journal_mode", "OFF"), - // Disable synchronous writes - dotc1z.WithPragma("synchronous", "OFF"), - // Use exclusive locking. - dotc1z.WithPragma("main.locking_mode", "EXCLUSIVE"), - // Use parallel decoding. - dotc1z.WithDecoderOptions(dotc1z.WithDecoderConcurrency(-1)), - // Use parallel encoding. - dotc1z.WithEncoderConcurrency(0), - } - if c.syncLimit > 0 { - opts = append(opts, dotc1z.WithSyncLimit(c.syncLimit)) + // Base sync is c.entries[0], so compact all incrementals first, then apply that onto the base. + applied := c.entries[len(c.entries)-1] + for i := len(c.entries) - 2; i >= 0; i-- { + applied, err = c.doOneCompaction(ctx, c.entries[i], applied) + if err != nil { + return nil, err + } } - fileName := fmt.Sprintf("compacted-%s.c1z", c.entries[0].SyncID) - destFilePath := path.Join(c.tmpDir, fileName) - - c.compactedC1z, err = dotc1z.NewC1ZFile(ctx, destFilePath, opts...) + // Grant expansion doesn't use the connector interface at all, so giving syncer an empty connector is safe... for now. + // If that ever changes, we should implement a file connector that is a wrapper around the reader. + emptyConnector, err := sdk.NewEmptyConnector() if err != nil { - l.Error("doOneCompaction failed: could not create c1z file", zap.Error(err)) + l.Error("error creating empty connector", zap.Error(err)) return nil, err } - defer func() { - if c.compactedC1z == nil { - return - } - err := c.compactedC1z.Close(ctx) - if err != nil { - l.Error("error closing compacted c1z", zap.Error(err)) - } - }() - // Start new sync of type partial. If we compact syncs of other types, this sync type will be updated by attached.UpdateSync which is called by doOneCompaction(). - newSyncId, err := c.compactedC1z.StartNewSync(ctx, connectorstore.SyncTypePartial, "") - if err != nil { - return nil, fmt.Errorf("failed to start new sync: %w", err) - } - err = c.compactedC1z.EndSync(ctx) - if err != nil { - return nil, fmt.Errorf("failed to end sync: %w", err) + + // Use syncer to expand grants. + // TODO: Handle external resources. + syncOpts := []sync.SyncOpt{ + sync.WithC1ZPath(applied.FilePath), + sync.WithTmpDir(c.tmpDir), + sync.WithSyncID(applied.SyncID), + sync.WithOnlyExpandGrants(), } - l.Debug("new empty partial sync created", zap.String("sync_id", newSyncId)) - // Base sync is c.entries[0], so compact in reverse order. That way we compact the biggest sync last. - for i := len(c.entries) - 1; i >= 0; i-- { - err = c.doOneCompaction(ctx, c.entries[i]) - if err != nil { - return nil, fmt.Errorf("failed to compact sync %s: %w", c.entries[i].SyncID, err) - } + compactionDuration := time.Since(compactionStart) + runDuration := c.runDuration - compactionDuration + l.Debug("finished compaction", zap.Duration("compaction_duration", compactionDuration)) + + switch { + case c.runDuration > 0 && runDuration < 0: + return nil, fmt.Errorf("unable to finish compaction sync in run duration (%s). compactions took %s", c.runDuration, compactionDuration) + case runDuration > 0: + syncOpts = append(syncOpts, sync.WithRunDuration(runDuration)) } - resp, err := c.compactedC1z.GetSync(ctx, reader_v2.SyncsReaderServiceGetSyncRequest_builder{ - SyncId: newSyncId, - }.Build()) + syncer, err := sync.NewSyncer( + ctx, + emptyConnector, + syncOpts..., + ) if err != nil { - return nil, fmt.Errorf("failed to get sync: %w", err) - } - newSync := resp.GetSync() - if newSync == nil { - return nil, fmt.Errorf("no sync found") + l.Error("error creating syncer", zap.Error(err)) + return nil, err } - if newSync.GetId() != newSyncId { - return nil, fmt.Errorf("new sync id does not match expected id: %s != %s", newSync.GetId(), newSyncId) + if err := syncer.Sync(ctx); err != nil { + l.Error("error syncing with grant expansion", zap.Error(err)) + return nil, err } - - if newSync.GetSyncType() == string(connectorstore.SyncTypePartial) { - err = c.compactedC1z.Cleanup(ctx) - if err != nil { - return nil, fmt.Errorf("failed to cleanup compacted c1z: %w", err) - } - // Close compactedC1z so that the c1z file is written to disk before cpFile() is called. - err = c.compactedC1z.Close(ctx) - if err != nil { - return nil, fmt.Errorf("failed to close compacted c1z: %w", err) - } - c.compactedC1z = nil - } else { - err = c.expandGrants(ctx, newSyncId, compactionStart) - if err != nil { - return nil, fmt.Errorf("failed to expand grants: %w", err) - } + if err := syncer.Close(ctx); err != nil { + l.Error("error closing syncer", zap.Error(err)) + return nil, err } // Move last compacted file to the destination dir - finalPath := path.Join(c.destDir, fmt.Sprintf("compacted-%s.c1z", newSyncId)) - if err := cpFile(ctx, destFilePath, finalPath); err != nil { + finalPath := path.Join(c.destDir, fmt.Sprintf("compacted-%s.c1z", applied.SyncID)) + if err := cpFile(applied.FilePath, finalPath); err != nil { return nil, err } @@ -245,18 +205,10 @@ func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { } finalPath = abs } - return &CompactableSync{FilePath: finalPath, SyncID: newSyncId}, nil + return &CompactableSync{FilePath: finalPath, SyncID: applied.SyncID}, nil } -func cpFile(ctx context.Context, sourcePath string, destPath string) error { - err := os.Rename(sourcePath, destPath) - if err == nil { - return nil - } - - l := ctxzap.Extract(ctx) - l.Warn("compactor: failed to rename final compacted file, falling back to copy", zap.Error(err), zap.String("source_path", sourcePath), zap.String("dest_path", destPath)) - +func cpFile(sourcePath string, destPath string) error { source, err := os.Open(sourcePath) if err != nil { return fmt.Errorf("failed to open source file: %w", err) @@ -277,94 +229,136 @@ func cpFile(ctx context.Context, sourcePath string, destPath string) error { return nil } -func (c *Compactor) doOneCompaction(ctx context.Context, cs *CompactableSync) error { - ctx, span := tracer.Start(ctx, "Compactor.doOneCompaction") - defer span.End() - l := ctxzap.Extract(ctx) - l.Info( - "running compaction", - zap.String("apply_file", cs.FilePath), - zap.String("apply_sync", cs.SyncID), - zap.String("tmp_dir", c.tmpDir), - ) +func (c *Compactor) getLatestObjects(ctx context.Context, info *CompactableSync) (*reader_v2.SyncRun, *dotc1z.C1File, func(), error) { + cleanup := func() {} - applyFile, err := dotc1z.NewC1ZFile( + baseFile, err := dotc1z.NewC1ZFile( ctx, - cs.FilePath, + info.FilePath, dotc1z.WithTmpDir(c.tmpDir), - dotc1z.WithDecoderOptions(dotc1z.WithDecoderConcurrency(-1)), + dotc1z.WithDecoderOptions(dotc1z.WithDecoderConcurrency(0)), dotc1z.WithReadOnly(true), // We're only reading, so it's safe to use these pragmas. - dotc1z.WithPragma("synchronous", "OFF"), dotc1z.WithPragma("journal_mode", "OFF"), - dotc1z.WithPragma("locking_mode", "EXCLUSIVE"), + dotc1z.WithPragma("synchronous", "OFF"), ) if err != nil { - return err + return nil, nil, cleanup, err } - defer func() { - err := applyFile.Close(ctx) - if err != nil { - l.Error("error closing apply file", zap.Error(err), zap.String("apply_file", cs.FilePath)) - } - }() - runner := attached.NewAttachedCompactor(c.compactedC1z, applyFile) - if err := runner.Compact(ctx); err != nil { - l.Error("error running compaction", zap.Error(err), zap.String("apply_file", cs.FilePath)) - return err + cleanup = func() { + _ = baseFile.Close() } - return nil + latestAppliedSync, err := baseFile.GetSync(ctx, reader_v2.SyncsReaderServiceGetSyncRequest_builder{ + SyncId: info.SyncID, + Annotations: nil, + }.Build()) + if err != nil { + return nil, nil, cleanup, err + } + + return latestAppliedSync.GetSync(), baseFile, cleanup, nil } -func (c *Compactor) expandGrants(ctx context.Context, newSyncId string, compactionStart time.Time) error { +func unionSyncTypes(a, b connectorstore.SyncType) connectorstore.SyncType { + switch { + case a == connectorstore.SyncTypeFull || b == connectorstore.SyncTypeFull: + return connectorstore.SyncTypeFull + case a == connectorstore.SyncTypeResourcesOnly || b == connectorstore.SyncTypeResourcesOnly: + return connectorstore.SyncTypeResourcesOnly + default: + return connectorstore.SyncTypePartial + } +} + +func (c *Compactor) doOneCompaction(ctx context.Context, base *CompactableSync, applied *CompactableSync) (*CompactableSync, error) { + ctx, span := tracer.Start(ctx, "Compactor.doOneCompaction") + defer span.End() l := ctxzap.Extract(ctx) - // Grant expansion doesn't use the connector interface at all, so giving syncer an empty connector is safe... for now. - // If that ever changes, we should implement a file connector that is a wrapper around the reader. - emptyConnector, err := sdk.NewEmptyConnector() - if err != nil { - l.Error("error creating empty connector", zap.Error(err)) - return err + l.Info( + "running compaction", + zap.String("base_file", base.FilePath), + zap.String("base_sync", base.SyncID), + zap.String("applied_file", applied.FilePath), + zap.String("applied_sync", applied.SyncID), + zap.String("tmp_dir", c.tmpDir), + ) + opts := []dotc1z.C1ZOption{ + dotc1z.WithTmpDir(c.tmpDir), + // Performance improvements: + // Disable journaling. + dotc1z.WithPragma("journal_mode", "OFF"), + // Disable synchronous writes + dotc1z.WithPragma("synchronous", "OFF"), + // Use exclusive locking. + dotc1z.WithPragma("main.locking_mode", "EXCLUSIVE"), + // Use memory for temporary storage. + dotc1z.WithPragma("temp_store", "MEMORY"), + // We close this c1z after compaction, so syncer won't have these pragmas when expanding grants. + // Use parallel decoding. + dotc1z.WithDecoderOptions(dotc1z.WithDecoderConcurrency(0)), + // Use parallel encoding. + dotc1z.WithEncoderConcurrency(0), } - // Use syncer to expand grants. - // TODO: Handle external resources. - syncOpts := []sync.SyncOpt{ - sync.WithConnectorStore(c.compactedC1z), // Use the existing C1File so we're not wasting time compressing & decompressing it. - sync.WithTmpDir(c.tmpDir), - sync.WithSyncID(newSyncId), - sync.WithOnlyExpandGrants(), + fileName := fmt.Sprintf("compacted-%s-%s.c1z", base.SyncID, applied.SyncID) + newFile, err := dotc1z.NewC1ZFile(ctx, path.Join(c.tmpDir, fileName), opts...) + if err != nil { + l.Error("doOneCompaction failed: could not create c1z file", zap.Error(err)) + return nil, err } + defer func() { _ = newFile.Close() }() - compactionDuration := time.Since(compactionStart) - runDuration := c.runDuration - compactionDuration - l.Debug("finished compaction", zap.Duration("compaction_duration", compactionDuration)) + baseSync, baseFile, cleanupBase, err := c.getLatestObjects(ctx, base) + defer cleanupBase() + if err != nil { + return nil, err + } - switch { - case c.runDuration > 0 && runDuration <= 0: - return fmt.Errorf("unable to finish compaction sync in run duration (%s). compactions took %s", c.runDuration, compactionDuration) - case runDuration > 0: - syncOpts = append(syncOpts, sync.WithRunDuration(runDuration)) + appliedSync, appliedFile, cleanupApplied, err := c.getLatestObjects(ctx, applied) + defer cleanupApplied() + if err != nil { + return nil, err } - syncer, err := sync.NewSyncer( - ctx, - emptyConnector, - syncOpts..., - ) + syncType := unionSyncTypes(connectorstore.SyncType(baseSync.GetSyncType()), connectorstore.SyncType(appliedSync.GetSyncType())) + + newSyncId, err := newFile.StartNewSync(ctx, syncType, "") if err != nil { - l.Error("error creating syncer", zap.Error(err)) - return err + return nil, err } - if err := syncer.Sync(ctx); err != nil { - l.Error("error syncing with grant expansion", zap.Error(err)) - return err + switch c.compactorType { + case CompactorTypeNaive: + // TODO: Add support for syncID or remove naive compactor. + runner := naive.NewNaiveCompactor(baseFile, appliedFile, newFile) + if err := runner.Compact(ctx); err != nil { + l.Error("error running compaction", zap.Error(err)) + return nil, err + } + case CompactorTypeAttached: + runner := attached.NewAttachedCompactor(baseFile, appliedFile, newFile) + if err := runner.CompactWithSyncID(ctx, newSyncId); err != nil { + l.Error("error running compaction", zap.Error(err)) + return nil, err + } + default: + // c.compactorType defaults to attached, so this should never happen. + return nil, fmt.Errorf("invalid compactor type: %s", c.compactorType) } - if err := syncer.Close(ctx); err != nil { - l.Error("error closing syncer", zap.Error(err)) - return err + + if err := newFile.EndSync(ctx); err != nil { + return nil, err } - return nil + + outputFilepath, err := newFile.OutputFilepath() + if err != nil { + return nil, err + } + + return &CompactableSync{ + FilePath: outputFilepath, + SyncID: newSyncId, + }, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/create_account.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/create_account.go index f9e5255f..eb45b3c4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/create_account.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/create_account.go @@ -45,7 +45,6 @@ func (g *createAccountTaskHandler) HandleTask(ctx context.Context) error { AccountInfo: t.GetAccountInfo(), CredentialOptions: t.GetCredentialOptions(), EncryptionConfigs: t.GetEncryptionConfigs(), - ResourceTypeId: t.GetResourceTypeId(), }.Build()) if err != nil { l.Error("failed creating account", zap.Error(err)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go index bb581b9b..7d507117 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go @@ -18,10 +18,9 @@ type localAccountManager struct { dbPath string o sync.Once - login string - email string - profile *structpb.Struct - resourceTypeId string + login string + email string + profile *structpb.Struct } func (m *localAccountManager) GetTempDir() string { @@ -36,9 +35,7 @@ func (m *localAccountManager) Next(ctx context.Context) (*v1.Task, time.Duration var task *v1.Task m.o.Do(func() { task = v1.Task_builder{ - CreateAccount: &v1.Task_CreateAccountTask{ - ResourceTypeId: m.resourceTypeId, - }, + CreateAccount: &v1.Task_CreateAccountTask{}, }.Build() }) return task, 0, nil @@ -48,7 +45,7 @@ func (m *localAccountManager) Process(ctx context.Context, task *v1.Task, cc typ ctx, span := tracer.Start(ctx, "localAccountManager.Process", trace.WithNewRoot()) defer span.End() - accountManager := provisioner.NewCreateAccountManager(cc, m.dbPath, m.login, m.email, m.profile, m.resourceTypeId) + accountManager := provisioner.NewCreateAccountManager(cc, m.dbPath, m.login, m.email, m.profile) err := accountManager.Run(ctx) if err != nil { @@ -63,13 +60,12 @@ func (m *localAccountManager) Process(ctx context.Context, task *v1.Task, cc typ return nil } -// NewCreateAccountManager returns a task manager that queues a create account task. -func NewCreateAccountManager(ctx context.Context, dbPath string, login string, email string, profile *structpb.Struct, resourceTypeId string) tasks.Manager { +// NewGranter returns a task manager that queues a sync task. +func NewCreateAccountManager(ctx context.Context, dbPath string, login string, email string, profile *structpb.Struct) tasks.Manager { return &localAccountManager{ - dbPath: dbPath, - login: login, - email: email, - profile: profile, - resourceTypeId: resourceTypeId, + dbPath: dbPath, + login: login, + email: email, + profile: profile, } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go index b5590414..db0e64d4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go @@ -68,10 +68,6 @@ func Is(task *v1.Task, target taskTypes.TaskType) bool { return actualType == v1.Task_ActionStatus_case case taskTypes.CreateSyncDiff: return actualType == v1.Task_CreateSyncDiff_case - case taskTypes.ListEventFeedsType: - return actualType == v1.Task_ListEventFeeds_case - case taskTypes.ListEventsType: - return actualType == v1.Task_ListEvents_case default: return false } @@ -123,10 +119,6 @@ func GetType(task *v1.Task) taskTypes.TaskType { return taskTypes.ActionStatusType case v1.Task_CreateSyncDiff_case: return taskTypes.CreateSyncDiff - case v1.Task_ListEventFeeds_case: - return taskTypes.ListEventFeedsType - case v1.Task_ListEvents_case: - return taskTypes.ListEventsType default: return taskTypes.UnknownType } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go index 7a441a12..8715c825 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go @@ -32,12 +32,6 @@ func WithDisplayName(displayName string) EntitlementOption { } } -func WithSlug(slug string) EntitlementOption { - return func(g *v2.Entitlement) { - g.SetSlug(slug) - } -} - func WithDescription(description string) EntitlementOption { return func(g *v2.Entitlement) { g.SetDescription(description) @@ -78,21 +72,6 @@ func NewAssignmentEntitlement(resource *v2.Resource, name string, entitlementOpt return entitlement } -func NewOwnershipEntitlement(resource *v2.Resource, name string, entitlementOptions ...EntitlementOption) *v2.Entitlement { - entitlement := v2.Entitlement_builder{ - Id: NewEntitlementID(resource, name), - DisplayName: name, - Slug: name, - Purpose: v2.Entitlement_PURPOSE_VALUE_OWNERSHIP, - Resource: resource, - }.Build() - - for _, entitlementOption := range entitlementOptions { - entitlementOption(entitlement) - } - return entitlement -} - func NewEntitlement(resource *v2.Resource, name, purposeStr string, entitlementOptions ...EntitlementOption) *v2.Entitlement { var purpose v2.Entitlement_PurposeValue switch purposeStr { @@ -100,8 +79,6 @@ func NewEntitlement(resource *v2.Resource, name, purposeStr string, entitlementO purpose = v2.Entitlement_PURPOSE_VALUE_PERMISSION case "assignment": purpose = v2.Entitlement_PURPOSE_VALUE_ASSIGNMENT - case "ownership": - purpose = v2.Entitlement_PURPOSE_VALUE_OWNERSHIP default: purpose = v2.Entitlement_PURPOSE_VALUE_UNSPECIFIED } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go index b472ca99..972c6344 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go @@ -36,10 +36,9 @@ func WithGrantMetadata(metadata map[string]interface{}) GrantOption { } } -// WithExternalPrincipalID: Deprecated. This field is no longer used. func WithExternalPrincipalID(externalID *v2.ExternalId) GrantOption { return func(g *v2.Grant) error { - g.GetPrincipal().SetExternalId(externalID) //nolint:staticcheck // Deprecated. + g.GetPrincipal().SetExternalId(externalID) return nil } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/resource.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/resource.go index b7dae67e..33d3f132 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/resource.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/resource.go @@ -9,8 +9,6 @@ import ( "github.com/conductorone/baton-sdk/pkg/annotations" "github.com/conductorone/baton-sdk/pkg/pagination" "github.com/conductorone/baton-sdk/pkg/types/sessions" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) @@ -31,10 +29,9 @@ func WithAnnotation(msgs ...proto.Message) ResourceOption { } } -// WithExternalID: Deprecated. This field is no longer used. func WithExternalID(externalID *v2.ExternalId) ResourceOption { return func(r *v2.Resource) error { - r.SetExternalId(externalID) //nolint:staticcheck // Deprecated. + r.SetExternalId(externalID) return nil } } @@ -135,39 +132,6 @@ func WithRoleTrait(opts ...RoleTraitOption) ResourceOption { } } -func WithScopeBindingTrait(opts ...ScopeBindingTraitOption) ResourceOption { - return func(r *v2.Resource) error { - rt := &v2.ScopeBindingTrait{} - - annos := annotations.Annotations(r.GetAnnotations()) - _, err := annos.Pick(rt) - if err != nil { - return err - } - - for _, o := range opts { - err := o(rt) - if err != nil { - return err - } - } - - roleId := rt.GetRoleId() - scopeResourceId := rt.GetScopeResourceId() - if roleId == nil { - return status.Errorf(codes.InvalidArgument, "role ID is required for scope binding trait") - } - if scopeResourceId == nil { - return status.Errorf(codes.InvalidArgument, "scope resource ID is required for scope binding trait") - } - - annos.Update(rt) - r.SetAnnotations(annos) - - return nil - } -} - func WithAppTrait(opts ...AppTraitOption) ResourceOption { return func(r *v2.Resource) error { at := &v2.AppTrait{} @@ -340,24 +304,6 @@ func NewRoleResource( return ret, nil } -// NewScopeBindingResource returns a new resource instance with a configured scope binding trait. -func NewScopeBindingResource( - name string, - resourceType *v2.ResourceType, - objectID any, - scopeBindingOpts []ScopeBindingTraitOption, - opts ...ResourceOption, -) (*v2.Resource, error) { - opts = append(opts, WithScopeBindingTrait(scopeBindingOpts...)) - - ret, err := NewResource(name, resourceType, objectID, opts...) - if err != nil { - return nil, err - } - - return ret, nil -} - // NewAppResource returns a new resource instance with a configured app trait. // The trait is configured with the provided helpURL and profile. func NewAppResource( diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/role_trait.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/role_trait.go index 80b75a6d..bc534133 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/role_trait.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/role_trait.go @@ -1,10 +1,10 @@ package resource import ( + "fmt" + v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" "github.com/conductorone/baton-sdk/pkg/annotations" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/structpb" ) @@ -23,22 +23,6 @@ func WithRoleProfile(profile map[string]interface{}) RoleTraitOption { } } -func WithRoleScopeConditions(typ string, conditions []string) RoleTraitOption { - return func(rt *v2.RoleTrait) error { - rt.RoleScopeConditions = &v2.RoleScopeConditions{ - Type: typ, - Conditions: make([]*v2.RoleScopeCondition, len(conditions)), - } - for i, condition := range conditions { - rt.RoleScopeConditions.Conditions[i] = &v2.RoleScopeCondition{ - Expression: condition, - } - } - - return nil - } -} - // NewRoleTrait creates a new `RoleTrait` with the provided profile. func NewRoleTrait(opts ...RoleTraitOption) (*v2.RoleTrait, error) { groupTrait := &v2.RoleTrait{} @@ -62,7 +46,7 @@ func GetRoleTrait(resource *v2.Resource) (*v2.RoleTrait, error) { return nil, err } if !ok { - return nil, status.Errorf(codes.NotFound, "role trait was not found on resource") + return nil, fmt.Errorf("role trait was not found on resource") } return ret, nil diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go index f3079e19..9b8218d3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go @@ -13,56 +13,22 @@ import ( // SecurityInsightTraitOption is a functional option for configuring a SecurityInsightTrait. type SecurityInsightTraitOption func(*v2.SecurityInsightTrait) error -// WithRiskScore sets the insight type to risk score with the given value. -func WithRiskScore(value string) SecurityInsightTraitOption { +// WithInsightType sets the insight type. This is typically set via NewSecurityInsightTrait, +// but can be used to override or update the type on an existing trait. +func WithInsightType(insightType string) SecurityInsightTraitOption { return func(t *v2.SecurityInsightTrait) error { - if value == "" { - return fmt.Errorf("risk score value cannot be empty") + if insightType == "" { + return fmt.Errorf("insight type cannot be empty") } - t.SetRiskScore(&v2.RiskScore{ - Value: value, - }) + t.SetInsightType(insightType) return nil } } -// WithRiskScoreFactors sets or updates the factors on a risk score insight. -// Factors provide context as to why a particular risk score was assigned. -// This should be used after WithRiskScore or on an existing risk score insight. -func WithRiskScoreFactors(factors ...string) SecurityInsightTraitOption { +// WithInsightValue sets the value of the security insight. +func WithInsightValue(value string) SecurityInsightTraitOption { return func(t *v2.SecurityInsightTrait) error { - rs := t.GetRiskScore() - if rs == nil { - return fmt.Errorf("cannot set factors: insight is not a risk score type (use WithRiskScore first)") - } - rs.SetFactors(factors) - return nil - } -} - -// WithIssue sets the insight type to issue with the given value. -func WithIssue(value string) SecurityInsightTraitOption { - return func(t *v2.SecurityInsightTrait) error { - if value == "" { - return fmt.Errorf("issue value cannot be empty") - } - issue := &v2.Issue{ - Value: value, - } - t.SetIssue(issue) - return nil - } -} - -// WithIssueSeverity sets or updates the severity on an issue insight. -// This should be used after WithIssue or on an existing issue insight. -func WithIssueSeverity(severity string) SecurityInsightTraitOption { - return func(t *v2.SecurityInsightTrait) error { - issue := t.GetIssue() - if issue == nil { - return fmt.Errorf("cannot set severity: insight is not an issue type (use WithIssue first)") - } - issue.SetSeverity(severity) + t.SetValue(value) return nil } } @@ -107,34 +73,16 @@ func WithInsightExternalResourceTarget(externalId string, appHint string) Securi } } -// WithInsightAppUserTarget sets the app user target for the insight. -// Use this when the insight should be resolved to an AppUser by email and external ID. -func WithInsightAppUserTarget(email string, externalId string) SecurityInsightTraitOption { - return func(t *v2.SecurityInsightTrait) error { - t.SetAppUser(v2.SecurityInsightTrait_AppUserTarget_builder{ - Email: email, - ExternalId: externalId, - }.Build()) - return nil +// NewSecurityInsightTrait creates a new SecurityInsightTrait with the given insight type and options. +func NewSecurityInsightTrait(insightType string, opts ...SecurityInsightTraitOption) (*v2.SecurityInsightTrait, error) { + if insightType == "" { + return nil, fmt.Errorf("insight type cannot be empty") } -} -// NewSecurityInsightTrait creates a new SecurityInsightTrait with the given options. -// You must provide either WithRiskScore or WithIssue to set the insight type. -// -// Example usage: -// -// trait, err := NewSecurityInsightTrait( -// WithIssue("CVE-2024-1234", "Critical"), -// WithInsightUserTarget("user@example.com")) -// -// trait, err := NewSecurityInsightTrait( -// WithRiskScore("85"), -// WithInsightResourceTarget(resourceId)) -func NewSecurityInsightTrait(opts ...SecurityInsightTraitOption) (*v2.SecurityInsightTrait, error) { - trait := &v2.SecurityInsightTrait{ - ObservedAt: timestamppb.Now(), - } + trait := v2.SecurityInsightTrait_builder{ + InsightType: insightType, + ObservedAt: timestamppb.Now(), + }.Build() for _, opt := range opts { if err := opt(trait); err != nil { @@ -142,15 +90,6 @@ func NewSecurityInsightTrait(opts ...SecurityInsightTraitOption) (*v2.SecurityIn } } - // Validate that an insight type was set - if trait.GetRiskScore() == nil && trait.GetIssue() == nil { - return nil, fmt.Errorf("insight type must be set (use WithRiskScore or WithIssue)") - } - - if trait.GetTarget() == nil { - return nil, fmt.Errorf("target must be set (use WithInsightUserTarget, WithInsightResourceTarget, WithInsightExternalResourceTarget, or WithInsightAppUserTarget)") - } - return trait, nil } @@ -170,20 +109,10 @@ func GetSecurityInsightTrait(resource *v2.Resource) (*v2.SecurityInsightTrait, e } // WithSecurityInsightTrait adds or updates a SecurityInsightTrait annotation on a resource. -// The insight type (risk score or issue) must be set via the provided options. +// The insightType parameter is required to ensure the trait is always valid. // If the resource already has a SecurityInsightTrait, it will be updated with the provided options. -// If not, a new trait will be created. -// -// Example usage: -// -// resource, err := NewResource( -// "Security Finding", -// resourceType, -// objectID, -// WithSecurityInsightTrait( -// WithIssue("CVE-2024-1234", "Critical"), -// WithInsightUserTarget("user@example.com"))) -func WithSecurityInsightTrait(opts ...SecurityInsightTraitOption) ResourceOption { +// If not, a new trait will be created with the given insightType. +func WithSecurityInsightTrait(insightType string, opts ...SecurityInsightTraitOption) ResourceOption { return func(r *v2.Resource) error { t := &v2.SecurityInsightTrait{} annos := annotations.Annotations(r.GetAnnotations()) @@ -193,9 +122,16 @@ func WithSecurityInsightTrait(opts ...SecurityInsightTraitOption) ResourceOption } if !existing { - // Creating a new trait - set default observation time - t.SetObservedAt(timestamppb.Now()) + // Creating a new trait - insightType is required + if insightType == "" { + return fmt.Errorf("insight type is required when creating a new security insight trait") + } + t.SetInsightType(insightType) + } else if insightType != "" { + // Updating existing trait with a new type + t.SetInsightType(insightType) } + // If existing and insightType is empty, keep the existing type for _, o := range opts { if err := o(t); err != nil { @@ -203,11 +139,6 @@ func WithSecurityInsightTrait(opts ...SecurityInsightTraitOption) ResourceOption } } - // Validate that an insight type was set - if t.GetRiskScore() == nil && t.GetIssue() == nil { - return fmt.Errorf("insight type must be set (use WithRiskScore or WithIssue)") - } - annos.Update(t) r.SetAnnotations(annos) @@ -215,98 +146,96 @@ func WithSecurityInsightTrait(opts ...SecurityInsightTraitOption) ResourceOption } } -// NewSecurityInsightResource creates a security insight resource with the given trait options. -// This is a flexible constructor that uses the options pattern to configure all aspects of the insight. -// -// Example usage: -// -// // Risk score for a user -// resource, err := NewSecurityInsightResource( -// "User Risk Score", -// securityInsightResourceType, -// "user-123", -// WithRiskScore("85"), -// WithRiskScoreFactors("MFA not enabled", "No recent activity", "Excessive permissions"), -// WithInsightUserTarget("user@example.com")) -// -// // Issue with severity for a resource -// resource, err := NewSecurityInsightResource( -// "Critical Vulnerability", -// securityInsightResourceType, -// "vuln-456", -// WithIssue("CVE-2024-1234", "Critical"), -// WithInsightResourceTarget(resourceId)) -// -// // Issue for external resource with custom observation time -// resource, err := NewSecurityInsightResource( -// "AWS Security Finding", -// securityInsightResourceType, -// "finding-789", -// WithIssue("S3 bucket publicly accessible"), -// WithIssueSeverity("High"), -// WithInsightExternalResourceTarget("arn:aws:s3:::my-bucket", "aws"), -// WithInsightObservedAt(time.Now())) -func NewSecurityInsightResource( +// NewUserSecurityInsightResource creates a security insight resource targeting a user by email. +// Use this when the insight should be resolved to a C1 User by Uplift. +func NewUserSecurityInsightResource( name string, resourceType *v2.ResourceType, objectID interface{}, - traitOpts ...SecurityInsightTraitOption, + insightType string, + value string, + userEmail string, + traitOpts []SecurityInsightTraitOption, + opts ...ResourceOption, ) (*v2.Resource, error) { - trait, err := NewSecurityInsightTrait(traitOpts...) + allTraitOpts := append([]SecurityInsightTraitOption{ + WithInsightValue(value), + WithInsightUserTarget(userEmail), + }, traitOpts...) + + trait, err := NewSecurityInsightTrait(insightType, allTraitOpts...) if err != nil { return nil, err } - return NewResource(name, resourceType, objectID, WithAnnotation(trait)) + opts = append(opts, WithAnnotation(trait)) + + return NewResource(name, resourceType, objectID, opts...) } -// IsSecurityInsightResource checks if a resource type has the TRAIT_SECURITY_INSIGHT trait. -func IsSecurityInsightResource(resourceType *v2.ResourceType) bool { - for _, trait := range resourceType.GetTraits() { - if trait == v2.ResourceType_TRAIT_SECURITY_INSIGHT { - return true - } +// NewResourceSecurityInsightResource creates a security insight resource with a direct resource reference. +// Use this when the connector knows the actual resource (synced by this connector). +func NewResourceSecurityInsightResource( + name string, + resourceType *v2.ResourceType, + objectID interface{}, + insightType string, + value string, + targetResourceId *v2.ResourceId, + traitOpts []SecurityInsightTraitOption, + opts ...ResourceOption, +) (*v2.Resource, error) { + allTraitOpts := append([]SecurityInsightTraitOption{ + WithInsightValue(value), + WithInsightResourceTarget(targetResourceId), + }, traitOpts...) + + trait, err := NewSecurityInsightTrait(insightType, allTraitOpts...) + if err != nil { + return nil, err } - return false -} -// --- Insight type checkers --- + opts = append(opts, WithAnnotation(trait)) -// IsRiskScore returns true if the insight is a risk score. -func IsRiskScore(trait *v2.SecurityInsightTrait) bool { - return trait.GetRiskScore() != nil + return NewResource(name, resourceType, objectID, opts...) } -// IsIssue returns true if the insight is an issue. -func IsIssue(trait *v2.SecurityInsightTrait) bool { - return trait.GetIssue() != nil -} +// NewExternalResourceSecurityInsightResource creates a security insight resource targeting an external resource. +// Use this when the connector only has an external ID (e.g., ARN) and needs Uplift to resolve it. +func NewExternalResourceSecurityInsightResource( + name string, + resourceType *v2.ResourceType, + objectID interface{}, + insightType string, + value string, + targetExternalId string, + targetAppHint string, + traitOpts []SecurityInsightTraitOption, + opts ...ResourceOption, +) (*v2.Resource, error) { + allTraitOpts := append([]SecurityInsightTraitOption{ + WithInsightValue(value), + WithInsightExternalResourceTarget(targetExternalId, targetAppHint), + }, traitOpts...) -// GetInsightValue returns the value of the insight (either risk score or issue). -func GetInsightValue(trait *v2.SecurityInsightTrait) string { - if rs := trait.GetRiskScore(); rs != nil { - return rs.GetValue() - } - if issue := trait.GetIssue(); issue != nil { - return issue.GetValue() + trait, err := NewSecurityInsightTrait(insightType, allTraitOpts...) + if err != nil { + return nil, err } - return "" -} -// GetIssueSeverity returns the severity of an issue insight, or empty string if not set or not an issue. -func GetIssueSeverity(trait *v2.SecurityInsightTrait) string { - if issue := trait.GetIssue(); issue != nil { - return issue.GetSeverity() - } - return "" + opts = append(opts, WithAnnotation(trait)) + + return NewResource(name, resourceType, objectID, opts...) } -// GetRiskScoreFactors returns the factors of a risk score insight, or nil if not set or not a risk score. -func GetRiskScoreFactors(trait *v2.SecurityInsightTrait) []string { - if rs := trait.GetRiskScore(); rs != nil { - return rs.GetFactors() +// IsSecurityInsightResource checks if a resource type has the TRAIT_SECURITY_INSIGHT trait. +func IsSecurityInsightResource(resourceType *v2.ResourceType) bool { + for _, trait := range resourceType.GetTraits() { + if trait == v2.ResourceType_TRAIT_SECURITY_INSIGHT { + return true + } } - return nil + return false } // --- Target type checkers --- @@ -326,11 +255,6 @@ func IsExternalResourceTarget(trait *v2.SecurityInsightTrait) bool { return trait.GetExternalResource() != nil } -// IsAppUserTarget returns true if the insight targets an app user. -func IsAppUserTarget(trait *v2.SecurityInsightTrait) bool { - return trait.GetAppUser() != nil -} - // --- Target data extractors --- // GetUserTargetEmail returns the user email from a SecurityInsightTrait, or empty string if not a user target. @@ -361,19 +285,3 @@ func GetExternalResourceTargetAppHint(trait *v2.SecurityInsightTrait) string { } return "" } - -// GetAppUserTargetEmail returns the email from a SecurityInsightTrait, or empty string if not an app user target. -func GetAppUserTargetEmail(trait *v2.SecurityInsightTrait) string { - if appUser := trait.GetAppUser(); appUser != nil { - return appUser.GetEmail() - } - return "" -} - -// GetAppUserTargetExternalId returns the external ID from a SecurityInsightTrait, or empty string if not an app user target. -func GetAppUserTargetExternalId(trait *v2.SecurityInsightTrait) string { - if appUser := trait.GetAppUser(); appUser != nil { - return appUser.GetExternalId() - } - return "" -} diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index 63541994..34c9ae76 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -92,6 +92,9 @@ var ARM64 struct { HasSHA2 bool // SHA2 hardware implementation HasCRC32 bool // CRC32 hardware implementation HasATOMICS bool // Atomic memory operation instruction set + HasHPDS bool // Hierarchical permission disables in translations tables + HasLOR bool // Limited ordering regions + HasPAN bool // Privileged access never HasFPHP bool // Half precision floating-point instruction set HasASIMDHP bool // Advanced SIMD half precision instruction set HasCPUID bool // CPUID identification scheme registers diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go index af2aa99f..f449c679 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -65,10 +65,10 @@ func setMinimalFeatures() { func readARM64Registers() { Initialized = true - parseARM64SystemRegisters(getisar0(), getisar1(), getpfr0()) + parseARM64SystemRegisters(getisar0(), getisar1(), getmmfr1(), getpfr0()) } -func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { +func parseARM64SystemRegisters(isar0, isar1, mmfr1, pfr0 uint64) { // ID_AA64ISAR0_EL1 switch extractBits(isar0, 4, 7) { case 1: @@ -152,6 +152,22 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { ARM64.HasI8MM = true } + // ID_AA64MMFR1_EL1 + switch extractBits(mmfr1, 12, 15) { + case 1, 2: + ARM64.HasHPDS = true + } + + switch extractBits(mmfr1, 16, 19) { + case 1: + ARM64.HasLOR = true + } + + switch extractBits(mmfr1, 20, 23) { + case 1, 2, 3: + ARM64.HasPAN = true + } + // ID_AA64PFR0_EL1 switch extractBits(pfr0, 16, 19) { case 0: diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s index 3b0450a0..a4f24b3b 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -20,6 +20,13 @@ TEXT ·getisar1(SB),NOSPLIT,$0-8 MOVD R0, ret+0(FP) RET +// func getmmfr1() uint64 +TEXT ·getmmfr1(SB),NOSPLIT,$0-8 + // get Memory Model Feature Register 1 into x0 + MRS ID_AA64MMFR1_EL1, R0 + MOVD R0, ret+0(FP) + RET + // func getpfr0() uint64 TEXT ·getpfr0(SB),NOSPLIT,$0-8 // get Processor Feature Register 0 into x0 diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go index 6ac6e1ef..e3fc5a8d 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -8,5 +8,6 @@ package cpu func getisar0() uint64 func getisar1() uint64 +func getmmfr1() uint64 func getpfr0() uint64 func getzfr0() uint64 diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go index 7f194678..8df2079e 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go @@ -8,4 +8,5 @@ package cpu func getisar0() uint64 { return 0 } func getisar1() uint64 { return 0 } +func getmmfr1() uint64 { return 0 } func getpfr0() uint64 { return 0 } diff --git a/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go index ebfb3fc8..19aea063 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go @@ -167,7 +167,7 @@ func doinit() { setMinimalFeatures() return } - parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64pfr0) + parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64mmfr1, cpuid.aa64pfr0) Initialized = true } diff --git a/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go index 85b64d5c..87fd3a77 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go @@ -59,7 +59,7 @@ func doinit() { if !ok { return } - parseARM64SystemRegisters(isar0, isar1, 0) + parseARM64SystemRegisters(isar0, isar1, 0, 0) Initialized = true } diff --git a/vendor/modules.txt b/vendor/modules.txt index ad9793bd..b9cff5c8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -18,8 +18,8 @@ github.com/aws/aws-lambda-go/lambda github.com/aws/aws-lambda-go/lambda/handlertrace github.com/aws/aws-lambda-go/lambda/messages github.com/aws/aws-lambda-go/lambdacontext -# github.com/aws/aws-sdk-go-v2 v1.41.0 -## explicit; go 1.23 +# github.com/aws/aws-sdk-go-v2 v1.36.3 +## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/arn github.com/aws/aws-sdk-go-v2/aws/defaults @@ -124,8 +124,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc/types github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.24.0 -## explicit; go 1.23 +# github.com/aws/smithy-go v1.22.2 +## explicit; go 1.21 github.com/aws/smithy-go github.com/aws/smithy-go/auth github.com/aws/smithy-go/auth/bearer @@ -156,13 +156,10 @@ github.com/aws/smithy-go/waiter # github.com/benbjohnson/clock v1.3.5 ## explicit; go 1.15 github.com/benbjohnson/clock -# github.com/cenkalti/backoff/v5 v5.0.3 -## explicit; go 1.23 -github.com/cenkalti/backoff/v5 -# github.com/cespare/xxhash/v2 v2.3.0 -## explicit; go 1.11 -github.com/cespare/xxhash/v2 -# github.com/conductorone/baton-sdk v0.7.14 +# github.com/cenkalti/backoff/v4 v4.3.0 +## explicit; go 1.18 +github.com/cenkalti/backoff/v4 +# github.com/conductorone/baton-sdk v0.6.9 ## explicit; go 1.25.2 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 @@ -191,7 +188,6 @@ github.com/conductorone/baton-sdk/pkg/dotc1z/manager github.com/conductorone/baton-sdk/pkg/dotc1z/manager/local github.com/conductorone/baton-sdk/pkg/dotc1z/manager/s3 github.com/conductorone/baton-sdk/pkg/field -github.com/conductorone/baton-sdk/pkg/healthcheck github.com/conductorone/baton-sdk/pkg/lambda/grpc github.com/conductorone/baton-sdk/pkg/lambda/grpc/config github.com/conductorone/baton-sdk/pkg/lambda/grpc/middleware @@ -208,6 +204,7 @@ github.com/conductorone/baton-sdk/pkg/sync/expand github.com/conductorone/baton-sdk/pkg/sync/expand/scc github.com/conductorone/baton-sdk/pkg/synccompactor github.com/conductorone/baton-sdk/pkg/synccompactor/attached +github.com/conductorone/baton-sdk/pkg/synccompactor/naive github.com/conductorone/baton-sdk/pkg/tasks github.com/conductorone/baton-sdk/pkg/tasks/c1api github.com/conductorone/baton-sdk/pkg/tasks/local @@ -272,13 +269,13 @@ github.com/fsnotify/fsnotify/internal # github.com/glebarez/go-sqlite v1.22.0 ## explicit; go 1.17 github.com/glebarez/go-sqlite -# github.com/go-jose/go-jose/v4 v4.1.3 -## explicit; go 1.24.0 +# github.com/go-jose/go-jose/v4 v4.0.5 +## explicit; go 1.21 github.com/go-jose/go-jose/v4 github.com/go-jose/go-jose/v4/cipher github.com/go-jose/go-jose/v4/json github.com/go-jose/go-jose/v4/jwt -# github.com/go-logr/logr v1.4.3 +# github.com/go-logr/logr v1.4.2 ## explicit; go 1.18 github.com/go-logr/logr github.com/go-logr/logr/funcr @@ -321,8 +318,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap github.com/grpc-ecosystem/go-grpc-middleware/recovery github.com/grpc-ecosystem/go-grpc-middleware/tags github.com/grpc-ecosystem/go-grpc-middleware/validator -# github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 -## explicit; go 1.24.0 +# github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 +## explicit; go 1.22 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/runtime github.com/grpc-ecosystem/grpc-gateway/v2/utilities @@ -491,88 +488,78 @@ github.com/tklauser/numcpus # github.com/yusufpapurcu/wmi v1.2.4 ## explicit; go 1.16 github.com/yusufpapurcu/wmi -# go.opentelemetry.io/auto/sdk v1.2.1 -## explicit; go 1.24.0 +# go.opentelemetry.io/auto/sdk v1.1.0 +## explicit; go 1.22.0 go.opentelemetry.io/auto/sdk go.opentelemetry.io/auto/sdk/internal/telemetry -# go.opentelemetry.io/contrib/bridges/otelzap v0.14.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/contrib/bridges/otelzap v0.10.0 +## explicit; go 1.22.0 go.opentelemetry.io/contrib/bridges/otelzap -# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 -## explicit; go 1.23.0 +# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 +## explicit; go 1.22.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal -# go.opentelemetry.io/otel v1.39.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel v1.35.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute -go.opentelemetry.io/otel/attribute/internal -go.opentelemetry.io/otel/attribute/internal/xxhash go.opentelemetry.io/otel/baggage go.opentelemetry.io/otel/codes +go.opentelemetry.io/otel/internal +go.opentelemetry.io/otel/internal/attribute go.opentelemetry.io/otel/internal/baggage go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation +go.opentelemetry.io/otel/semconv/v1.17.0 +go.opentelemetry.io/otel/semconv/v1.26.0 go.opentelemetry.io/otel/semconv/v1.27.0 -go.opentelemetry.io/otel/semconv/v1.37.0 -go.opentelemetry.io/otel/semconv/v1.37.0/otelconv -go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv -# go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.15.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/observ go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/retry go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/transform -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/x -# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform -# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x -# go.opentelemetry.io/otel/log v0.15.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/log v0.11.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel/log go.opentelemetry.io/otel/log/embedded go.opentelemetry.io/otel/log/global go.opentelemetry.io/otel/log/internal/global go.opentelemetry.io/otel/log/noop -# go.opentelemetry.io/otel/metric v1.39.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/metric v1.35.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded go.opentelemetry.io/otel/metric/noop -# go.opentelemetry.io/otel/sdk v1.39.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/sdk v1.35.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/sdk/instrumentation +go.opentelemetry.io/otel/sdk/internal/env go.opentelemetry.io/otel/sdk/internal/x go.opentelemetry.io/otel/sdk/resource go.opentelemetry.io/otel/sdk/trace -go.opentelemetry.io/otel/sdk/trace/internal/env -go.opentelemetry.io/otel/sdk/trace/internal/observ -# go.opentelemetry.io/otel/sdk/log v0.15.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/sdk/log v0.11.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel/sdk/log -go.opentelemetry.io/otel/sdk/log/internal/observ -go.opentelemetry.io/otel/sdk/log/internal/x -# go.opentelemetry.io/otel/trace v1.39.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/trace v1.35.0 +## explicit; go 1.22.0 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded go.opentelemetry.io/otel/trace/internal/telemetry go.opentelemetry.io/otel/trace/noop -# go.opentelemetry.io/proto/otlp v1.9.0 -## explicit; go 1.23.0 +# go.opentelemetry.io/proto/otlp v1.5.0 +## explicit; go 1.22.0 go.opentelemetry.io/proto/otlp/collector/logs/v1 go.opentelemetry.io/proto/otlp/collector/trace/v1 go.opentelemetry.io/proto/otlp/common/v1 @@ -585,7 +572,7 @@ go.uber.org/multierr # go.uber.org/ratelimit v0.3.1 ## explicit; go 1.20 go.uber.org/ratelimit -# go.uber.org/zap v1.27.1 +# go.uber.org/zap v1.27.0 ## explicit; go 1.19 go.uber.org/zap go.uber.org/zap/buffer @@ -596,8 +583,8 @@ go.uber.org/zap/internal/exit go.uber.org/zap/internal/pool go.uber.org/zap/internal/stacktrace go.uber.org/zap/zapcore -# golang.org/x/crypto v0.44.0 -## explicit; go 1.24.0 +# golang.org/x/crypto v0.34.0 +## explicit; go 1.23.0 golang.org/x/crypto/blowfish golang.org/x/crypto/chacha20 golang.org/x/crypto/chacha20poly1305 @@ -616,8 +603,8 @@ golang.org/x/exp/slices golang.org/x/exp/slog golang.org/x/exp/slog/internal golang.org/x/exp/slog/internal/buffer -# golang.org/x/net v0.47.0 -## explicit; go 1.24.0 +# golang.org/x/net v0.35.0 +## explicit; go 1.18 golang.org/x/net/context/ctxhttp golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -626,18 +613,18 @@ golang.org/x/net/idna golang.org/x/net/internal/httpcommon golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/oauth2 v0.32.0 -## explicit; go 1.24.0 +# golang.org/x/oauth2 v0.29.0 +## explicit; go 1.23.0 golang.org/x/oauth2 golang.org/x/oauth2/clientcredentials golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.18.0 -## explicit; go 1.24.0 +# golang.org/x/sync v0.13.0 +## explicit; go 1.23.0 golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.39.0 +# golang.org/x/sys v0.38.0 ## explicit; go 1.24.0 golang.org/x/sys/cpu golang.org/x/sys/plan9 @@ -648,11 +635,11 @@ golang.org/x/sys/windows/svc golang.org/x/sys/windows/svc/debug golang.org/x/sys/windows/svc/eventlog golang.org/x/sys/windows/svc/mgr -# golang.org/x/term v0.37.0 -## explicit; go 1.24.0 +# golang.org/x/term v0.33.0 +## explicit; go 1.23.0 golang.org/x/term -# golang.org/x/text v0.31.0 -## explicit; go 1.24.0 +# golang.org/x/text v0.24.0 +## explicit; go 1.23.0 golang.org/x/text/cases golang.org/x/text/encoding golang.org/x/text/encoding/internal @@ -672,15 +659,15 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.8.0 ## explicit; go 1.18 golang.org/x/time/rate -# google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 -## explicit; go 1.24.0 +# google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a +## explicit; go 1.22 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 -## explicit; go 1.24.0 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 +## explicit; go 1.23.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.78.0 -## explicit; go 1.24.0 +# google.golang.org/grpc v1.71.1 +## explicit; go 1.22.0 google.golang.org/grpc google.golang.org/grpc/attributes google.golang.org/grpc/backoff @@ -690,6 +677,7 @@ google.golang.org/grpc/balancer/endpointsharding google.golang.org/grpc/balancer/grpclb/state google.golang.org/grpc/balancer/pickfirst google.golang.org/grpc/balancer/pickfirst/internal +google.golang.org/grpc/balancer/pickfirst/pickfirstleaf google.golang.org/grpc/balancer/roundrobin google.golang.org/grpc/binarylog/grpc_binarylog_v1 google.golang.org/grpc/channelz @@ -699,7 +687,6 @@ google.golang.org/grpc/credentials google.golang.org/grpc/credentials/insecure google.golang.org/grpc/encoding google.golang.org/grpc/encoding/gzip -google.golang.org/grpc/encoding/internal google.golang.org/grpc/encoding/proto google.golang.org/grpc/experimental/stats google.golang.org/grpc/grpclog @@ -743,8 +730,8 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -# google.golang.org/protobuf v1.36.10 -## explicit; go 1.23 +# google.golang.org/protobuf v1.36.6 +## explicit; go 1.22 google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire From 68fa0b92f4dbbd861d5afbbaa003af210ba8394b Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Tue, 27 Jan 2026 18:49:07 +0530 Subject: [PATCH 07/22] upgrade baton-sdk --- go.mod | 2 +- go.sum | 4 +- pkg/connector/repository.go | 10 +- pkg/connector/team.go | 17 +- .../v2/annotation_security_insight.pb.go | 495 +++++++++++++-- ...annotation_security_insight.pb.validate.go | 564 +++++++++++++++++- ...otation_security_insight_protoopaque.pb.go | 484 +++++++++++++-- .../pb/c1/connector/v2/connector.pb.go | 60 +- .../connector/v2/connector_protoopaque.pb.go | 60 +- .../pb/c1/connector/v2/entitlement.pb.go | 10 +- .../v2/entitlement_protoopaque.pb.go | 10 +- .../pb/c1/connector/v2/resource.pb.go | 20 +- .../connector/v2/resource_protoopaque.pb.go | 20 +- .../pb/c1/connectorapi/baton/v1/baton.pb.go | 22 +- .../baton/v1/baton_protoopaque.pb.go | 22 +- .../baton-sdk/pkg/actions/actions.go | 120 +++- .../baton-sdk/pkg/cli/commands.go | 2 + .../baton-sdk/pkg/cli/lambda_server__added.go | 18 +- .../pkg/connectorbuilder/accounts.go | 43 +- .../pkg/connectorbuilder/connectorbuilder.go | 14 +- .../baton-sdk/pkg/connectorrunner/runner.go | 18 +- .../baton-sdk/pkg/dotc1z/c1file.go | 71 ++- .../baton-sdk/pkg/dotc1z/c1file_attached.go | 227 +------ .../baton-sdk/pkg/dotc1z/grants.go | 23 - .../baton-sdk/pkg/dotc1z/sync_runs.go | 39 +- .../baton-sdk/pkg/field/defaults.go | 7 + .../baton-sdk/pkg/provisioner/provisioner.go | 29 +- .../conductorone/baton-sdk/pkg/sdk/version.go | 2 +- .../conductorone/baton-sdk/pkg/sync/syncer.go | 117 +++- .../pkg/synccompactor/attached/attached.go | 68 +-- .../baton-sdk/pkg/synccompactor/compactor.go | 299 +++++----- .../pkg/tasks/c1api/create_account.go | 1 + .../baton-sdk/pkg/tasks/local/accounter.go | 26 +- .../pkg/types/entitlement/entitlement.go | 23 + .../types/resource/security_insight_trait.go | 236 ++++---- vendor/modules.txt | 3 +- 36 files changed, 2347 insertions(+), 839 deletions(-) diff --git a/go.mod b/go.mod index 34ae51f5..ee1d2d76 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/conductorone/baton-github go 1.25.2 require ( - github.com/conductorone/baton-sdk v0.6.9 + github.com/conductorone/baton-sdk v0.6.24 github.com/deckarep/golang-set/v2 v2.8.0 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/golang-jwt/jwt/v5 v5.2.2 diff --git a/go.sum b/go.sum index 65631f28..6aa1b6e0 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/conductorone/baton-sdk v0.6.9 h1:HckTc+QeoL/K4FAOrvrsTIDb65898ft/m2YIty/YBgk= -github.com/conductorone/baton-sdk v0.6.9/go.mod h1:9S5feBOuIJxlNdGmkv3ObkCNHbVyOHr6foNrIrk+d4Y= +github.com/conductorone/baton-sdk v0.6.24 h1:0Uc0+EyJZx36a6XEoLurqsW2z/2yJVtMYxvMOn1CEf4= +github.com/conductorone/baton-sdk v0.6.24/go.mod h1:9S5feBOuIJxlNdGmkv3ObkCNHbVyOHr6foNrIrk+d4Y= github.com/conductorone/dpop v0.2.3 h1:s91U3845GHQ6P6FWrdNr2SEOy1ES/jcFs1JtKSl2S+o= github.com/conductorone/dpop v0.2.3/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s= github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 h1:kLMCNIh0Mo2vbvvkCmJ3ixsPbXEJ6HPcW53Ku9yje3s= diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index 1e7cdb97..88d4ae64 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -470,8 +470,14 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont Name: "parent", DisplayName: "Parent Organization", Description: "The organization to create the repository in", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, + Field: &config.Field_ResourceIdField{ + ResourceIdField: &config.ResourceIdField{ + Rules: &config.ResourceIDRules{ + AllowedResourceTypeIds: []string{resourceTypeOrg.Id}, + }, + }, + }, + IsRequired: true, }, { Name: "description", diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 6fc420d2..92512e76 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -398,7 +398,13 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr Name: "parent", DisplayName: "Parent Organization", Description: "The organization to create the team in", - Field: &config.Field_ResourceIdField{}, + Field: &config.Field_ResourceIdField{ + ResourceIdField: &config.ResourceIdField{ + Rules: &config.ResourceIDRules{ + AllowedResourceTypeIds: []string{resourceTypeOrg.Id}, + }, + }, + }, IsRequired: true, }, { @@ -411,7 +417,14 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr Name: "privacy", DisplayName: "Privacy", Description: "The privacy level: 'secret' or 'closed'", - Field: &config.Field_StringField{}, + Field: &config.Field_StringField{ + StringField: &config.StringField{ + Options: []*config.StringFieldOption{ + {Value: "secret", DisplayName: "Secret (only visible to org owners and team members)"}, + {Value: "closed", DisplayName: "Closed (visible to all org members)"}, + }, + }, + }, }, { Name: "notification_setting", diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.go index 9da76c41..354f27af 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.go @@ -24,15 +24,152 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// RiskScore represents a risk score insight +type RiskScore struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The risk score value (e.g., "85", "High") + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RiskScore) Reset() { + *x = RiskScore{} + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RiskScore) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RiskScore) ProtoMessage() {} + +func (x *RiskScore) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RiskScore) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *RiskScore) SetValue(v string) { + x.Value = v +} + +type RiskScore_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The risk score value (e.g., "85", "High") + Value string +} + +func (b0 RiskScore_builder) Build() *RiskScore { + m0 := &RiskScore{} + b, x := &b0, m0 + _, _ = b, x + x.Value = b.Value + return m0 +} + +// Issue represents a security issue or vulnerability +type Issue struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // The issue description or severity (e.g., "Critical", "CVE-2024-1234") + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Severity string `protobuf:"bytes,2,opt,name=severity,proto3" json:"severity,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Issue) Reset() { + *x = Issue{} + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Issue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Issue) ProtoMessage() {} + +func (x *Issue) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Issue) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *Issue) GetSeverity() string { + if x != nil { + return x.Severity + } + return "" +} + +func (x *Issue) SetValue(v string) { + x.Value = v +} + +func (x *Issue) SetSeverity(v string) { + x.Severity = v +} + +type Issue_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The issue description or severity (e.g., "Critical", "CVE-2024-1234") + Value string + Severity string +} + +func (b0 Issue_builder) Build() *Issue { + m0 := &Issue{} + b, x := &b0, m0 + _, _ = b, x + x.Value = b.Value + x.Severity = b.Severity + return m0 +} + // SecurityInsightTrait is the trait annotation for resources with TRAIT_SECURITY_INSIGHT. // It contains the metadata for the security insight including type, value, observation time, // and the target entity (user or resource) that this insight should be bound to. type SecurityInsightTrait struct { state protoimpl.MessageState `protogen:"hybrid.v1"` - // The type of insight (e.g., "crowdstrike_zta_score", "wiz_critical_vulnerability") - InsightType string `protobuf:"bytes,1,opt,name=insight_type,json=insightType,proto3" json:"insight_type,omitempty"` - // The value of the insight (e.g., "85", "High", "Critical") - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + // The type and value of the insight + // + // Types that are valid to be assigned to InsightType: + // + // *SecurityInsightTrait_RiskScore + // *SecurityInsightTrait_Issue + InsightType isSecurityInsightTrait_InsightType `protobuf_oneof:"insight_type"` // When this insight was observed/captured from the source system ObservedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=observed_at,json=observedAt,proto3" json:"observed_at,omitempty"` // The target entity this insight should be bound to @@ -42,6 +179,7 @@ type SecurityInsightTrait struct { // *SecurityInsightTrait_User // *SecurityInsightTrait_ResourceId // *SecurityInsightTrait_ExternalResource + // *SecurityInsightTrait_AppUser Target isSecurityInsightTrait_Target `protobuf_oneof:"target"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -49,7 +187,7 @@ type SecurityInsightTrait struct { func (x *SecurityInsightTrait) Reset() { *x = SecurityInsightTrait{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -61,7 +199,7 @@ func (x *SecurityInsightTrait) String() string { func (*SecurityInsightTrait) ProtoMessage() {} func (x *SecurityInsightTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -72,18 +210,29 @@ func (x *SecurityInsightTrait) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -func (x *SecurityInsightTrait) GetInsightType() string { +func (x *SecurityInsightTrait) GetInsightType() isSecurityInsightTrait_InsightType { if x != nil { return x.InsightType } - return "" + return nil } -func (x *SecurityInsightTrait) GetValue() string { +func (x *SecurityInsightTrait) GetRiskScore() *RiskScore { if x != nil { - return x.Value + if x, ok := x.InsightType.(*SecurityInsightTrait_RiskScore); ok { + return x.RiskScore + } } - return "" + return nil +} + +func (x *SecurityInsightTrait) GetIssue() *Issue { + if x != nil { + if x, ok := x.InsightType.(*SecurityInsightTrait_Issue); ok { + return x.Issue + } + } + return nil } func (x *SecurityInsightTrait) GetObservedAt() *timestamppb.Timestamp { @@ -127,12 +276,29 @@ func (x *SecurityInsightTrait) GetExternalResource() *SecurityInsightTrait_Exter return nil } -func (x *SecurityInsightTrait) SetInsightType(v string) { - x.InsightType = v +func (x *SecurityInsightTrait) GetAppUser() *SecurityInsightTrait_AppUserTarget { + if x != nil { + if x, ok := x.Target.(*SecurityInsightTrait_AppUser); ok { + return x.AppUser + } + } + return nil } -func (x *SecurityInsightTrait) SetValue(v string) { - x.Value = v +func (x *SecurityInsightTrait) SetRiskScore(v *RiskScore) { + if v == nil { + x.InsightType = nil + return + } + x.InsightType = &SecurityInsightTrait_RiskScore{v} +} + +func (x *SecurityInsightTrait) SetIssue(v *Issue) { + if v == nil { + x.InsightType = nil + return + } + x.InsightType = &SecurityInsightTrait_Issue{v} } func (x *SecurityInsightTrait) SetObservedAt(v *timestamppb.Timestamp) { @@ -163,6 +329,37 @@ func (x *SecurityInsightTrait) SetExternalResource(v *SecurityInsightTrait_Exter x.Target = &SecurityInsightTrait_ExternalResource{v} } +func (x *SecurityInsightTrait) SetAppUser(v *SecurityInsightTrait_AppUserTarget) { + if v == nil { + x.Target = nil + return + } + x.Target = &SecurityInsightTrait_AppUser{v} +} + +func (x *SecurityInsightTrait) HasInsightType() bool { + if x == nil { + return false + } + return x.InsightType != nil +} + +func (x *SecurityInsightTrait) HasRiskScore() bool { + if x == nil { + return false + } + _, ok := x.InsightType.(*SecurityInsightTrait_RiskScore) + return ok +} + +func (x *SecurityInsightTrait) HasIssue() bool { + if x == nil { + return false + } + _, ok := x.InsightType.(*SecurityInsightTrait_Issue) + return ok +} + func (x *SecurityInsightTrait) HasObservedAt() bool { if x == nil { return false @@ -201,6 +398,30 @@ func (x *SecurityInsightTrait) HasExternalResource() bool { return ok } +func (x *SecurityInsightTrait) HasAppUser() bool { + if x == nil { + return false + } + _, ok := x.Target.(*SecurityInsightTrait_AppUser) + return ok +} + +func (x *SecurityInsightTrait) ClearInsightType() { + x.InsightType = nil +} + +func (x *SecurityInsightTrait) ClearRiskScore() { + if _, ok := x.InsightType.(*SecurityInsightTrait_RiskScore); ok { + x.InsightType = nil + } +} + +func (x *SecurityInsightTrait) ClearIssue() { + if _, ok := x.InsightType.(*SecurityInsightTrait_Issue); ok { + x.InsightType = nil + } +} + func (x *SecurityInsightTrait) ClearObservedAt() { x.ObservedAt = nil } @@ -227,10 +448,35 @@ func (x *SecurityInsightTrait) ClearExternalResource() { } } +func (x *SecurityInsightTrait) ClearAppUser() { + if _, ok := x.Target.(*SecurityInsightTrait_AppUser); ok { + x.Target = nil + } +} + +const SecurityInsightTrait_InsightType_not_set_case case_SecurityInsightTrait_InsightType = 0 +const SecurityInsightTrait_RiskScore_case case_SecurityInsightTrait_InsightType = 1 +const SecurityInsightTrait_Issue_case case_SecurityInsightTrait_InsightType = 2 + +func (x *SecurityInsightTrait) WhichInsightType() case_SecurityInsightTrait_InsightType { + if x == nil { + return SecurityInsightTrait_InsightType_not_set_case + } + switch x.InsightType.(type) { + case *SecurityInsightTrait_RiskScore: + return SecurityInsightTrait_RiskScore_case + case *SecurityInsightTrait_Issue: + return SecurityInsightTrait_Issue_case + default: + return SecurityInsightTrait_InsightType_not_set_case + } +} + const SecurityInsightTrait_Target_not_set_case case_SecurityInsightTrait_Target = 0 const SecurityInsightTrait_User_case case_SecurityInsightTrait_Target = 4 const SecurityInsightTrait_ResourceId_case case_SecurityInsightTrait_Target = 5 const SecurityInsightTrait_ExternalResource_case case_SecurityInsightTrait_Target = 6 +const SecurityInsightTrait_AppUser_case case_SecurityInsightTrait_Target = 7 func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { if x == nil { @@ -243,6 +489,8 @@ func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { return SecurityInsightTrait_ResourceId_case case *SecurityInsightTrait_ExternalResource: return SecurityInsightTrait_ExternalResource_case + case *SecurityInsightTrait_AppUser: + return SecurityInsightTrait_AppUser_case default: return SecurityInsightTrait_Target_not_set_case } @@ -251,10 +499,12 @@ func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { type SecurityInsightTrait_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - // The type of insight (e.g., "crowdstrike_zta_score", "wiz_critical_vulnerability") - InsightType string - // The value of the insight (e.g., "85", "High", "Critical") - Value string + // The type and value of the insight + + // Fields of oneof InsightType: + RiskScore *RiskScore + Issue *Issue + // -- end of InsightType // When this insight was observed/captured from the source system ObservedAt *timestamppb.Timestamp // The target entity this insight should be bound to @@ -266,6 +516,8 @@ type SecurityInsightTrait_builder struct { ResourceId *ResourceId // For binding to an AppResource by external ID ExternalResource *SecurityInsightTrait_ExternalResourceTarget + // For binding to an AppUser by email address + AppUser *SecurityInsightTrait_AppUserTarget // -- end of Target } @@ -273,8 +525,12 @@ func (b0 SecurityInsightTrait_builder) Build() *SecurityInsightTrait { m0 := &SecurityInsightTrait{} b, x := &b0, m0 _, _ = b, x - x.InsightType = b.InsightType - x.Value = b.Value + if b.RiskScore != nil { + x.InsightType = &SecurityInsightTrait_RiskScore{b.RiskScore} + } + if b.Issue != nil { + x.InsightType = &SecurityInsightTrait_Issue{b.Issue} + } x.ObservedAt = b.ObservedAt if b.User != nil { x.Target = &SecurityInsightTrait_User{b.User} @@ -285,19 +541,48 @@ func (b0 SecurityInsightTrait_builder) Build() *SecurityInsightTrait { if b.ExternalResource != nil { x.Target = &SecurityInsightTrait_ExternalResource{b.ExternalResource} } + if b.AppUser != nil { + x.Target = &SecurityInsightTrait_AppUser{b.AppUser} + } return m0 } +type case_SecurityInsightTrait_InsightType protoreflect.FieldNumber + +func (x case_SecurityInsightTrait_InsightType) String() string { + md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + type case_SecurityInsightTrait_Target protoreflect.FieldNumber func (x case_SecurityInsightTrait_Target) String() string { - md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0].Descriptor() + md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].Descriptor() if x == 0 { return "not set" } return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) } +type isSecurityInsightTrait_InsightType interface { + isSecurityInsightTrait_InsightType() +} + +type SecurityInsightTrait_RiskScore struct { + RiskScore *RiskScore `protobuf:"bytes,1,opt,name=risk_score,json=riskScore,proto3,oneof"` +} + +type SecurityInsightTrait_Issue struct { + Issue *Issue `protobuf:"bytes,2,opt,name=issue,proto3,oneof"` +} + +func (*SecurityInsightTrait_RiskScore) isSecurityInsightTrait_InsightType() {} + +func (*SecurityInsightTrait_Issue) isSecurityInsightTrait_InsightType() {} + type isSecurityInsightTrait_Target interface { isSecurityInsightTrait_Target() } @@ -317,12 +602,19 @@ type SecurityInsightTrait_ExternalResource struct { ExternalResource *SecurityInsightTrait_ExternalResourceTarget `protobuf:"bytes,6,opt,name=external_resource,json=externalResource,proto3,oneof"` } +type SecurityInsightTrait_AppUser struct { + // For binding to an AppUser by email address + AppUser *SecurityInsightTrait_AppUserTarget `protobuf:"bytes,7,opt,name=app_user,json=appUser,proto3,oneof"` +} + func (*SecurityInsightTrait_User) isSecurityInsightTrait_Target() {} func (*SecurityInsightTrait_ResourceId) isSecurityInsightTrait_Target() {} func (*SecurityInsightTrait_ExternalResource) isSecurityInsightTrait_Target() {} +func (*SecurityInsightTrait_AppUser) isSecurityInsightTrait_Target() {} + // UserTarget identifies a user by email for resolution to a C1 User type SecurityInsightTrait_UserTarget struct { state protoimpl.MessageState `protogen:"hybrid.v1"` @@ -333,7 +625,7 @@ type SecurityInsightTrait_UserTarget struct { func (x *SecurityInsightTrait_UserTarget) Reset() { *x = SecurityInsightTrait_UserTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -345,7 +637,7 @@ func (x *SecurityInsightTrait_UserTarget) String() string { func (*SecurityInsightTrait_UserTarget) ProtoMessage() {} func (x *SecurityInsightTrait_UserTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -381,6 +673,80 @@ func (b0 SecurityInsightTrait_UserTarget_builder) Build() *SecurityInsightTrait_ return m0 } +// AppUserTarget identifies a user by email for resolution to an AppUser. +type SecurityInsightTrait_AppUserTarget struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + // The external identifier of the user (e.g., ID, GUID, etc.) + ExternalId string `protobuf:"bytes,2,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SecurityInsightTrait_AppUserTarget) Reset() { + *x = SecurityInsightTrait_AppUserTarget{} + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SecurityInsightTrait_AppUserTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityInsightTrait_AppUserTarget) ProtoMessage() {} + +func (x *SecurityInsightTrait_AppUserTarget) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SecurityInsightTrait_AppUserTarget) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *SecurityInsightTrait_AppUserTarget) GetExternalId() string { + if x != nil { + return x.ExternalId + } + return "" +} + +func (x *SecurityInsightTrait_AppUserTarget) SetEmail(v string) { + x.Email = v +} + +func (x *SecurityInsightTrait_AppUserTarget) SetExternalId(v string) { + x.ExternalId = v +} + +type SecurityInsightTrait_AppUserTarget_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Email string + // The external identifier of the user (e.g., ID, GUID, etc.) + ExternalId string +} + +func (b0 SecurityInsightTrait_AppUserTarget_builder) Build() *SecurityInsightTrait_AppUserTarget { + m0 := &SecurityInsightTrait_AppUserTarget{} + b, x := &b0, m0 + _, _ = b, x + x.Email = b.Email + x.ExternalId = b.ExternalId + return m0 +} + // ExternalResourceTarget identifies a resource by external ID for resolution to an AppResource. // Use this when the connector doesn't sync the target resource itself. type SecurityInsightTrait_ExternalResourceTarget struct { @@ -395,7 +761,7 @@ type SecurityInsightTrait_ExternalResourceTarget struct { func (x *SecurityInsightTrait_ExternalResourceTarget) Reset() { *x = SecurityInsightTrait_ExternalResourceTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -407,7 +773,7 @@ func (x *SecurityInsightTrait_ExternalResourceTarget) String() string { func (*SecurityInsightTrait_ExternalResourceTarget) ProtoMessage() {} func (x *SecurityInsightTrait_ExternalResourceTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -462,46 +828,64 @@ var File_c1_connector_v2_annotation_security_insight_proto protoreflect.FileDesc const file_c1_connector_v2_annotation_security_insight_proto_rawDesc = "" + "\n" + - "1c1/connector/v2/annotation_security_insight.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"\xc9\x04\n" + - "\x14SecurityInsightTrait\x12-\n" + - "\finsight_type\x18\x01 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80\bR\vinsightType\x12 \n" + - "\x05value\x18\x02 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80\bR\x05value\x12;\n" + + "1c1/connector/v2/annotation_security_insight.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"!\n" + + "\tRiskScore\x12\x14\n" + + "\x05value\x18\x01 \x01(\tR\x05value\"E\n" + + "\x05Issue\x12\x14\n" + + "\x05value\x18\x01 \x01(\tR\x05value\x12&\n" + + "\bseverity\x18\x02 \x01(\tB\n" + + "\xfaB\ar\x05 \x00(\x80\bR\bseverity\"\xae\x06\n" + + "\x14SecurityInsightTrait\x12;\n" + + "\n" + + "risk_score\x18\x01 \x01(\v2\x1a.c1.connector.v2.RiskScoreH\x00R\triskScore\x12.\n" + + "\x05issue\x18\x02 \x01(\v2\x16.c1.connector.v2.IssueH\x00R\x05issue\x12;\n" + "\vobserved_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\n" + "observedAt\x12F\n" + - "\x04user\x18\x04 \x01(\v20.c1.connector.v2.SecurityInsightTrait.UserTargetH\x00R\x04user\x12>\n" + - "\vresource_id\x18\x05 \x01(\v2\x1b.c1.connector.v2.ResourceIdH\x00R\n" + + "\x04user\x18\x04 \x01(\v20.c1.connector.v2.SecurityInsightTrait.UserTargetH\x01R\x04user\x12>\n" + + "\vresource_id\x18\x05 \x01(\v2\x1b.c1.connector.v2.ResourceIdH\x01R\n" + "resourceId\x12k\n" + - "\x11external_resource\x18\x06 \x01(\v2<.c1.connector.v2.SecurityInsightTrait.ExternalResourceTargetH\x00R\x10externalResource\x1a0\n" + + "\x11external_resource\x18\x06 \x01(\v2<.c1.connector.v2.SecurityInsightTrait.ExternalResourceTargetH\x01R\x10externalResource\x12P\n" + + "\bapp_user\x18\a \x01(\v23.c1.connector.v2.SecurityInsightTrait.AppUserTargetH\x01R\aappUser\x1a0\n" + "\n" + "UserTarget\x12\"\n" + - "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x1am\n" + + "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x1a`\n" + + "\rAppUserTarget\x12\"\n" + + "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x12+\n" + + "\vexternal_id\x18\x02 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80 R\n" + + "externalId\x1am\n" + "\x16ExternalResourceTarget\x12+\n" + "\vexternal_id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80 R\n" + "externalId\x12&\n" + - "\bapp_hint\x18\x02 \x01(\tB\v\xfaB\br\x06(\x80\b\xd0\x01\x01R\aappHintB\r\n" + + "\bapp_hint\x18\x02 \x01(\tB\v\xfaB\br\x06(\x80\b\xd0\x01\x01R\aappHintB\x13\n" + + "\finsight_type\x12\x03\xf8B\x01B\r\n" + "\x06target\x12\x03\xf8B\x01B6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" -var file_c1_connector_v2_annotation_security_insight_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_c1_connector_v2_annotation_security_insight_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_c1_connector_v2_annotation_security_insight_proto_goTypes = []any{ - (*SecurityInsightTrait)(nil), // 0: c1.connector.v2.SecurityInsightTrait - (*SecurityInsightTrait_UserTarget)(nil), // 1: c1.connector.v2.SecurityInsightTrait.UserTarget - (*SecurityInsightTrait_ExternalResourceTarget)(nil), // 2: c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget - (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp - (*ResourceId)(nil), // 4: c1.connector.v2.ResourceId + (*RiskScore)(nil), // 0: c1.connector.v2.RiskScore + (*Issue)(nil), // 1: c1.connector.v2.Issue + (*SecurityInsightTrait)(nil), // 2: c1.connector.v2.SecurityInsightTrait + (*SecurityInsightTrait_UserTarget)(nil), // 3: c1.connector.v2.SecurityInsightTrait.UserTarget + (*SecurityInsightTrait_AppUserTarget)(nil), // 4: c1.connector.v2.SecurityInsightTrait.AppUserTarget + (*SecurityInsightTrait_ExternalResourceTarget)(nil), // 5: c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*ResourceId)(nil), // 7: c1.connector.v2.ResourceId } var file_c1_connector_v2_annotation_security_insight_proto_depIdxs = []int32{ - 3, // 0: c1.connector.v2.SecurityInsightTrait.observed_at:type_name -> google.protobuf.Timestamp - 1, // 1: c1.connector.v2.SecurityInsightTrait.user:type_name -> c1.connector.v2.SecurityInsightTrait.UserTarget - 4, // 2: c1.connector.v2.SecurityInsightTrait.resource_id:type_name -> c1.connector.v2.ResourceId - 2, // 3: c1.connector.v2.SecurityInsightTrait.external_resource:type_name -> c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 0, // 0: c1.connector.v2.SecurityInsightTrait.risk_score:type_name -> c1.connector.v2.RiskScore + 1, // 1: c1.connector.v2.SecurityInsightTrait.issue:type_name -> c1.connector.v2.Issue + 6, // 2: c1.connector.v2.SecurityInsightTrait.observed_at:type_name -> google.protobuf.Timestamp + 3, // 3: c1.connector.v2.SecurityInsightTrait.user:type_name -> c1.connector.v2.SecurityInsightTrait.UserTarget + 7, // 4: c1.connector.v2.SecurityInsightTrait.resource_id:type_name -> c1.connector.v2.ResourceId + 5, // 5: c1.connector.v2.SecurityInsightTrait.external_resource:type_name -> c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget + 4, // 6: c1.connector.v2.SecurityInsightTrait.app_user:type_name -> c1.connector.v2.SecurityInsightTrait.AppUserTarget + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_c1_connector_v2_annotation_security_insight_proto_init() } @@ -510,10 +894,13 @@ func file_c1_connector_v2_annotation_security_insight_proto_init() { return } file_c1_connector_v2_resource_proto_init() - file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0].OneofWrappers = []any{ + file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].OneofWrappers = []any{ + (*SecurityInsightTrait_RiskScore)(nil), + (*SecurityInsightTrait_Issue)(nil), (*SecurityInsightTrait_User)(nil), (*SecurityInsightTrait_ResourceId)(nil), (*SecurityInsightTrait_ExternalResource)(nil), + (*SecurityInsightTrait_AppUser)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -521,7 +908,7 @@ func file_c1_connector_v2_annotation_security_insight_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_security_insight_proto_rawDesc), len(file_c1_connector_v2_annotation_security_insight_proto_rawDesc)), NumEnums: 0, - NumMessages: 3, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.validate.go index b550d79e..6b83aee6 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight.pb.validate.go @@ -35,6 +35,218 @@ var ( _ = sort.Sort ) +// Validate checks the field values on RiskScore with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *RiskScore) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RiskScore with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RiskScoreMultiError, or nil +// if none found. +func (m *RiskScore) ValidateAll() error { + return m.validate(true) +} + +func (m *RiskScore) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Value + + if len(errors) > 0 { + return RiskScoreMultiError(errors) + } + + return nil +} + +// RiskScoreMultiError is an error wrapping multiple validation errors returned +// by RiskScore.ValidateAll() if the designated constraints aren't met. +type RiskScoreMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RiskScoreMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RiskScoreMultiError) AllErrors() []error { return m } + +// RiskScoreValidationError is the validation error returned by +// RiskScore.Validate if the designated constraints aren't met. +type RiskScoreValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RiskScoreValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RiskScoreValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RiskScoreValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RiskScoreValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RiskScoreValidationError) ErrorName() string { return "RiskScoreValidationError" } + +// Error satisfies the builtin error interface +func (e RiskScoreValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRiskScore.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RiskScoreValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RiskScoreValidationError{} + +// Validate checks the field values on Issue with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Issue) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Issue with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in IssueMultiError, or nil if none found. +func (m *Issue) ValidateAll() error { + return m.validate(true) +} + +func (m *Issue) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Value + + if l := len(m.GetSeverity()); l < 0 || l > 1024 { + err := IssueValidationError{ + field: "Severity", + reason: "value length must be between 0 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return IssueMultiError(errors) + } + + return nil +} + +// IssueMultiError is an error wrapping multiple validation errors returned by +// Issue.ValidateAll() if the designated constraints aren't met. +type IssueMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m IssueMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m IssueMultiError) AllErrors() []error { return m } + +// IssueValidationError is the validation error returned by Issue.Validate if +// the designated constraints aren't met. +type IssueValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e IssueValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e IssueValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e IssueValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e IssueValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e IssueValidationError) ErrorName() string { return "IssueValidationError" } + +// Error satisfies the builtin error interface +func (e IssueValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sIssue.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = IssueValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = IssueValidationError{} + // Validate checks the field values on SecurityInsightTrait with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. @@ -57,28 +269,6 @@ func (m *SecurityInsightTrait) validate(all bool) error { var errors []error - if l := len(m.GetInsightType()); l < 1 || l > 1024 { - err := SecurityInsightTraitValidationError{ - field: "InsightType", - reason: "value length must be between 1 and 1024 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if l := len(m.GetValue()); l < 1 || l > 1024 { - err := SecurityInsightTraitValidationError{ - field: "Value", - reason: "value length must be between 1 and 1024 bytes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - if all { switch v := interface{}(m.GetObservedAt()).(type) { case interface{ ValidateAll() error }: @@ -108,6 +298,105 @@ func (m *SecurityInsightTrait) validate(all bool) error { } } + oneofInsightTypePresent := false + switch v := m.InsightType.(type) { + case *SecurityInsightTrait_RiskScore: + if v == nil { + err := SecurityInsightTraitValidationError{ + field: "InsightType", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofInsightTypePresent = true + + if all { + switch v := interface{}(m.GetRiskScore()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SecurityInsightTraitValidationError{ + field: "RiskScore", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SecurityInsightTraitValidationError{ + field: "RiskScore", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRiskScore()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SecurityInsightTraitValidationError{ + field: "RiskScore", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *SecurityInsightTrait_Issue: + if v == nil { + err := SecurityInsightTraitValidationError{ + field: "InsightType", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofInsightTypePresent = true + + if all { + switch v := interface{}(m.GetIssue()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SecurityInsightTraitValidationError{ + field: "Issue", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SecurityInsightTraitValidationError{ + field: "Issue", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetIssue()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SecurityInsightTraitValidationError{ + field: "Issue", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + if !oneofInsightTypePresent { + err := SecurityInsightTraitValidationError{ + field: "InsightType", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } oneofTargetPresent := false switch v := m.Target.(type) { case *SecurityInsightTrait_User: @@ -236,6 +525,48 @@ func (m *SecurityInsightTrait) validate(all bool) error { } } + case *SecurityInsightTrait_AppUser: + if v == nil { + err := SecurityInsightTraitValidationError{ + field: "Target", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofTargetPresent = true + + if all { + switch v := interface{}(m.GetAppUser()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SecurityInsightTraitValidationError{ + field: "AppUser", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SecurityInsightTraitValidationError{ + field: "AppUser", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAppUser()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SecurityInsightTraitValidationError{ + field: "AppUser", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -506,6 +837,195 @@ var _ interface { ErrorName() string } = SecurityInsightTrait_UserTargetValidationError{} +// Validate checks the field values on SecurityInsightTrait_AppUserTarget with +// the rules defined in the proto definition for this message. If any rules +// are violated, the first error encountered is returned, or nil if there are +// no violations. +func (m *SecurityInsightTrait_AppUserTarget) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SecurityInsightTrait_AppUserTarget +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// SecurityInsightTrait_AppUserTargetMultiError, or nil if none found. +func (m *SecurityInsightTrait_AppUserTarget) ValidateAll() error { + return m.validate(true) +} + +func (m *SecurityInsightTrait_AppUserTarget) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if l := len(m.GetEmail()); l < 1 || l > 1024 { + err := SecurityInsightTrait_AppUserTargetValidationError{ + field: "Email", + reason: "value length must be between 1 and 1024 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if err := m._validateEmail(m.GetEmail()); err != nil { + err = SecurityInsightTrait_AppUserTargetValidationError{ + field: "Email", + reason: "value must be a valid email address", + cause: err, + } + if !all { + return err + } + errors = append(errors, err) + } + + if l := len(m.GetExternalId()); l < 1 || l > 4096 { + err := SecurityInsightTrait_AppUserTargetValidationError{ + field: "ExternalId", + reason: "value length must be between 1 and 4096 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return SecurityInsightTrait_AppUserTargetMultiError(errors) + } + + return nil +} + +func (m *SecurityInsightTrait_AppUserTarget) _validateHostname(host string) error { + s := strings.ToLower(strings.TrimSuffix(host, ".")) + + if len(host) > 253 { + return errors.New("hostname cannot exceed 253 characters") + } + + for _, part := range strings.Split(s, ".") { + if l := len(part); l == 0 || l > 63 { + return errors.New("hostname part must be non-empty and cannot exceed 63 characters") + } + + if part[0] == '-' { + return errors.New("hostname parts cannot begin with hyphens") + } + + if part[len(part)-1] == '-' { + return errors.New("hostname parts cannot end with hyphens") + } + + for _, r := range part { + if (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '-' { + return fmt.Errorf("hostname parts can only contain alphanumeric characters or hyphens, got %q", string(r)) + } + } + } + + return nil +} + +func (m *SecurityInsightTrait_AppUserTarget) _validateEmail(addr string) error { + a, err := mail.ParseAddress(addr) + if err != nil { + return err + } + addr = a.Address + + if len(addr) > 254 { + return errors.New("email addresses cannot exceed 254 characters") + } + + parts := strings.SplitN(addr, "@", 2) + + if len(parts[0]) > 64 { + return errors.New("email address local phrase cannot exceed 64 characters") + } + + return m._validateHostname(parts[1]) +} + +// SecurityInsightTrait_AppUserTargetMultiError is an error wrapping multiple +// validation errors returned by +// SecurityInsightTrait_AppUserTarget.ValidateAll() if the designated +// constraints aren't met. +type SecurityInsightTrait_AppUserTargetMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SecurityInsightTrait_AppUserTargetMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SecurityInsightTrait_AppUserTargetMultiError) AllErrors() []error { return m } + +// SecurityInsightTrait_AppUserTargetValidationError is the validation error +// returned by SecurityInsightTrait_AppUserTarget.Validate if the designated +// constraints aren't met. +type SecurityInsightTrait_AppUserTargetValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SecurityInsightTrait_AppUserTargetValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SecurityInsightTrait_AppUserTargetValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SecurityInsightTrait_AppUserTargetValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SecurityInsightTrait_AppUserTargetValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SecurityInsightTrait_AppUserTargetValidationError) ErrorName() string { + return "SecurityInsightTrait_AppUserTargetValidationError" +} + +// Error satisfies the builtin error interface +func (e SecurityInsightTrait_AppUserTargetValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSecurityInsightTrait_AppUserTarget.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SecurityInsightTrait_AppUserTargetValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SecurityInsightTrait_AppUserTargetValidationError{} + // Validate checks the field values on // SecurityInsightTrait_ExternalResourceTarget with the rules defined in the // proto definition for this message. If any rules are violated, the first diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight_protoopaque.pb.go index 184346c1..394575c8 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_security_insight_protoopaque.pb.go @@ -24,22 +24,153 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// RiskScore represents a risk score insight +type RiskScore struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Value string `protobuf:"bytes,1,opt,name=value,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RiskScore) Reset() { + *x = RiskScore{} + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RiskScore) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RiskScore) ProtoMessage() {} + +func (x *RiskScore) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RiskScore) GetValue() string { + if x != nil { + return x.xxx_hidden_Value + } + return "" +} + +func (x *RiskScore) SetValue(v string) { + x.xxx_hidden_Value = v +} + +type RiskScore_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The risk score value (e.g., "85", "High") + Value string +} + +func (b0 RiskScore_builder) Build() *RiskScore { + m0 := &RiskScore{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Value = b.Value + return m0 +} + +// Issue represents a security issue or vulnerability +type Issue struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Value string `protobuf:"bytes,1,opt,name=value,proto3"` + xxx_hidden_Severity string `protobuf:"bytes,2,opt,name=severity,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Issue) Reset() { + *x = Issue{} + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Issue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Issue) ProtoMessage() {} + +func (x *Issue) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Issue) GetValue() string { + if x != nil { + return x.xxx_hidden_Value + } + return "" +} + +func (x *Issue) GetSeverity() string { + if x != nil { + return x.xxx_hidden_Severity + } + return "" +} + +func (x *Issue) SetValue(v string) { + x.xxx_hidden_Value = v +} + +func (x *Issue) SetSeverity(v string) { + x.xxx_hidden_Severity = v +} + +type Issue_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The issue description or severity (e.g., "Critical", "CVE-2024-1234") + Value string + Severity string +} + +func (b0 Issue_builder) Build() *Issue { + m0 := &Issue{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Value = b.Value + x.xxx_hidden_Severity = b.Severity + return m0 +} + // SecurityInsightTrait is the trait annotation for resources with TRAIT_SECURITY_INSIGHT. // It contains the metadata for the security insight including type, value, observation time, // and the target entity (user or resource) that this insight should be bound to. type SecurityInsightTrait struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_InsightType string `protobuf:"bytes,1,opt,name=insight_type,json=insightType,proto3"` - xxx_hidden_Value string `protobuf:"bytes,2,opt,name=value,proto3"` - xxx_hidden_ObservedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=observed_at,json=observedAt,proto3"` - xxx_hidden_Target isSecurityInsightTrait_Target `protobuf_oneof:"target"` + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_InsightType isSecurityInsightTrait_InsightType `protobuf_oneof:"insight_type"` + xxx_hidden_ObservedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=observed_at,json=observedAt,proto3"` + xxx_hidden_Target isSecurityInsightTrait_Target `protobuf_oneof:"target"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SecurityInsightTrait) Reset() { *x = SecurityInsightTrait{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -51,7 +182,7 @@ func (x *SecurityInsightTrait) String() string { func (*SecurityInsightTrait) ProtoMessage() {} func (x *SecurityInsightTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,18 +193,22 @@ func (x *SecurityInsightTrait) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -func (x *SecurityInsightTrait) GetInsightType() string { +func (x *SecurityInsightTrait) GetRiskScore() *RiskScore { if x != nil { - return x.xxx_hidden_InsightType + if x, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_RiskScore); ok { + return x.RiskScore + } } - return "" + return nil } -func (x *SecurityInsightTrait) GetValue() string { +func (x *SecurityInsightTrait) GetIssue() *Issue { if x != nil { - return x.xxx_hidden_Value + if x, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_Issue); ok { + return x.Issue + } } - return "" + return nil } func (x *SecurityInsightTrait) GetObservedAt() *timestamppb.Timestamp { @@ -110,12 +245,29 @@ func (x *SecurityInsightTrait) GetExternalResource() *SecurityInsightTrait_Exter return nil } -func (x *SecurityInsightTrait) SetInsightType(v string) { - x.xxx_hidden_InsightType = v +func (x *SecurityInsightTrait) GetAppUser() *SecurityInsightTrait_AppUserTarget { + if x != nil { + if x, ok := x.xxx_hidden_Target.(*securityInsightTrait_AppUser); ok { + return x.AppUser + } + } + return nil } -func (x *SecurityInsightTrait) SetValue(v string) { - x.xxx_hidden_Value = v +func (x *SecurityInsightTrait) SetRiskScore(v *RiskScore) { + if v == nil { + x.xxx_hidden_InsightType = nil + return + } + x.xxx_hidden_InsightType = &securityInsightTrait_RiskScore{v} +} + +func (x *SecurityInsightTrait) SetIssue(v *Issue) { + if v == nil { + x.xxx_hidden_InsightType = nil + return + } + x.xxx_hidden_InsightType = &securityInsightTrait_Issue{v} } func (x *SecurityInsightTrait) SetObservedAt(v *timestamppb.Timestamp) { @@ -146,6 +298,37 @@ func (x *SecurityInsightTrait) SetExternalResource(v *SecurityInsightTrait_Exter x.xxx_hidden_Target = &securityInsightTrait_ExternalResource{v} } +func (x *SecurityInsightTrait) SetAppUser(v *SecurityInsightTrait_AppUserTarget) { + if v == nil { + x.xxx_hidden_Target = nil + return + } + x.xxx_hidden_Target = &securityInsightTrait_AppUser{v} +} + +func (x *SecurityInsightTrait) HasInsightType() bool { + if x == nil { + return false + } + return x.xxx_hidden_InsightType != nil +} + +func (x *SecurityInsightTrait) HasRiskScore() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_RiskScore) + return ok +} + +func (x *SecurityInsightTrait) HasIssue() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_Issue) + return ok +} + func (x *SecurityInsightTrait) HasObservedAt() bool { if x == nil { return false @@ -184,6 +367,30 @@ func (x *SecurityInsightTrait) HasExternalResource() bool { return ok } +func (x *SecurityInsightTrait) HasAppUser() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Target.(*securityInsightTrait_AppUser) + return ok +} + +func (x *SecurityInsightTrait) ClearInsightType() { + x.xxx_hidden_InsightType = nil +} + +func (x *SecurityInsightTrait) ClearRiskScore() { + if _, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_RiskScore); ok { + x.xxx_hidden_InsightType = nil + } +} + +func (x *SecurityInsightTrait) ClearIssue() { + if _, ok := x.xxx_hidden_InsightType.(*securityInsightTrait_Issue); ok { + x.xxx_hidden_InsightType = nil + } +} + func (x *SecurityInsightTrait) ClearObservedAt() { x.xxx_hidden_ObservedAt = nil } @@ -210,10 +417,35 @@ func (x *SecurityInsightTrait) ClearExternalResource() { } } +func (x *SecurityInsightTrait) ClearAppUser() { + if _, ok := x.xxx_hidden_Target.(*securityInsightTrait_AppUser); ok { + x.xxx_hidden_Target = nil + } +} + +const SecurityInsightTrait_InsightType_not_set_case case_SecurityInsightTrait_InsightType = 0 +const SecurityInsightTrait_RiskScore_case case_SecurityInsightTrait_InsightType = 1 +const SecurityInsightTrait_Issue_case case_SecurityInsightTrait_InsightType = 2 + +func (x *SecurityInsightTrait) WhichInsightType() case_SecurityInsightTrait_InsightType { + if x == nil { + return SecurityInsightTrait_InsightType_not_set_case + } + switch x.xxx_hidden_InsightType.(type) { + case *securityInsightTrait_RiskScore: + return SecurityInsightTrait_RiskScore_case + case *securityInsightTrait_Issue: + return SecurityInsightTrait_Issue_case + default: + return SecurityInsightTrait_InsightType_not_set_case + } +} + const SecurityInsightTrait_Target_not_set_case case_SecurityInsightTrait_Target = 0 const SecurityInsightTrait_User_case case_SecurityInsightTrait_Target = 4 const SecurityInsightTrait_ResourceId_case case_SecurityInsightTrait_Target = 5 const SecurityInsightTrait_ExternalResource_case case_SecurityInsightTrait_Target = 6 +const SecurityInsightTrait_AppUser_case case_SecurityInsightTrait_Target = 7 func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { if x == nil { @@ -226,6 +458,8 @@ func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { return SecurityInsightTrait_ResourceId_case case *securityInsightTrait_ExternalResource: return SecurityInsightTrait_ExternalResource_case + case *securityInsightTrait_AppUser: + return SecurityInsightTrait_AppUser_case default: return SecurityInsightTrait_Target_not_set_case } @@ -234,10 +468,12 @@ func (x *SecurityInsightTrait) WhichTarget() case_SecurityInsightTrait_Target { type SecurityInsightTrait_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - // The type of insight (e.g., "crowdstrike_zta_score", "wiz_critical_vulnerability") - InsightType string - // The value of the insight (e.g., "85", "High", "Critical") - Value string + // The type and value of the insight + + // Fields of oneof xxx_hidden_InsightType: + RiskScore *RiskScore + Issue *Issue + // -- end of xxx_hidden_InsightType // When this insight was observed/captured from the source system ObservedAt *timestamppb.Timestamp // The target entity this insight should be bound to @@ -249,6 +485,8 @@ type SecurityInsightTrait_builder struct { ResourceId *ResourceId // For binding to an AppResource by external ID ExternalResource *SecurityInsightTrait_ExternalResourceTarget + // For binding to an AppUser by email address + AppUser *SecurityInsightTrait_AppUserTarget // -- end of xxx_hidden_Target } @@ -256,8 +494,12 @@ func (b0 SecurityInsightTrait_builder) Build() *SecurityInsightTrait { m0 := &SecurityInsightTrait{} b, x := &b0, m0 _, _ = b, x - x.xxx_hidden_InsightType = b.InsightType - x.xxx_hidden_Value = b.Value + if b.RiskScore != nil { + x.xxx_hidden_InsightType = &securityInsightTrait_RiskScore{b.RiskScore} + } + if b.Issue != nil { + x.xxx_hidden_InsightType = &securityInsightTrait_Issue{b.Issue} + } x.xxx_hidden_ObservedAt = b.ObservedAt if b.User != nil { x.xxx_hidden_Target = &securityInsightTrait_User{b.User} @@ -268,19 +510,48 @@ func (b0 SecurityInsightTrait_builder) Build() *SecurityInsightTrait { if b.ExternalResource != nil { x.xxx_hidden_Target = &securityInsightTrait_ExternalResource{b.ExternalResource} } + if b.AppUser != nil { + x.xxx_hidden_Target = &securityInsightTrait_AppUser{b.AppUser} + } return m0 } +type case_SecurityInsightTrait_InsightType protoreflect.FieldNumber + +func (x case_SecurityInsightTrait_InsightType) String() string { + md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + type case_SecurityInsightTrait_Target protoreflect.FieldNumber func (x case_SecurityInsightTrait_Target) String() string { - md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0].Descriptor() + md := file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].Descriptor() if x == 0 { return "not set" } return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) } +type isSecurityInsightTrait_InsightType interface { + isSecurityInsightTrait_InsightType() +} + +type securityInsightTrait_RiskScore struct { + RiskScore *RiskScore `protobuf:"bytes,1,opt,name=risk_score,json=riskScore,proto3,oneof"` +} + +type securityInsightTrait_Issue struct { + Issue *Issue `protobuf:"bytes,2,opt,name=issue,proto3,oneof"` +} + +func (*securityInsightTrait_RiskScore) isSecurityInsightTrait_InsightType() {} + +func (*securityInsightTrait_Issue) isSecurityInsightTrait_InsightType() {} + type isSecurityInsightTrait_Target interface { isSecurityInsightTrait_Target() } @@ -300,12 +571,19 @@ type securityInsightTrait_ExternalResource struct { ExternalResource *SecurityInsightTrait_ExternalResourceTarget `protobuf:"bytes,6,opt,name=external_resource,json=externalResource,proto3,oneof"` } +type securityInsightTrait_AppUser struct { + // For binding to an AppUser by email address + AppUser *SecurityInsightTrait_AppUserTarget `protobuf:"bytes,7,opt,name=app_user,json=appUser,proto3,oneof"` +} + func (*securityInsightTrait_User) isSecurityInsightTrait_Target() {} func (*securityInsightTrait_ResourceId) isSecurityInsightTrait_Target() {} func (*securityInsightTrait_ExternalResource) isSecurityInsightTrait_Target() {} +func (*securityInsightTrait_AppUser) isSecurityInsightTrait_Target() {} + // UserTarget identifies a user by email for resolution to a C1 User type SecurityInsightTrait_UserTarget struct { state protoimpl.MessageState `protogen:"opaque.v1"` @@ -316,7 +594,7 @@ type SecurityInsightTrait_UserTarget struct { func (x *SecurityInsightTrait_UserTarget) Reset() { *x = SecurityInsightTrait_UserTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -328,7 +606,7 @@ func (x *SecurityInsightTrait_UserTarget) String() string { func (*SecurityInsightTrait_UserTarget) ProtoMessage() {} func (x *SecurityInsightTrait_UserTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[1] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -364,6 +642,79 @@ func (b0 SecurityInsightTrait_UserTarget_builder) Build() *SecurityInsightTrait_ return m0 } +// AppUserTarget identifies a user by email for resolution to an AppUser. +type SecurityInsightTrait_AppUserTarget struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Email string `protobuf:"bytes,1,opt,name=email,proto3"` + xxx_hidden_ExternalId string `protobuf:"bytes,2,opt,name=external_id,json=externalId,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SecurityInsightTrait_AppUserTarget) Reset() { + *x = SecurityInsightTrait_AppUserTarget{} + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SecurityInsightTrait_AppUserTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityInsightTrait_AppUserTarget) ProtoMessage() {} + +func (x *SecurityInsightTrait_AppUserTarget) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SecurityInsightTrait_AppUserTarget) GetEmail() string { + if x != nil { + return x.xxx_hidden_Email + } + return "" +} + +func (x *SecurityInsightTrait_AppUserTarget) GetExternalId() string { + if x != nil { + return x.xxx_hidden_ExternalId + } + return "" +} + +func (x *SecurityInsightTrait_AppUserTarget) SetEmail(v string) { + x.xxx_hidden_Email = v +} + +func (x *SecurityInsightTrait_AppUserTarget) SetExternalId(v string) { + x.xxx_hidden_ExternalId = v +} + +type SecurityInsightTrait_AppUserTarget_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Email string + // The external identifier of the user (e.g., ID, GUID, etc.) + ExternalId string +} + +func (b0 SecurityInsightTrait_AppUserTarget_builder) Build() *SecurityInsightTrait_AppUserTarget { + m0 := &SecurityInsightTrait_AppUserTarget{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Email = b.Email + x.xxx_hidden_ExternalId = b.ExternalId + return m0 +} + // ExternalResourceTarget identifies a resource by external ID for resolution to an AppResource. // Use this when the connector doesn't sync the target resource itself. type SecurityInsightTrait_ExternalResourceTarget struct { @@ -376,7 +727,7 @@ type SecurityInsightTrait_ExternalResourceTarget struct { func (x *SecurityInsightTrait_ExternalResourceTarget) Reset() { *x = SecurityInsightTrait_ExternalResourceTarget{} - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -388,7 +739,7 @@ func (x *SecurityInsightTrait_ExternalResourceTarget) String() string { func (*SecurityInsightTrait_ExternalResourceTarget) ProtoMessage() {} func (x *SecurityInsightTrait_ExternalResourceTarget) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2] + mi := &file_c1_connector_v2_annotation_security_insight_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -443,46 +794,64 @@ var File_c1_connector_v2_annotation_security_insight_proto protoreflect.FileDesc const file_c1_connector_v2_annotation_security_insight_proto_rawDesc = "" + "\n" + - "1c1/connector/v2/annotation_security_insight.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"\xc9\x04\n" + - "\x14SecurityInsightTrait\x12-\n" + - "\finsight_type\x18\x01 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80\bR\vinsightType\x12 \n" + - "\x05value\x18\x02 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80\bR\x05value\x12;\n" + + "1c1/connector/v2/annotation_security_insight.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"!\n" + + "\tRiskScore\x12\x14\n" + + "\x05value\x18\x01 \x01(\tR\x05value\"E\n" + + "\x05Issue\x12\x14\n" + + "\x05value\x18\x01 \x01(\tR\x05value\x12&\n" + + "\bseverity\x18\x02 \x01(\tB\n" + + "\xfaB\ar\x05 \x00(\x80\bR\bseverity\"\xae\x06\n" + + "\x14SecurityInsightTrait\x12;\n" + + "\n" + + "risk_score\x18\x01 \x01(\v2\x1a.c1.connector.v2.RiskScoreH\x00R\triskScore\x12.\n" + + "\x05issue\x18\x02 \x01(\v2\x16.c1.connector.v2.IssueH\x00R\x05issue\x12;\n" + "\vobserved_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\n" + "observedAt\x12F\n" + - "\x04user\x18\x04 \x01(\v20.c1.connector.v2.SecurityInsightTrait.UserTargetH\x00R\x04user\x12>\n" + - "\vresource_id\x18\x05 \x01(\v2\x1b.c1.connector.v2.ResourceIdH\x00R\n" + + "\x04user\x18\x04 \x01(\v20.c1.connector.v2.SecurityInsightTrait.UserTargetH\x01R\x04user\x12>\n" + + "\vresource_id\x18\x05 \x01(\v2\x1b.c1.connector.v2.ResourceIdH\x01R\n" + "resourceId\x12k\n" + - "\x11external_resource\x18\x06 \x01(\v2<.c1.connector.v2.SecurityInsightTrait.ExternalResourceTargetH\x00R\x10externalResource\x1a0\n" + + "\x11external_resource\x18\x06 \x01(\v2<.c1.connector.v2.SecurityInsightTrait.ExternalResourceTargetH\x01R\x10externalResource\x12P\n" + + "\bapp_user\x18\a \x01(\v23.c1.connector.v2.SecurityInsightTrait.AppUserTargetH\x01R\aappUser\x1a0\n" + "\n" + "UserTarget\x12\"\n" + - "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x1am\n" + + "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x1a`\n" + + "\rAppUserTarget\x12\"\n" + + "\x05email\x18\x01 \x01(\tB\f\xfaB\tr\a \x01(\x80\b`\x01R\x05email\x12+\n" + + "\vexternal_id\x18\x02 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80 R\n" + + "externalId\x1am\n" + "\x16ExternalResourceTarget\x12+\n" + "\vexternal_id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80 R\n" + "externalId\x12&\n" + - "\bapp_hint\x18\x02 \x01(\tB\v\xfaB\br\x06(\x80\b\xd0\x01\x01R\aappHintB\r\n" + + "\bapp_hint\x18\x02 \x01(\tB\v\xfaB\br\x06(\x80\b\xd0\x01\x01R\aappHintB\x13\n" + + "\finsight_type\x12\x03\xf8B\x01B\r\n" + "\x06target\x12\x03\xf8B\x01B6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" -var file_c1_connector_v2_annotation_security_insight_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_c1_connector_v2_annotation_security_insight_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_c1_connector_v2_annotation_security_insight_proto_goTypes = []any{ - (*SecurityInsightTrait)(nil), // 0: c1.connector.v2.SecurityInsightTrait - (*SecurityInsightTrait_UserTarget)(nil), // 1: c1.connector.v2.SecurityInsightTrait.UserTarget - (*SecurityInsightTrait_ExternalResourceTarget)(nil), // 2: c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget - (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp - (*ResourceId)(nil), // 4: c1.connector.v2.ResourceId + (*RiskScore)(nil), // 0: c1.connector.v2.RiskScore + (*Issue)(nil), // 1: c1.connector.v2.Issue + (*SecurityInsightTrait)(nil), // 2: c1.connector.v2.SecurityInsightTrait + (*SecurityInsightTrait_UserTarget)(nil), // 3: c1.connector.v2.SecurityInsightTrait.UserTarget + (*SecurityInsightTrait_AppUserTarget)(nil), // 4: c1.connector.v2.SecurityInsightTrait.AppUserTarget + (*SecurityInsightTrait_ExternalResourceTarget)(nil), // 5: c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*ResourceId)(nil), // 7: c1.connector.v2.ResourceId } var file_c1_connector_v2_annotation_security_insight_proto_depIdxs = []int32{ - 3, // 0: c1.connector.v2.SecurityInsightTrait.observed_at:type_name -> google.protobuf.Timestamp - 1, // 1: c1.connector.v2.SecurityInsightTrait.user:type_name -> c1.connector.v2.SecurityInsightTrait.UserTarget - 4, // 2: c1.connector.v2.SecurityInsightTrait.resource_id:type_name -> c1.connector.v2.ResourceId - 2, // 3: c1.connector.v2.SecurityInsightTrait.external_resource:type_name -> c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 0, // 0: c1.connector.v2.SecurityInsightTrait.risk_score:type_name -> c1.connector.v2.RiskScore + 1, // 1: c1.connector.v2.SecurityInsightTrait.issue:type_name -> c1.connector.v2.Issue + 6, // 2: c1.connector.v2.SecurityInsightTrait.observed_at:type_name -> google.protobuf.Timestamp + 3, // 3: c1.connector.v2.SecurityInsightTrait.user:type_name -> c1.connector.v2.SecurityInsightTrait.UserTarget + 7, // 4: c1.connector.v2.SecurityInsightTrait.resource_id:type_name -> c1.connector.v2.ResourceId + 5, // 5: c1.connector.v2.SecurityInsightTrait.external_resource:type_name -> c1.connector.v2.SecurityInsightTrait.ExternalResourceTarget + 4, // 6: c1.connector.v2.SecurityInsightTrait.app_user:type_name -> c1.connector.v2.SecurityInsightTrait.AppUserTarget + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_c1_connector_v2_annotation_security_insight_proto_init() } @@ -491,10 +860,13 @@ func file_c1_connector_v2_annotation_security_insight_proto_init() { return } file_c1_connector_v2_resource_proto_init() - file_c1_connector_v2_annotation_security_insight_proto_msgTypes[0].OneofWrappers = []any{ + file_c1_connector_v2_annotation_security_insight_proto_msgTypes[2].OneofWrappers = []any{ + (*securityInsightTrait_RiskScore)(nil), + (*securityInsightTrait_Issue)(nil), (*securityInsightTrait_User)(nil), (*securityInsightTrait_ResourceId)(nil), (*securityInsightTrait_ExternalResource)(nil), + (*securityInsightTrait_AppUser)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -502,7 +874,7 @@ func file_c1_connector_v2_annotation_security_insight_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_security_insight_proto_rawDesc), len(file_c1_connector_v2_annotation_security_insight_proto_rawDesc)), NumEnums: 0, - NumMessages: 3, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go index 21ac6d98..8795297d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector.pb.go @@ -28,19 +28,20 @@ const ( type Capability int32 const ( - Capability_CAPABILITY_UNSPECIFIED Capability = 0 - Capability_CAPABILITY_PROVISION Capability = 1 - Capability_CAPABILITY_SYNC Capability = 2 - Capability_CAPABILITY_EVENT_FEED Capability = 3 - Capability_CAPABILITY_TICKETING Capability = 4 - Capability_CAPABILITY_ACCOUNT_PROVISIONING Capability = 5 - Capability_CAPABILITY_CREDENTIAL_ROTATION Capability = 6 - Capability_CAPABILITY_RESOURCE_CREATE Capability = 7 - Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 - Capability_CAPABILITY_SYNC_SECRETS Capability = 9 - Capability_CAPABILITY_ACTIONS Capability = 10 - Capability_CAPABILITY_TARGETED_SYNC Capability = 11 - Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 + Capability_CAPABILITY_UNSPECIFIED Capability = 0 + Capability_CAPABILITY_PROVISION Capability = 1 + Capability_CAPABILITY_SYNC Capability = 2 + Capability_CAPABILITY_EVENT_FEED Capability = 3 + Capability_CAPABILITY_TICKETING Capability = 4 + Capability_CAPABILITY_ACCOUNT_PROVISIONING Capability = 5 + Capability_CAPABILITY_CREDENTIAL_ROTATION Capability = 6 + Capability_CAPABILITY_RESOURCE_CREATE Capability = 7 + Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 + Capability_CAPABILITY_SYNC_SECRETS Capability = 9 + Capability_CAPABILITY_ACTIONS Capability = 10 + Capability_CAPABILITY_TARGETED_SYNC Capability = 11 + Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 + Capability_CAPABILITY_SERVICE_MODE_TARGETED_SYNC Capability = 13 ) // Enum value maps for Capability. @@ -59,21 +60,23 @@ var ( 10: "CAPABILITY_ACTIONS", 11: "CAPABILITY_TARGETED_SYNC", 12: "CAPABILITY_EVENT_FEED_V2", + 13: "CAPABILITY_SERVICE_MODE_TARGETED_SYNC", } Capability_value = map[string]int32{ - "CAPABILITY_UNSPECIFIED": 0, - "CAPABILITY_PROVISION": 1, - "CAPABILITY_SYNC": 2, - "CAPABILITY_EVENT_FEED": 3, - "CAPABILITY_TICKETING": 4, - "CAPABILITY_ACCOUNT_PROVISIONING": 5, - "CAPABILITY_CREDENTIAL_ROTATION": 6, - "CAPABILITY_RESOURCE_CREATE": 7, - "CAPABILITY_RESOURCE_DELETE": 8, - "CAPABILITY_SYNC_SECRETS": 9, - "CAPABILITY_ACTIONS": 10, - "CAPABILITY_TARGETED_SYNC": 11, - "CAPABILITY_EVENT_FEED_V2": 12, + "CAPABILITY_UNSPECIFIED": 0, + "CAPABILITY_PROVISION": 1, + "CAPABILITY_SYNC": 2, + "CAPABILITY_EVENT_FEED": 3, + "CAPABILITY_TICKETING": 4, + "CAPABILITY_ACCOUNT_PROVISIONING": 5, + "CAPABILITY_CREDENTIAL_ROTATION": 6, + "CAPABILITY_RESOURCE_CREATE": 7, + "CAPABILITY_RESOURCE_DELETE": 8, + "CAPABILITY_SYNC_SECRETS": 9, + "CAPABILITY_ACTIONS": 10, + "CAPABILITY_TARGETED_SYNC": 11, + "CAPABILITY_EVENT_FEED_V2": 12, + "CAPABILITY_SERVICE_MODE_TARGETED_SYNC": 13, } ) @@ -2151,7 +2154,7 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\rdefault_value\x18\x01 \x03(\v2J.c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntryR\fdefaultValue\x1av\n" + "\x11DefaultValueEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12K\n" + - "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\x86\x03\n" + + "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\xb1\x03\n" + "\n" + "Capability\x12\x1a\n" + "\x16CAPABILITY_UNSPECIFIED\x10\x00\x12\x18\n" + @@ -2167,7 +2170,8 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x12CAPABILITY_ACTIONS\x10\n" + "\x12\x1c\n" + "\x18CAPABILITY_TARGETED_SYNC\x10\v\x12\x1c\n" + - "\x18CAPABILITY_EVENT_FEED_V2\x10\f*\xae\x02\n" + + "\x18CAPABILITY_EVENT_FEED_V2\x10\f\x12)\n" + + "%CAPABILITY_SERVICE_MODE_TARGETED_SYNC\x10\r*\xae\x02\n" + " CapabilityDetailCredentialOption\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED\x10\x00\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD\x10\x01\x127\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go index e8ec7de5..2025995c 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/connector_protoopaque.pb.go @@ -28,19 +28,20 @@ const ( type Capability int32 const ( - Capability_CAPABILITY_UNSPECIFIED Capability = 0 - Capability_CAPABILITY_PROVISION Capability = 1 - Capability_CAPABILITY_SYNC Capability = 2 - Capability_CAPABILITY_EVENT_FEED Capability = 3 - Capability_CAPABILITY_TICKETING Capability = 4 - Capability_CAPABILITY_ACCOUNT_PROVISIONING Capability = 5 - Capability_CAPABILITY_CREDENTIAL_ROTATION Capability = 6 - Capability_CAPABILITY_RESOURCE_CREATE Capability = 7 - Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 - Capability_CAPABILITY_SYNC_SECRETS Capability = 9 - Capability_CAPABILITY_ACTIONS Capability = 10 - Capability_CAPABILITY_TARGETED_SYNC Capability = 11 - Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 + Capability_CAPABILITY_UNSPECIFIED Capability = 0 + Capability_CAPABILITY_PROVISION Capability = 1 + Capability_CAPABILITY_SYNC Capability = 2 + Capability_CAPABILITY_EVENT_FEED Capability = 3 + Capability_CAPABILITY_TICKETING Capability = 4 + Capability_CAPABILITY_ACCOUNT_PROVISIONING Capability = 5 + Capability_CAPABILITY_CREDENTIAL_ROTATION Capability = 6 + Capability_CAPABILITY_RESOURCE_CREATE Capability = 7 + Capability_CAPABILITY_RESOURCE_DELETE Capability = 8 + Capability_CAPABILITY_SYNC_SECRETS Capability = 9 + Capability_CAPABILITY_ACTIONS Capability = 10 + Capability_CAPABILITY_TARGETED_SYNC Capability = 11 + Capability_CAPABILITY_EVENT_FEED_V2 Capability = 12 + Capability_CAPABILITY_SERVICE_MODE_TARGETED_SYNC Capability = 13 ) // Enum value maps for Capability. @@ -59,21 +60,23 @@ var ( 10: "CAPABILITY_ACTIONS", 11: "CAPABILITY_TARGETED_SYNC", 12: "CAPABILITY_EVENT_FEED_V2", + 13: "CAPABILITY_SERVICE_MODE_TARGETED_SYNC", } Capability_value = map[string]int32{ - "CAPABILITY_UNSPECIFIED": 0, - "CAPABILITY_PROVISION": 1, - "CAPABILITY_SYNC": 2, - "CAPABILITY_EVENT_FEED": 3, - "CAPABILITY_TICKETING": 4, - "CAPABILITY_ACCOUNT_PROVISIONING": 5, - "CAPABILITY_CREDENTIAL_ROTATION": 6, - "CAPABILITY_RESOURCE_CREATE": 7, - "CAPABILITY_RESOURCE_DELETE": 8, - "CAPABILITY_SYNC_SECRETS": 9, - "CAPABILITY_ACTIONS": 10, - "CAPABILITY_TARGETED_SYNC": 11, - "CAPABILITY_EVENT_FEED_V2": 12, + "CAPABILITY_UNSPECIFIED": 0, + "CAPABILITY_PROVISION": 1, + "CAPABILITY_SYNC": 2, + "CAPABILITY_EVENT_FEED": 3, + "CAPABILITY_TICKETING": 4, + "CAPABILITY_ACCOUNT_PROVISIONING": 5, + "CAPABILITY_CREDENTIAL_ROTATION": 6, + "CAPABILITY_RESOURCE_CREATE": 7, + "CAPABILITY_RESOURCE_DELETE": 8, + "CAPABILITY_SYNC_SECRETS": 9, + "CAPABILITY_ACTIONS": 10, + "CAPABILITY_TARGETED_SYNC": 11, + "CAPABILITY_EVENT_FEED_V2": 12, + "CAPABILITY_SERVICE_MODE_TARGETED_SYNC": 13, } ) @@ -2173,7 +2176,7 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\rdefault_value\x18\x01 \x03(\v2J.c1.connector.v2.ConnectorAccountCreationSchema.MapField.DefaultValueEntryR\fdefaultValue\x1av\n" + "\x11DefaultValueEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12K\n" + - "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\x86\x03\n" + + "\x05value\x18\x02 \x01(\v25.c1.connector.v2.ConnectorAccountCreationSchema.FieldR\x05value:\x028\x01*\xb1\x03\n" + "\n" + "Capability\x12\x1a\n" + "\x16CAPABILITY_UNSPECIFIED\x10\x00\x12\x18\n" + @@ -2189,7 +2192,8 @@ const file_c1_connector_v2_connector_proto_rawDesc = "" + "\x12CAPABILITY_ACTIONS\x10\n" + "\x12\x1c\n" + "\x18CAPABILITY_TARGETED_SYNC\x10\v\x12\x1c\n" + - "\x18CAPABILITY_EVENT_FEED_V2\x10\f*\xae\x02\n" + + "\x18CAPABILITY_EVENT_FEED_V2\x10\f\x12)\n" + + "%CAPABILITY_SERVICE_MODE_TARGETED_SYNC\x10\r*\xae\x02\n" + " CapabilityDetailCredentialOption\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_UNSPECIFIED\x10\x00\x123\n" + "/CAPABILITY_DETAIL_CREDENTIAL_OPTION_NO_PASSWORD\x10\x01\x127\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement.pb.go index fca3e908..d1926c4a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement.pb.go @@ -30,6 +30,7 @@ const ( Entitlement_PURPOSE_VALUE_UNSPECIFIED Entitlement_PurposeValue = 0 Entitlement_PURPOSE_VALUE_ASSIGNMENT Entitlement_PurposeValue = 1 Entitlement_PURPOSE_VALUE_PERMISSION Entitlement_PurposeValue = 2 + Entitlement_PURPOSE_VALUE_OWNERSHIP Entitlement_PurposeValue = 3 ) // Enum value maps for Entitlement_PurposeValue. @@ -38,11 +39,13 @@ var ( 0: "PURPOSE_VALUE_UNSPECIFIED", 1: "PURPOSE_VALUE_ASSIGNMENT", 2: "PURPOSE_VALUE_PERMISSION", + 3: "PURPOSE_VALUE_OWNERSHIP", } Entitlement_PurposeValue_value = map[string]int32{ "PURPOSE_VALUE_UNSPECIFIED": 0, "PURPOSE_VALUE_ASSIGNMENT": 1, "PURPOSE_VALUE_PERMISSION": 2, + "PURPOSE_VALUE_OWNERSHIP": 3, } ) @@ -645,7 +648,7 @@ var File_c1_connector_v2_entitlement_proto protoreflect.FileDescriptor const file_c1_connector_v2_entitlement_proto_rawDesc = "" + "\n" + - "!c1/connector/v2/entitlement.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x17validate/validate.proto\"\x95\x04\n" + + "!c1/connector/v2/entitlement.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x17validate/validate.proto\"\xb3\x04\n" + "\vEntitlement\x12?\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceB\b\xfaB\x05\x8a\x01\x02\x10\x01R\bresource\x12\x1a\n" + "\x02id\x18\x02 \x01(\tB\n" + @@ -657,11 +660,12 @@ const file_c1_connector_v2_entitlement_proto_rawDesc = "" + "\fgrantable_to\x18\x05 \x03(\v2\x1d.c1.connector.v2.ResourceTypeR\vgrantableTo\x126\n" + "\vannotations\x18\x06 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12M\n" + "\apurpose\x18\a \x01(\x0e2).c1.connector.v2.Entitlement.PurposeValueB\b\xfaB\x05\x82\x01\x02\x10\x01R\apurpose\x12\x12\n" + - "\x04slug\x18\b \x01(\tR\x04slug\"i\n" + + "\x04slug\x18\b \x01(\tR\x04slug\"\x86\x01\n" + "\fPurposeValue\x12\x1d\n" + "\x19PURPOSE_VALUE_UNSPECIFIED\x10\x00\x12\x1c\n" + "\x18PURPOSE_VALUE_ASSIGNMENT\x10\x01\x12\x1c\n" + - "\x18PURPOSE_VALUE_PERMISSION\x10\x02\"\xa8\x02\n" + + "\x18PURPOSE_VALUE_PERMISSION\x10\x02\x12\x1b\n" + + "\x17PURPOSE_VALUE_OWNERSHIP\x10\x03\"\xa8\x02\n" + "*EntitlementsServiceListEntitlementsRequest\x125\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x12'\n" + "\tpage_size\x18\x02 \x01(\rB\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement_protoopaque.pb.go index 88a1142b..0fc2b471 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/entitlement_protoopaque.pb.go @@ -30,6 +30,7 @@ const ( Entitlement_PURPOSE_VALUE_UNSPECIFIED Entitlement_PurposeValue = 0 Entitlement_PURPOSE_VALUE_ASSIGNMENT Entitlement_PurposeValue = 1 Entitlement_PURPOSE_VALUE_PERMISSION Entitlement_PurposeValue = 2 + Entitlement_PURPOSE_VALUE_OWNERSHIP Entitlement_PurposeValue = 3 ) // Enum value maps for Entitlement_PurposeValue. @@ -38,11 +39,13 @@ var ( 0: "PURPOSE_VALUE_UNSPECIFIED", 1: "PURPOSE_VALUE_ASSIGNMENT", 2: "PURPOSE_VALUE_PERMISSION", + 3: "PURPOSE_VALUE_OWNERSHIP", } Entitlement_PurposeValue_value = map[string]int32{ "PURPOSE_VALUE_UNSPECIFIED": 0, "PURPOSE_VALUE_ASSIGNMENT": 1, "PURPOSE_VALUE_PERMISSION": 2, + "PURPOSE_VALUE_OWNERSHIP": 3, } ) @@ -661,7 +664,7 @@ var File_c1_connector_v2_entitlement_proto protoreflect.FileDescriptor const file_c1_connector_v2_entitlement_proto_rawDesc = "" + "\n" + - "!c1/connector/v2/entitlement.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x17validate/validate.proto\"\x95\x04\n" + + "!c1/connector/v2/entitlement.proto\x12\x0fc1.connector.v2\x1a\x1ec1/connector/v2/resource.proto\x1a\x19google/protobuf/any.proto\x1a\x17validate/validate.proto\"\xb3\x04\n" + "\vEntitlement\x12?\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceB\b\xfaB\x05\x8a\x01\x02\x10\x01R\bresource\x12\x1a\n" + "\x02id\x18\x02 \x01(\tB\n" + @@ -673,11 +676,12 @@ const file_c1_connector_v2_entitlement_proto_rawDesc = "" + "\fgrantable_to\x18\x05 \x03(\v2\x1d.c1.connector.v2.ResourceTypeR\vgrantableTo\x126\n" + "\vannotations\x18\x06 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12M\n" + "\apurpose\x18\a \x01(\x0e2).c1.connector.v2.Entitlement.PurposeValueB\b\xfaB\x05\x82\x01\x02\x10\x01R\apurpose\x12\x12\n" + - "\x04slug\x18\b \x01(\tR\x04slug\"i\n" + + "\x04slug\x18\b \x01(\tR\x04slug\"\x86\x01\n" + "\fPurposeValue\x12\x1d\n" + "\x19PURPOSE_VALUE_UNSPECIFIED\x10\x00\x12\x1c\n" + "\x18PURPOSE_VALUE_ASSIGNMENT\x10\x01\x12\x1c\n" + - "\x18PURPOSE_VALUE_PERMISSION\x10\x02\"\xa8\x02\n" + + "\x18PURPOSE_VALUE_PERMISSION\x10\x02\x12\x1b\n" + + "\x17PURPOSE_VALUE_OWNERSHIP\x10\x03\"\xa8\x02\n" + "*EntitlementsServiceListEntitlementsRequest\x125\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x12'\n" + "\tpage_size\x18\x02 \x01(\rB\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go index de8fff47..e86d89c8 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go @@ -1878,6 +1878,7 @@ type CreateAccountRequest struct { AccountInfo *AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3" json:"account_info,omitempty"` CredentialOptions *CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` EncryptionConfigs []*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` + ResourceTypeId string `protobuf:"bytes,4,opt,name=resource_type_id,json=resourceTypeId,proto3" json:"resource_type_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1928,6 +1929,13 @@ func (x *CreateAccountRequest) GetEncryptionConfigs() []*EncryptionConfig { return nil } +func (x *CreateAccountRequest) GetResourceTypeId() string { + if x != nil { + return x.ResourceTypeId + } + return "" +} + func (x *CreateAccountRequest) SetAccountInfo(v *AccountInfo) { x.AccountInfo = v } @@ -1940,6 +1948,10 @@ func (x *CreateAccountRequest) SetEncryptionConfigs(v []*EncryptionConfig) { x.EncryptionConfigs = v } +func (x *CreateAccountRequest) SetResourceTypeId(v string) { + x.ResourceTypeId = v +} + func (x *CreateAccountRequest) HasAccountInfo() bool { if x == nil { return false @@ -1968,6 +1980,7 @@ type CreateAccountRequest_builder struct { AccountInfo *AccountInfo CredentialOptions *CredentialOptions EncryptionConfigs []*EncryptionConfig + ResourceTypeId string } func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { @@ -1977,6 +1990,7 @@ func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { x.AccountInfo = b.AccountInfo x.CredentialOptions = b.CredentialOptions x.EncryptionConfigs = b.EncryptionConfigs + x.ResourceTypeId = b.ResourceTypeId return m0 } @@ -4545,11 +4559,13 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\aoptions\"L\n" + "\x12PasswordConstraint\x12\x19\n" + "\bchar_set\x18\x01 \x01(\tR\acharSet\x12\x1b\n" + - "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xfc\x01\n" + + "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xb5\x02\n" + "\x14CreateAccountRequest\x12?\n" + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\"\xcc\b\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x127\n" + + "\x10resource_type_id\x18\x04 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\x0eresourceTypeId\"\xcc\b\n" + "\x15CreateAccountResponse\x12P\n" + "\asuccess\x18d \x01(\v24.c1.connector.v2.CreateAccountResponse.SuccessResultH\x00R\asuccess\x12f\n" + "\x0faction_required\x18e \x01(\v2;.c1.connector.v2.CreateAccountResponse.ActionRequiredResultH\x00R\x0eactionRequired\x12c\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go index 211603ac..c2093c67 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go @@ -1872,6 +1872,7 @@ type CreateAccountRequest struct { xxx_hidden_AccountInfo *AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3"` xxx_hidden_CredentialOptions *CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3"` xxx_hidden_EncryptionConfigs *[]*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3"` + xxx_hidden_ResourceTypeId string `protobuf:"bytes,4,opt,name=resource_type_id,json=resourceTypeId,proto3"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1924,6 +1925,13 @@ func (x *CreateAccountRequest) GetEncryptionConfigs() []*EncryptionConfig { return nil } +func (x *CreateAccountRequest) GetResourceTypeId() string { + if x != nil { + return x.xxx_hidden_ResourceTypeId + } + return "" +} + func (x *CreateAccountRequest) SetAccountInfo(v *AccountInfo) { x.xxx_hidden_AccountInfo = v } @@ -1936,6 +1944,10 @@ func (x *CreateAccountRequest) SetEncryptionConfigs(v []*EncryptionConfig) { x.xxx_hidden_EncryptionConfigs = &v } +func (x *CreateAccountRequest) SetResourceTypeId(v string) { + x.xxx_hidden_ResourceTypeId = v +} + func (x *CreateAccountRequest) HasAccountInfo() bool { if x == nil { return false @@ -1964,6 +1976,7 @@ type CreateAccountRequest_builder struct { AccountInfo *AccountInfo CredentialOptions *CredentialOptions EncryptionConfigs []*EncryptionConfig + ResourceTypeId string } func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { @@ -1973,6 +1986,7 @@ func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { x.xxx_hidden_AccountInfo = b.AccountInfo x.xxx_hidden_CredentialOptions = b.CredentialOptions x.xxx_hidden_EncryptionConfigs = &b.EncryptionConfigs + x.xxx_hidden_ResourceTypeId = b.ResourceTypeId return m0 } @@ -4538,11 +4552,13 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\aoptions\"L\n" + "\x12PasswordConstraint\x12\x19\n" + "\bchar_set\x18\x01 \x01(\tR\acharSet\x12\x1b\n" + - "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xfc\x01\n" + + "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xb5\x02\n" + "\x14CreateAccountRequest\x12?\n" + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\"\xcc\b\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x127\n" + + "\x10resource_type_id\x18\x04 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\x0eresourceTypeId\"\xcc\b\n" + "\x15CreateAccountResponse\x12P\n" + "\asuccess\x18d \x01(\v24.c1.connector.v2.CreateAccountResponse.SuccessResultH\x00R\asuccess\x12f\n" + "\x0faction_required\x18e \x01(\v2;.c1.connector.v2.CreateAccountResponse.ActionRequiredResultH\x00R\x0eactionRequired\x12c\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go index 9a188337..76d95c61 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go @@ -2936,6 +2936,7 @@ type Task_CreateAccountTask struct { AccountInfo *v2.AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3" json:"account_info,omitempty"` CredentialOptions *v2.CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` EncryptionConfigs []*v2.EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` + ResourceTypeId string `protobuf:"bytes,4,opt,name=resource_type_id,json=resourceTypeId,proto3" json:"resource_type_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2986,6 +2987,13 @@ func (x *Task_CreateAccountTask) GetEncryptionConfigs() []*v2.EncryptionConfig { return nil } +func (x *Task_CreateAccountTask) GetResourceTypeId() string { + if x != nil { + return x.ResourceTypeId + } + return "" +} + func (x *Task_CreateAccountTask) SetAccountInfo(v *v2.AccountInfo) { x.AccountInfo = v } @@ -2998,6 +3006,10 @@ func (x *Task_CreateAccountTask) SetEncryptionConfigs(v []*v2.EncryptionConfig) x.EncryptionConfigs = v } +func (x *Task_CreateAccountTask) SetResourceTypeId(v string) { + x.ResourceTypeId = v +} + func (x *Task_CreateAccountTask) HasAccountInfo() bool { if x == nil { return false @@ -3026,6 +3038,7 @@ type Task_CreateAccountTask_builder struct { AccountInfo *v2.AccountInfo CredentialOptions *v2.CredentialOptions EncryptionConfigs []*v2.EncryptionConfig + ResourceTypeId string } func (b0 Task_CreateAccountTask_builder) Build() *Task_CreateAccountTask { @@ -3035,6 +3048,7 @@ func (b0 Task_CreateAccountTask_builder) Build() *Task_CreateAccountTask { x.AccountInfo = b.AccountInfo x.CredentialOptions = b.CredentialOptions x.EncryptionConfigs = b.EncryptionConfigs + x.ResourceTypeId = b.ResourceTypeId return m0 } @@ -4872,7 +4886,7 @@ var File_c1_connectorapi_baton_v1_baton_proto protoreflect.FileDescriptor const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + - "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\x80)\n" + + "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xb9)\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12=\n" + "\x06status\x18\x02 \x01(\x0e2%.c1.connectorapi.baton.v1.Task.StatusR\x06status\x12=\n" + @@ -4920,11 +4934,13 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + "RevokeTask\x12,\n" + "\x05grant\x18\x01 \x01(\v2\x16.c1.connector.v2.GrantR\x05grant\x126\n" + - "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xf9\x01\n" + + "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xb2\x02\n" + "\x11CreateAccountTask\x12?\n" + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x1aK\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x127\n" + + "\x10resource_type_id\x18\x04 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\x0eresourceTypeId\x1aK\n" + "\x12CreateResourceTask\x125\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x1a\x9d\x01\n" + "\x12DeleteResourceTask\x12<\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go index bdf204f7..65db2f42 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go @@ -2911,6 +2911,7 @@ type Task_CreateAccountTask struct { xxx_hidden_AccountInfo *v2.AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3"` xxx_hidden_CredentialOptions *v2.CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3"` xxx_hidden_EncryptionConfigs *[]*v2.EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3"` + xxx_hidden_ResourceTypeId string `protobuf:"bytes,4,opt,name=resource_type_id,json=resourceTypeId,proto3"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2963,6 +2964,13 @@ func (x *Task_CreateAccountTask) GetEncryptionConfigs() []*v2.EncryptionConfig { return nil } +func (x *Task_CreateAccountTask) GetResourceTypeId() string { + if x != nil { + return x.xxx_hidden_ResourceTypeId + } + return "" +} + func (x *Task_CreateAccountTask) SetAccountInfo(v *v2.AccountInfo) { x.xxx_hidden_AccountInfo = v } @@ -2975,6 +2983,10 @@ func (x *Task_CreateAccountTask) SetEncryptionConfigs(v []*v2.EncryptionConfig) x.xxx_hidden_EncryptionConfigs = &v } +func (x *Task_CreateAccountTask) SetResourceTypeId(v string) { + x.xxx_hidden_ResourceTypeId = v +} + func (x *Task_CreateAccountTask) HasAccountInfo() bool { if x == nil { return false @@ -3003,6 +3015,7 @@ type Task_CreateAccountTask_builder struct { AccountInfo *v2.AccountInfo CredentialOptions *v2.CredentialOptions EncryptionConfigs []*v2.EncryptionConfig + ResourceTypeId string } func (b0 Task_CreateAccountTask_builder) Build() *Task_CreateAccountTask { @@ -3012,6 +3025,7 @@ func (b0 Task_CreateAccountTask_builder) Build() *Task_CreateAccountTask { x.xxx_hidden_AccountInfo = b.AccountInfo x.xxx_hidden_CredentialOptions = b.CredentialOptions x.xxx_hidden_EncryptionConfigs = &b.EncryptionConfigs + x.xxx_hidden_ResourceTypeId = b.ResourceTypeId return m0 } @@ -4877,7 +4891,7 @@ var File_c1_connectorapi_baton_v1_baton_proto protoreflect.FileDescriptor const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + - "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\x80)\n" + + "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xb9)\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12=\n" + "\x06status\x18\x02 \x01(\x0e2%.c1.connectorapi.baton.v1.Task.StatusR\x06status\x12=\n" + @@ -4925,11 +4939,13 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + "RevokeTask\x12,\n" + "\x05grant\x18\x01 \x01(\v2\x16.c1.connector.v2.GrantR\x05grant\x126\n" + - "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xf9\x01\n" + + "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xb2\x02\n" + "\x11CreateAccountTask\x12?\n" + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x1aK\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\x127\n" + + "\x10resource_type_id\x18\x04 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\x0eresourceTypeId\x1aK\n" + "\x12CreateResourceTask\x125\n" + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x1a\x9d\x01\n" + "\x12DeleteResourceTask\x12<\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go b/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go index ca26d7e4..f63d01ba 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go @@ -8,6 +8,7 @@ import ( "sync" "time" + config "github.com/conductorone/baton-sdk/pb/c1/config/v1" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" "github.com/conductorone/baton-sdk/pkg/annotations" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" @@ -418,11 +419,20 @@ func (a *ActionManager) InvokeAction( func (a *ActionManager) invokeGlobalAction(ctx context.Context, name string, args *structpb.Struct) (string, v2.BatonActionStatus, *structpb.Struct, annotations.Annotations, error) { a.mu.RLock() handler, ok := a.handlers[name] + schema, schemaOk := a.schemas[name] a.mu.RUnlock() if !ok { return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.NotFound, fmt.Sprintf("handler for action %s not found", name)) } + if !schemaOk || schema == nil { + return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.Internal, fmt.Sprintf("schema for action %s not found", name)) + } + + // Validate constraints + if err := validateActionConstraints(schema.GetConstraints(), args); err != nil { + return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.InvalidArgument, err.Error()) + } oa := a.GetNewAction(name) @@ -432,6 +442,7 @@ func (a *ActionManager) invokeGlobalAction(ctx context.Context, name string, arg // If handler takes longer than 1 second, return status pending. // If handler takes longer than an hour, return status failed. go func() { + defer close(done) oa.SetStatus(ctx, v2.BatonActionStatus_BATON_ACTION_STATUS_RUNNING) handlerCtx, cancel := context.WithTimeoutCause(context.Background(), 1*time.Hour, errors.New("action handler timed out")) defer cancel() @@ -442,7 +453,6 @@ func (a *ActionManager) invokeGlobalAction(ctx context.Context, name string, arg } else { oa.SetError(ctx, oaErr) } - done <- struct{}{} }() select { @@ -486,13 +496,31 @@ func (a *ActionManager) invokeResourceAction( nil, status.Error(codes.NotFound, fmt.Sprintf("handler for action %s not found for resource type %s", actionName, resourceTypeID)) } + + schemas, ok := a.resourceSchemas[resourceTypeID] + if !ok { + a.mu.RUnlock() + return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.Internal, fmt.Sprintf("schemas not found for resource type %s", resourceTypeID)) + } + + schema, ok := schemas[actionName] + if !ok { + a.mu.RUnlock() + return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.Internal, fmt.Sprintf("schema not found for action %s", actionName)) + } a.mu.RUnlock() + // Validate constraints + if err := validateActionConstraints(schema.GetConstraints(), args); err != nil { + return "", v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED, nil, nil, status.Error(codes.InvalidArgument, err.Error()) + } + oa := a.GetNewAction(actionName) done := make(chan struct{}) // Invoke handler in goroutine go func() { + defer close(done) oa.SetStatus(ctx, v2.BatonActionStatus_BATON_ACTION_STATUS_RUNNING) handlerCtx, cancel := context.WithTimeoutCause(context.Background(), 1*time.Hour, errors.New("action handler timed out")) defer cancel() @@ -503,7 +531,6 @@ func (a *ActionManager) invokeResourceAction( } else { oa.SetError(ctx, oaErr) } - done <- struct{}{} }() // Wait for completion or timeout @@ -517,3 +544,92 @@ func (a *ActionManager) invokeResourceAction( return oa.Id, oa.Status, oa.Rv, oa.Annos, ctx.Err() } } + +// validateActionConstraints validates that the provided args satisfy the schema constraints. +func validateActionConstraints(constraints []*config.Constraint, args *structpb.Struct) error { + if len(constraints) == 0 { + return nil + } + + // Build map of present fields (non-null values in struct) + present := make(map[string]bool) + if args != nil { + for fieldName, value := range args.GetFields() { + if !isNullValue(value) { + present[fieldName] = true + } + } + } + + // Validate each constraint + for _, constraint := range constraints { + if err := validateConstraint(constraint, present); err != nil { + return err + } + } + return nil +} + +func validateConstraint(c *config.Constraint, present map[string]bool) error { + // Deduplicate field names to handle cases where the same field is listed multiple times + uniqueFieldNames := deduplicateStrings(c.GetFieldNames()) + + // Count how many unique primary fields are present + var primaryPresent int + for _, name := range uniqueFieldNames { + if present[name] { + primaryPresent++ + } + } + + switch c.GetKind() { + case config.ConstraintKind_CONSTRAINT_KIND_REQUIRED_TOGETHER: + if primaryPresent > 0 && primaryPresent < len(uniqueFieldNames) { + return fmt.Errorf("fields required together: %v", uniqueFieldNames) + } + case config.ConstraintKind_CONSTRAINT_KIND_MUTUALLY_EXCLUSIVE: + if primaryPresent > 1 { + return fmt.Errorf("fields are mutually exclusive: %v", uniqueFieldNames) + } + case config.ConstraintKind_CONSTRAINT_KIND_AT_LEAST_ONE: + if primaryPresent == 0 { + return fmt.Errorf("at least one required: %v", uniqueFieldNames) + } + case config.ConstraintKind_CONSTRAINT_KIND_DEPENDENT_ON: + if primaryPresent > 0 { + // Deduplicate secondary field names and check they are all present + uniqueSecondaryFieldNames := deduplicateStrings(c.GetSecondaryFieldNames()) + for _, name := range uniqueSecondaryFieldNames { + if !present[name] { + return fmt.Errorf("fields %v depend on %v which must also be present", uniqueFieldNames, uniqueSecondaryFieldNames) + } + } + } + case config.ConstraintKind_CONSTRAINT_KIND_UNSPECIFIED: + return nil + default: + return fmt.Errorf("unknown constraint kind: %v", c.GetKind()) + } + return nil +} + +// deduplicateStrings returns a new slice with duplicate strings removed, preserving order. +func deduplicateStrings(input []string) []string { + seen := make(map[string]bool) + result := make([]string, 0, len(input)) + for _, s := range input { + if !seen[s] { + seen[s] = true + result = append(result, s) + } + } + return result +} + +func isNullValue(v *structpb.Value) bool { + if v == nil { + return true + } + _, isNull := v.GetKind().(*structpb.Value_NullValue) + return isNull +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go index 93c0e5b8..ae3f324e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go @@ -234,6 +234,7 @@ func MakeMainCommand[T field.Configurable]( login, email, profile, + v.GetString("create-account-resource-type"), )) case v.GetString("create-account-login") != "": // should only be here if no create-account-profile is provided, so lets make one. @@ -251,6 +252,7 @@ func MakeMainCommand[T field.Configurable]( v.GetString("create-account-login"), v.GetString("create-account-email"), profile, + v.GetString("create-account-resource-type"), )) case v.GetString("invoke-action") != "": invokeActionArgsStr := v.GetString("invoke-action-args") diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go index c2fd1848..ae5e0c20 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go @@ -178,12 +178,24 @@ func OptionallyAddLambdaCommand[T field.Configurable]( configStructMap := configStruct.AsMap() - var fieldOptions []field.Option + var ( + fieldOptions []field.Option + schemaFields []field.SchemaField + authMethodStr string + ) if authMethod, ok := configStructMap["auth-method"]; ok { - if authMethodStr, ok := authMethod.(string); ok { + if authMethodStr, ok = authMethod.(string); ok { fieldOptions = append(fieldOptions, field.WithAuthMethod(authMethodStr)) } } + schemaFieldsMap := connectorSchema.FieldGroupFields(authMethodStr) + for _, field := range schemaFieldsMap { + schemaFields = append(schemaFields, field) + } + + if len(schemaFields) == 0 { + schemaFields = connectorSchema.Fields + } if err := field.Validate(connectorSchema, t, fieldOptions...); err != nil { return fmt.Errorf("lambda-run: failed to validate config: %w", err) @@ -216,7 +228,7 @@ func OptionallyAddLambdaCommand[T field.Configurable]( }), } - if hasOauthField(connectorSchema.Fields) { + if hasOauthField(schemaFields) { ops.TokenSource = &lambdaTokenSource{ ctx: runCtx, webKey: webKey, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go index e9c59e63..ed7f1403 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go @@ -59,12 +59,43 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe start := b.nowFunc() tt := tasks.CreateAccountType l := ctxzap.Extract(ctx) - if b.accountManager == nil { + + if len(b.accountManagers) == 0 { l.Error("error: connector does not have account manager configured") b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) return nil, status.Error(codes.Unimplemented, "connector does not have account manager configured") } + var accountManager AccountManagerLimited + if request.GetResourceTypeId() == "" { + if len(b.accountManagers) == 1 { + // If there's only one account manager, use it. + for _, am := range b.accountManagers { + accountManager = am + break + } + } else { + // If there are multiple account managers, default to user resource type. + var ok bool + accountManager, ok = b.accountManagers["user"] + if !ok { + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Error(codes.Unimplemented, "connector has multiple account managers configured, but no resource type specified, and no default account manager configured") + } + } + } + + // If resource type is specified, use the account manager for that resource type. + if accountManager == nil { + var ok bool + accountManager, ok = b.accountManagers[request.GetResourceTypeId()] + if !ok { + l.Error("error: connector does not have account manager configured") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + return nil, status.Errorf(codes.Unimplemented, "connector does not have account manager configured for resource type: %s", request.GetResourceTypeId()) + } + } + opts, err := crypto.ConvertCredentialOptions(ctx, b.clientSecret, request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: converting credential options failed", zap.Error(err)) @@ -72,7 +103,7 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe return nil, fmt.Errorf("error: converting credential options failed: %w", err) } - result, plaintexts, annos, err := b.accountManager.CreateAccount(ctx, request.GetAccountInfo(), opts) + result, plaintexts, annos, err := accountManager.CreateAccount(ctx, request.GetAccountInfo(), opts) if err != nil { l.Error("error: create account failed", zap.Error(err)) b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) @@ -119,18 +150,16 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe return rv, nil } -func (b *builder) addAccountManager(_ context.Context, typeId string, in interface{}) error { +func (b *builder) addAccountManager(_ context.Context, typeId string, in any) error { if _, ok := in.(OldAccountManager); ok { return fmt.Errorf("error: old account manager interface implemented for %s", typeId) } if accountManager, ok := in.(AccountManagerLimited); ok { - // NOTE(kans): currently unused - but these should probably be (resource) typed - b.accountManagers[typeId] = accountManager - if b.accountManager != nil { + if _, ok := b.accountManagers[typeId]; ok { return fmt.Errorf("error: duplicate resource type found for account manager %s", typeId) } - b.accountManager = accountManager + b.accountManagers[typeId] = accountManager } return nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go index 40df7dfd..ab092893 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go @@ -68,7 +68,6 @@ type builder struct { metadataProvider MetadataProvider validateProvider ValidateProvider ticketManager TicketManagerLimited - accountManager AccountManagerLimited resourceSyncers map[string]ResourceSyncerV2 resourceProvisioners map[string]ResourceProvisionerV2Limited resourceManagers map[string]ResourceManagerV2Limited @@ -76,8 +75,8 @@ type builder struct { resourceTargetedSyncers map[string]ResourceTargetedSyncerLimited credentialManagers map[string]CredentialManagerLimited eventFeeds map[string]EventFeed - accountManagers map[string]AccountManagerLimited // NOTE(kans): currently unused - actionManager ActionManager // Unified action manager for all actions + accountManagers map[string]AccountManagerLimited + actionManager ActionManager // Unified action manager for all actions } // NewConnector creates a new ConnectorServer for a new resource. @@ -105,7 +104,6 @@ func NewConnector(ctx context.Context, in interface{}, opts ...Opt) (types.Conne metadataProvider: nil, validateProvider: nil, ticketManager: nil, - accountManager: nil, nowFunc: time.Now, clientSecret: clientSecretJWK, resourceSyncers: make(map[string]ResourceSyncerV2), @@ -345,6 +343,7 @@ func (b *builder) getCapabilities(ctx context.Context) (*v2.ConnectorCapabilitie if _, exists := b.resourceTargetedSyncers[resourceTypeID]; exists { caps = append(caps, v2.Capability_CAPABILITY_TARGETED_SYNC) + connectorCaps[v2.Capability_CAPABILITY_SERVICE_MODE_TARGETED_SYNC] = struct{}{} } if _, exists := b.resourceProvisioners[resourceTypeID]; exists { @@ -386,7 +385,7 @@ func (b *builder) getCapabilities(ctx context.Context) (*v2.ConnectorCapabilitie } // Check for account provisioning capability (global, not per resource type) - if b.accountManager != nil { + if len(b.accountManagers) > 0 { connectorCaps[v2.Capability_CAPABILITY_ACCOUNT_PROVISIONING] = struct{}{} } sort.Slice(resourceTypeCapabilities, func(i, j int) bool { @@ -452,13 +451,14 @@ func getCredentialDetails(ctx context.Context, b *builder) (*v2.CredentialDetail rv := &v2.CredentialDetails{} // Check for account provisioning capability details - if b.accountManager != nil { - accountProvisioningCapabilityDetails, _, err := b.accountManager.CreateAccountCapabilityDetails(ctx) + for _, am := range b.accountManagers { + accountProvisioningCapabilityDetails, _, err := am.CreateAccountCapabilityDetails(ctx) if err != nil { l.Error("error: getting account provisioning details", zap.Error(err)) return nil, fmt.Errorf("error: getting account provisioning details: %w", err) } rv.SetCapabilityAccountProvisioning(accountProvisioningCapabilityDetails) + break // Only need one account manager's details } // Check for credential rotation capability details diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go index 7974ef45..5b7d2148 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go @@ -280,9 +280,10 @@ type revokeConfig struct { } type createAccountConfig struct { - login string - email string - profile *structpb.Struct + login string + email string + profile *structpb.Struct + resourceTypeID string // Optional: if set, creates an account for the specified resource type. } type invokeActionConfig struct { @@ -470,14 +471,15 @@ func WithOnDemandRevoke(c1zPath string, grantID string) Option { } } -func WithOnDemandCreateAccount(c1zPath string, login string, email string, profile *structpb.Struct) Option { +func WithOnDemandCreateAccount(c1zPath string, login string, email string, profile *structpb.Struct, resourceTypeId string) Option { return func(ctx context.Context, cfg *runnerConfig) error { cfg.onDemand = true cfg.c1zPath = c1zPath cfg.createAccountConfig = &createAccountConfig{ - login: login, - email: email, - profile: profile, + login: login, + email: email, + profile: profile, + resourceTypeID: resourceTypeId, } return nil } @@ -797,7 +799,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op tm = local.NewRevoker(ctx, cfg.c1zPath, cfg.revokeConfig.grantID) case cfg.createAccountConfig != nil: - tm = local.NewCreateAccountManager(ctx, cfg.c1zPath, cfg.createAccountConfig.login, cfg.createAccountConfig.email, cfg.createAccountConfig.profile) + tm = local.NewCreateAccountManager(ctx, cfg.c1zPath, cfg.createAccountConfig.login, cfg.createAccountConfig.email, cfg.createAccountConfig.profile, cfg.createAccountConfig.resourceTypeID) case cfg.invokeActionConfig != nil: tm = local.NewActionInvoker(ctx, cfg.c1zPath, cfg.invokeActionConfig.action, cfg.invokeActionConfig.resourceTypeID, cfg.invokeActionConfig.args) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go index 5de57194..911bf095 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go @@ -11,6 +11,8 @@ import ( "time" "github.com/doug-martin/goqu/v9" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -45,11 +47,13 @@ type C1File struct { pragmas []pragma readOnly bool encoderConcurrency int + closed bool + closedMu sync.Mutex // Cached sync run for listConnectorObjects (avoids N+1 queries) - cachedViewSyncRun *syncRun - cachedViewSyncOnce sync.Once - cachedViewSyncErr error + cachedViewSyncRun *syncRun + cachedViewSyncMu sync.Mutex + cachedViewSyncErr error // Slow query tracking slowQueryLogTimes map[string]time.Time @@ -187,7 +191,7 @@ func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) ( opt(options) } - dbFilePath, err := loadC1z(outputFilePath, options.tmpDir, options.decoderOptions...) + dbFilePath, _, err := decompressC1z(outputFilePath, options.tmpDir, options.decoderOptions...) if err != nil { return nil, err } @@ -225,11 +229,45 @@ func cleanupDbDir(dbFilePath string, err error) error { var ErrReadOnly = errors.New("c1z: read only mode") // Close ensures that the sqlite database is flushed to disk, and if any changes were made we update the original database -// with our changes. -func (c *C1File) Close() error { +// with our changes. The provided context is used for the WAL checkpoint operation. +func (c *C1File) Close(ctx context.Context) error { var err error + c.closedMu.Lock() + defer c.closedMu.Unlock() + if c.closed { + l := ctxzap.Extract(ctx) + l.Warn("close called on already-closed c1file", zap.String("db_path", c.dbFilePath)) + return nil + } + if c.rawDb != nil { + // CRITICAL: Force a full WAL checkpoint before closing the database. + // This ensures all WAL data is written back to the main database file + // and the writes are synced to disk. Without this, on filesystems with + // aggressive caching (like ZFS with large ARC), the subsequent saveC1z() + // read could see stale data because the checkpoint writes may still be + // in kernel buffers. + // + // TRUNCATE mode: checkpoint as many frames as possible, then truncate + // the WAL file to zero bytes. This guarantees all data is in the main + // database file before we read it for compression. + if c.dbUpdated && !c.readOnly { + _, err = c.rawDb.ExecContext(ctx, "PRAGMA wal_checkpoint(TRUNCATE)") + if err != nil { + l := ctxzap.Extract(ctx) + // Checkpoint failed - log and continue. The subsequent Close() + // will attempt a passive checkpoint. If that also fails, we'll + // get an error from Close() or saveC1z() will read stale data. + // We log here for debugging but don't fail because: + // 1. Close() will still attempt its own checkpoint + // 2. The error might be transient (busy) + l.Warn("WAL checkpoint failed before close", + zap.Error(err), + zap.String("db_path", c.dbFilePath)) + } + } + err = c.rawDb.Close() if err != nil { return cleanupDbDir(c.dbFilePath, err) @@ -249,7 +287,13 @@ func (c *C1File) Close() error { } } - return cleanupDbDir(c.dbFilePath, err) + err = cleanupDbDir(c.dbFilePath, err) + if err != nil { + return err + } + c.closed = true + + return nil } // init ensures that the database has all of the required schema. @@ -267,6 +311,19 @@ func (c *C1File) init(ctx context.Context) error { return err } + if c.readOnly { + // Disable journaling in read only mode, since we're not writing to the database. + _, err = c.db.ExecContext(ctx, "PRAGMA journal_mode = OFF") + if err != nil { + return err + } + // Disable synchronous writes in read only mode, since we're not writing to the database. + _, err = c.db.ExecContext(ctx, "PRAGMA synchronous = OFF") + if err != nil { + return err + } + } + for _, pragma := range c.pragmas { _, err := c.db.ExecContext(ctx, fmt.Sprintf("PRAGMA %s = %s", pragma.name, pragma.value)) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go index 54e64f4f..d7ee4c6d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go @@ -2,15 +2,12 @@ package dotc1z import ( "context" - "database/sql" "errors" "fmt" - "time" reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" "github.com/conductorone/baton-sdk/pkg/connectorstore" "github.com/doug-martin/goqu/v9" - "github.com/segmentio/ksuid" ) type C1FileAttached struct { @@ -40,8 +37,8 @@ func (c *C1FileAttached) CompactTable(ctx context.Context, baseSyncID string, ap selectList += ", " } columnList += col - if col == "sync_id" { //nolint:goconst,nolintlint // ... - selectList += "? as sync_id" //nolint:goconst,nolintlint // ... + if col == "sync_id" { + selectList += "? as sync_id" } else { selectList += col } @@ -177,223 +174,3 @@ func (c *C1FileAttached) UpdateSync(ctx context.Context, baseSync *reader_v2.Syn return nil } - -// GenerateSyncDiffFromFile compares the old sync (in attached) with the new sync (in main) -// and generates two new syncs in the main database. -// -// IMPORTANT: This assumes main=NEW/compacted and attached=OLD/base: -// - diffTableFromAttached: items in attached (OLD) not in main (NEW) = deletions -// - diffTableFromMain: items in main (NEW) not in attached (OLD) = upserts (additions) -// -// Parameters: -// - oldSyncID: the sync ID in the attached database (OLD/base state) -// - newSyncID: the sync ID in the main database (NEW/compacted state) -// -// Returns (upsertsSyncID, deletionsSyncID, error). -func (c *C1FileAttached) GenerateSyncDiffFromFile(ctx context.Context, oldSyncID string, newSyncID string) (string, string, error) { - if !c.safe { - return "", "", errors.New("database has been detached") - } - - ctx, span := tracer.Start(ctx, "C1FileAttached.GenerateSyncDiffFromFile") - defer span.End() - - // Generate unique IDs for the diff syncs - deletionsSyncID := ksuid.New().String() - upsertsSyncID := ksuid.New().String() - - // Start transaction for atomicity - tx, err := c.file.rawDb.BeginTx(ctx, nil) - if err != nil { - return "", "", fmt.Errorf("failed to begin transaction: %w", err) - } - - // Ensure rollback on error - committed := false - defer func() { - if !committed { - _ = tx.Rollback() - } - }() - - now := time.Now().Format("2006-01-02 15:04:05.999999999") - - // Create the deletions sync first (so upserts is "latest") - // Link it to upserts sync bidirectionally - deletionsInsert := c.file.db.Insert(syncRuns.Name()).Rows(goqu.Record{ - "sync_id": deletionsSyncID, - "started_at": now, - "sync_token": "", - "sync_type": connectorstore.SyncTypePartialDeletions, - "parent_sync_id": oldSyncID, - "linked_sync_id": upsertsSyncID, - }) - query, args, err := deletionsInsert.ToSQL() - if err != nil { - return "", "", fmt.Errorf("failed to build deletions sync insert: %w", err) - } - if _, err = tx.ExecContext(ctx, query, args...); err != nil { - return "", "", fmt.Errorf("failed to create deletions sync: %w", err) - } - - // Create the upserts sync, linked to deletions sync - upsertsInsert := c.file.db.Insert(syncRuns.Name()).Rows(goqu.Record{ - "sync_id": upsertsSyncID, - "started_at": now, - "sync_token": "", - "sync_type": connectorstore.SyncTypePartialUpserts, - "parent_sync_id": oldSyncID, - "linked_sync_id": deletionsSyncID, - }) - query, args, err = upsertsInsert.ToSQL() - if err != nil { - return "", "", fmt.Errorf("failed to build upserts sync insert: %w", err) - } - if _, err = tx.ExecContext(ctx, query, args...); err != nil { - return "", "", fmt.Errorf("failed to create upserts sync: %w", err) - } - - // Process each table - // main=NEW, attached=OLD - // - diffTableFromAttachedTx finds items in OLD not in NEW = deletions - // - diffTableFromMainTx finds items in NEW not in OLD or modified = upserts - tables := []string{"v1_resource_types", "v1_resources", "v1_entitlements", "v1_grants"} - for _, tableName := range tables { - if err := c.diffTableFromAttachedTx(ctx, tx, tableName, oldSyncID, newSyncID, deletionsSyncID); err != nil { - return "", "", fmt.Errorf("failed to generate deletions for %s: %w", tableName, err) - } - if err := c.diffTableFromMainTx(ctx, tx, tableName, oldSyncID, newSyncID, upsertsSyncID); err != nil { - return "", "", fmt.Errorf("failed to generate upserts for %s: %w", tableName, err) - } - } - - // End the syncs (deletions first, then upserts) - endedAt := time.Now().Format("2006-01-02 15:04:05.999999999") - - endDeletions := c.file.db.Update(syncRuns.Name()). - Set(goqu.Record{"ended_at": endedAt}). - Where(goqu.C("sync_id").Eq(deletionsSyncID), goqu.C("ended_at").IsNull()) - query, args, err = endDeletions.ToSQL() - if err != nil { - return "", "", fmt.Errorf("failed to build end deletions sync: %w", err) - } - if _, err = tx.ExecContext(ctx, query, args...); err != nil { - return "", "", fmt.Errorf("failed to end deletions sync: %w", err) - } - - endUpserts := c.file.db.Update(syncRuns.Name()). - Set(goqu.Record{"ended_at": endedAt}). - Where(goqu.C("sync_id").Eq(upsertsSyncID), goqu.C("ended_at").IsNull()) - query, args, err = endUpserts.ToSQL() - if err != nil { - return "", "", fmt.Errorf("failed to build end upserts sync: %w", err) - } - if _, err = tx.ExecContext(ctx, query, args...); err != nil { - return "", "", fmt.Errorf("failed to end upserts sync: %w", err) - } - - // Commit transaction - if err = tx.Commit(); err != nil { - return "", "", fmt.Errorf("failed to commit transaction: %w", err) - } - committed = true - c.file.dbUpdated = true - - return upsertsSyncID, deletionsSyncID, nil -} - -// diffTableFromAttachedTx finds items in attached (OLD) that don't exist in main (NEW). -// These are DELETIONS - items that existed before but no longer exist. -// Uses the provided transaction. -func (c *C1FileAttached) diffTableFromAttachedTx(ctx context.Context, tx *sql.Tx, tableName string, oldSyncID string, newSyncID string, targetSyncID string) error { - columns, err := c.getTableColumns(ctx, tableName) - if err != nil { - return err - } - - // Build column lists - columnList := "" - selectList := "" - for i, col := range columns { - if i > 0 { - columnList += ", " - selectList += ", " - } - columnList += col - if col == "sync_id" { - selectList += "? as sync_id" - } else { - selectList += col - } - } - - // Insert items from attached (OLD) that don't exist in main (NEW) - // oldSyncID is in attached, newSyncID is in main - //nolint:gosec // table names are from hardcoded list, not user input - query := fmt.Sprintf(` - INSERT INTO main.%s (%s) - SELECT %s - FROM attached.%s AS a - WHERE a.sync_id = ? - AND NOT EXISTS ( - SELECT 1 FROM main.%s AS m - WHERE m.external_id = a.external_id AND m.sync_id = ? - ) - `, tableName, columnList, selectList, tableName, tableName) - - _, err = tx.ExecContext(ctx, query, targetSyncID, oldSyncID, newSyncID) - return err -} - -// diffTableFromMainTx finds items in main (NEW) that are new or modified compared to attached (OLD). -// These are UPSERTS - items that are new or have changed. -// Uses the provided transaction. -func (c *C1FileAttached) diffTableFromMainTx(ctx context.Context, tx *sql.Tx, tableName string, oldSyncID string, newSyncID string, targetSyncID string) error { - columns, err := c.getTableColumns(ctx, tableName) - if err != nil { - return err - } - - // Build column lists - columnList := "" - selectList := "" - for i, col := range columns { - if i > 0 { - columnList += ", " - selectList += ", " - } - columnList += col - if col == "sync_id" { - selectList += "? as sync_id" - } else { - selectList += col - } - } - - // Insert items from main (NEW) that are: - // 1. Not in attached (OLD) - additions - // 2. In attached but with different data - modifications - // newSyncID is in main, oldSyncID is in attached - //nolint:gosec // table names are from hardcoded list, not user input - query := fmt.Sprintf(` - INSERT INTO main.%s (%s) - SELECT %s - FROM main.%s AS m - WHERE m.sync_id = ? - AND ( - NOT EXISTS ( - SELECT 1 FROM attached.%s AS a - WHERE a.external_id = m.external_id AND a.sync_id = ? - ) - OR EXISTS ( - SELECT 1 FROM attached.%s AS a - WHERE a.external_id = m.external_id - AND a.sync_id = ? - AND a.data != m.data - ) - ) - `, tableName, columnList, selectList, tableName, tableName, tableName) - - _, err = tx.ExecContext(ctx, query, targetSyncID, newSyncID, oldSyncID, oldSyncID) - return err -} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go index 69096da3..c091d747 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/grants.go @@ -63,29 +63,6 @@ func (r *grantsTable) Migrations(ctx context.Context, db *goqu.Database) error { return nil } -// DropGrantIndexes drops the indexes on the grants table. -// This should only be called when compacting the grants table. -// These indexes are re-created when we open the database again. -func (c *C1File) DropGrantIndexes(ctx context.Context) error { - ctx, span := tracer.Start(ctx, "C1File.DropGrantsIndexes") - defer span.End() - - indexes := []string{ - fmt.Sprintf("idx_grants_resource_type_id_resource_id_v%s", grants.Version()), - fmt.Sprintf("idx_grants_principal_id_v%s", grants.Version()), - fmt.Sprintf("idx_grants_entitlement_id_principal_id_v%s", grants.Version()), - fmt.Sprintf("idx_grants_external_sync_v%s", grants.Version()), - } - - for _, index := range indexes { - _, err := c.db.ExecContext(ctx, fmt.Sprintf("DROP INDEX IF EXISTS %s", index)) - if err != nil { - return err - } - } - return nil -} - func (c *C1File) ListGrants(ctx context.Context, request *v2.GrantsServiceListGrantsRequest) (*v2.GrantsServiceListGrantsResponse, error) { ctx, span := tracer.Start(ctx, "C1File.ListGrants") defer span.End() diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go index c8a7b11a..e2b4ee78 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go @@ -97,27 +97,40 @@ type syncRun struct { // getCachedViewSyncRun returns the cached sync run for read operations. // This avoids N+1 queries when paginating through listConnectorObjects. -// The result is computed once and cached for the lifetime of the C1File. +// The cache is invalidated when a sync starts or ends. func (c *C1File) getCachedViewSyncRun(ctx context.Context) (*syncRun, error) { ctx, span := tracer.Start(ctx, "C1File.getCachedViewSyncRun") defer span.End() - c.cachedViewSyncOnce.Do(func() { - // First try to get a finished full sync - c.cachedViewSyncRun, c.cachedViewSyncErr = c.getFinishedSync(ctx, 0, connectorstore.SyncTypeFull) - if c.cachedViewSyncErr != nil { - return - } + c.cachedViewSyncMu.Lock() + defer c.cachedViewSyncMu.Unlock() - // If no finished sync, try to get an unfinished one - if c.cachedViewSyncRun == nil { - c.cachedViewSyncRun, c.cachedViewSyncErr = c.getLatestUnfinishedSync(ctx, connectorstore.SyncTypeAny) - } - }) + if c.cachedViewSyncRun != nil || c.cachedViewSyncErr != nil { + return c.cachedViewSyncRun, c.cachedViewSyncErr + } + + // First try to get a finished full sync + c.cachedViewSyncRun, c.cachedViewSyncErr = c.getFinishedSync(ctx, 0, connectorstore.SyncTypeFull) + if c.cachedViewSyncErr != nil { + return c.cachedViewSyncRun, c.cachedViewSyncErr + } + + // If no finished sync, try to get an unfinished one + if c.cachedViewSyncRun == nil { + c.cachedViewSyncRun, c.cachedViewSyncErr = c.getLatestUnfinishedSync(ctx, connectorstore.SyncTypeAny) + } return c.cachedViewSyncRun, c.cachedViewSyncErr } +// invalidateCachedViewSyncRun clears the cached sync run so it will be recomputed on next access. +func (c *C1File) invalidateCachedViewSyncRun() { + c.cachedViewSyncMu.Lock() + defer c.cachedViewSyncMu.Unlock() + c.cachedViewSyncRun = nil + c.cachedViewSyncErr = nil +} + func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connectorstore.SyncType) (*syncRun, error) { ctx, span := tracer.Start(ctx, "C1File.getLatestUnfinishedSync") defer span.End() @@ -539,6 +552,7 @@ func (c *C1File) StartNewSync(ctx context.Context, syncType connectorstore.SyncT } c.currentSyncID = syncID + c.invalidateCachedViewSyncRun() return c.currentSyncID, nil } @@ -597,6 +611,7 @@ func (c *C1File) EndSync(ctx context.Context) error { } c.currentSyncID = "" + c.invalidateCachedViewSyncRun() return nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go index 5805b9f0..9259241e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go @@ -49,6 +49,12 @@ var ( WithHidden(true), WithDescription("JSON-formatted object of map keys and values like '{ 'key': 'value' }'"), WithPersistent(true), WithExportTarget(ExportTargetNone)) + createAccountResourceTypeField = StringField("create-account-resource-type", + WithHidden(true), + WithDescription("The resource type ID of the account to create"), + WithPersistent(true), + WithExportTarget(ExportTargetNone), + ) deleteResourceField = StringField("delete-resource", WithHidden(true), WithDescription("The id of the resource to delete"), WithPersistent(true), WithExportTarget(ExportTargetNone)) deleteResourceTypeField = StringField("delete-resource-type", WithHidden(true), WithDescription("The type of the resource to delete"), WithPersistent(true), WithExportTarget(ExportTargetNone)) eventFeedField = StringField("event-feed", WithHidden(true), WithDescription("Read feed events to stdout"), WithPersistent(true), WithExportTarget(ExportTargetNone)) @@ -315,6 +321,7 @@ var DefaultFields = []SchemaField{ createAccountEmailField, createAccountLoginField, createAccountProfileField, + createAccountResourceTypeField, deleteResourceField, deleteResourceTypeField, eventFeedField, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go b/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go index 263f1bad..18bd2d63 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go @@ -34,9 +34,10 @@ type Provisioner struct { revokeGrantID string - createAccountLogin string - createAccountEmail string - createAccountProfile *structpb.Struct + createAccountLogin string + createAccountEmail string + createAccountProfile *structpb.Struct + createAccountResourceType string deleteResourceID string deleteResourceType string @@ -118,7 +119,7 @@ func (p *Provisioner) Close(ctx context.Context) error { var err error if p.store != nil { - storeErr := p.store.Close() + storeErr := p.store.Close(ctx) if storeErr != nil { err = errors.Join(err, storeErr) } @@ -285,6 +286,7 @@ func (p *Provisioner) createAccount(ctx context.Context) error { } _, err = p.connector.CreateAccount(ctx, v2.CreateAccountRequest_builder{ + ResourceTypeId: p.createAccountResourceType, AccountInfo: v2.AccountInfo_builder{ Emails: emails, Login: p.createAccountLogin, @@ -297,7 +299,11 @@ func (p *Provisioner) createAccount(ctx context.Context) error { return err } - l.Debug("account created", zap.String("login", p.createAccountLogin), zap.String("email", p.createAccountEmail)) + l.Debug("account created", + zap.String("login", p.createAccountLogin), + zap.String("email", p.createAccountEmail), + zap.String("resource_type", p.createAccountResourceType), + ) return nil } @@ -373,13 +379,14 @@ func NewResourceDeleter(c types.ConnectorClient, dbPath string, resourceId strin } } -func NewCreateAccountManager(c types.ConnectorClient, dbPath string, login string, email string, profile *structpb.Struct) *Provisioner { +func NewCreateAccountManager(c types.ConnectorClient, dbPath string, login string, email string, profile *structpb.Struct, resourceType string) *Provisioner { return &Provisioner{ - dbPath: dbPath, - connector: c, - createAccountLogin: login, - createAccountEmail: email, - createAccountProfile: profile, + dbPath: dbPath, + connector: c, + createAccountLogin: login, + createAccountEmail: email, + createAccountProfile: profile, + createAccountResourceType: resourceType, } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go index 5f7db3e1..ecef98b7 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go @@ -1,3 +1,3 @@ package sdk -const Version = "v0.6.8" +const Version = "v0.6.23" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go index 110efa35..8e175146 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -12,6 +12,8 @@ import ( "slices" "strconv" "strings" + native_sync "sync" + "sync/atomic" "time" "github.com/Masterminds/semver/v3" @@ -46,6 +48,39 @@ var tracer = otel.Tracer("baton-sdk/sync") var dontFixCycles, _ = strconv.ParseBool(os.Getenv("BATON_DONT_FIX_CYCLES")) var ErrSyncNotComplete = fmt.Errorf("sync exited without finishing") +var ErrTooManyWarnings = fmt.Errorf("too many warnings, exiting sync") +var ErrNoSyncIDFound = fmt.Errorf("no syncID found after starting or resuming sync") + +// IsSyncPreservable returns true if the error returned by Sync() means that the sync artifact is useful. +// This either means that there was no error, or that the error is recoverable (we can resume the sync and possibly succeed next time). +func IsSyncPreservable(err error) bool { + if err == nil { + return true + } + // ErrSyncNotComplete means we hit the run duration timeout. + // ErrTooManyWarnings means we hit too many warnings. + // Both are recoverable errors. + if errors.Is(err, ErrSyncNotComplete) || errors.Is(err, ErrTooManyWarnings) { + return true + } + statusErr, ok := status.FromError(err) + if !ok { + return false + } + switch statusErr.Code() { + case codes.OK, + codes.NotFound, + codes.PermissionDenied, + codes.ResourceExhausted, + codes.FailedPrecondition, + codes.Aborted, + codes.Unavailable, + codes.Unauthenticated: + return true + default: + return false + } +} type Syncer interface { Sync(context.Context) error @@ -220,6 +255,8 @@ type syncer struct { injectSyncIDAnnotation bool setSessionStore sessions.SetSessionStore syncResourceTypes []string + previousSyncMu native_sync.Mutex + previousSyncIDPtr atomic.Pointer[string] } const minCheckpointInterval = 10 * time.Second @@ -245,6 +282,33 @@ func (s *syncer) Checkpoint(ctx context.Context, force bool) error { return nil } +func (s *syncer) getPreviousFullSyncID(ctx context.Context) (string, error) { + if ptr := s.previousSyncIDPtr.Load(); ptr != nil { + return *ptr, nil + } + + s.previousSyncMu.Lock() + defer s.previousSyncMu.Unlock() + + if ptr := s.previousSyncIDPtr.Load(); ptr != nil { + return *ptr, nil + } + + psf, ok := s.store.(latestSyncFetcher) + if !ok { + empty := "" + s.previousSyncIDPtr.Store(&empty) + return "", nil + } + + previousSyncID, err := psf.LatestFinishedSync(ctx, connectorstore.SyncTypeFull) + if err == nil { + s.previousSyncIDPtr.Store(&previousSyncID) + } + + return previousSyncID, err +} + func (s *syncer) handleInitialActionForStep(ctx context.Context, a Action) { if s.transitionHandler != nil { s.transitionHandler(a) @@ -398,7 +462,7 @@ func (s *syncer) Sync(ctx context.Context) error { // Set the syncID on the wrapper after we have it if syncID == "" { - err = errors.New("no syncID found after starting or resuming sync") + err = ErrNoSyncIDFound l.Error("no syncID found after starting or resuming sync", zap.Error(err)) return err } @@ -473,7 +537,7 @@ func (s *syncer) Sync(ctx context.Context) error { if len(warnings) > 10 { completedActionsCount := s.state.GetCompletedActionsCount() if completedActionsCount > 0 && float64(len(warnings))/float64(completedActionsCount) > 0.1 { - return fmt.Errorf("too many warnings, exiting sync. warnings: %v completed actions: %d", warnings, completedActionsCount) + return fmt.Errorf("%w: warnings: %v completed actions: %d", ErrTooManyWarnings, warnings, completedActionsCount) } } select { @@ -843,6 +907,12 @@ func validateSyncResourceTypesFilter(resourceTypesFilter []string, validResource return nil } +func (s *syncer) hasChildResources(resource *v2.Resource) bool { + annos := annotations.Annotations(resource.GetAnnotations()) + + return annos.Contains((*v2.ChildResourceType)(nil)) +} + // getSubResources fetches the sub resource types from a resources' annotations. func (s *syncer) getSubResources(ctx context.Context, parent *v2.Resource) error { ctx, span := tracer.Start(ctx, "syncer.getSubResources") @@ -1064,21 +1134,38 @@ func (s *syncer) syncResources(ctx context.Context) error { bulkPutResoruces := []*v2.Resource{} for _, r := range resp.GetList() { + validatedResource := false + // Check if we've already synced this resource, skip it if we have _, err = s.store.GetResource(ctx, reader_v2.ResourcesReaderServiceGetResourceRequest_builder{ ResourceId: v2.ResourceId_builder{ResourceType: r.GetId().GetResourceType(), Resource: r.GetId().GetResource()}.Build(), }.Build()) if err == nil { - continue + err = s.validateResourceTraits(ctx, r) + if err != nil { + return err + } + validatedResource = true + + // We must *ALSO* check if we have any child resources. + if !s.hasChildResources(r) { + // Since we only have the resource type IDs of child resources, + // we can't tell if we already have synced those child resources. + // Those children may also have their own child resources, + // so we are conservative here and just re-sync this resource. + continue + } } - if !errors.Is(err, sql.ErrNoRows) { + if err != nil && !errors.Is(err, sql.ErrNoRows) { return err } - err = s.validateResourceTraits(ctx, r) - if err != nil { - return err + if !validatedResource { + err = s.validateResourceTraits(ctx, r) + if err != nil { + return err + } } // Set the resource creation source @@ -1860,14 +1947,9 @@ func (s *syncer) fetchResourceForPreviousSync(ctx context.Context, resourceID *v l := ctxzap.Extract(ctx) - var previousSyncID string - var err error - - if psf, ok := s.store.(latestSyncFetcher); ok { - previousSyncID, err = psf.LatestFinishedSync(ctx, connectorstore.SyncTypeFull) - if err != nil { - return "", nil, err - } + previousSyncID, err := s.getPreviousFullSyncID(ctx) + if err != nil { + return "", nil, err } if previousSyncID == "" { @@ -1932,6 +2014,7 @@ func (s *syncer) fetchEtaggedGrantsForResource( var ret []*v2.Grant // No previous etag, so an etag match is not possible + // TODO(kans): do the request again to get the grants, but this time don't use the etag match! if prevEtag == nil { return nil, false, errors.New("connector returned an etag match but there is no previous sync generation to use") } @@ -2886,14 +2969,14 @@ func (s *syncer) Close(ctx context.Context) error { var err error if s.store != nil { - err = s.store.Close() + err = s.store.Close(ctx) if err != nil { return fmt.Errorf("error closing store: %w", err) } } if s.externalResourceReader != nil { - err = s.externalResourceReader.Close() + err = s.externalResourceReader.Close(ctx) if err != nil { return fmt.Errorf("error closing external resource reader: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go index cb675996..00291d53 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" "github.com/conductorone/baton-sdk/pkg/connectorstore" "github.com/conductorone/baton-sdk/pkg/dotc1z" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" @@ -13,49 +14,40 @@ import ( type Compactor struct { base *dotc1z.C1File applied *dotc1z.C1File - dest *dotc1z.C1File } -func NewAttachedCompactor(base *dotc1z.C1File, applied *dotc1z.C1File, dest *dotc1z.C1File) *Compactor { +func NewAttachedCompactor(base *dotc1z.C1File, applied *dotc1z.C1File) *Compactor { return &Compactor{ base: base, applied: applied, - dest: dest, } } -func (c *Compactor) CompactWithSyncID(ctx context.Context, destSyncID string) error { - baseSyncID, err := c.base.LatestFinishedSyncID(ctx, connectorstore.SyncTypeAny) +func (c *Compactor) Compact(ctx context.Context) error { + baseSync, err := c.base.GetLatestFinishedSync(ctx, reader_v2.SyncsReaderServiceGetLatestFinishedSyncRequest_builder{ + SyncType: string(connectorstore.SyncTypeAny), + }.Build()) if err != nil { - return fmt.Errorf("failed to get base sync ID: %w", err) + return fmt.Errorf("failed to get base sync: %w", err) } - if baseSyncID == "" { + if baseSync == nil || baseSync.GetSync() == nil { return fmt.Errorf("no finished sync found in base") } - appliedSyncID, err := c.applied.LatestFinishedSyncID(ctx, connectorstore.SyncTypeAny) + appliedSync, err := c.applied.GetLatestFinishedSync(ctx, reader_v2.SyncsReaderServiceGetLatestFinishedSyncRequest_builder{ + SyncType: string(connectorstore.SyncTypeAny), + }.Build()) if err != nil { - return fmt.Errorf("failed to get applied sync ID: %w", err) + return fmt.Errorf("failed to get applied sync: %w", err) } - if appliedSyncID == "" { + if appliedSync == nil || appliedSync.GetSync() == nil { return fmt.Errorf("no finished sync found in applied") } - // Attach both the base and applied databases to the destination - base, err := c.dest.AttachFile(c.base, "base") - if err != nil { - return fmt.Errorf("failed to attach databases to destination: %w", err) - } l := ctxzap.Extract(ctx) - defer func() { - _, err := base.DetachFile("base") - if err != nil { - l.Error("failed to detach file", zap.Error(err)) - } - }() // Attach both the base and applied databases to the destination - attached, err := c.dest.AttachFile(c.applied, "attached") + attached, err := c.base.AttachFile(c.applied, "attached") if err != nil { return fmt.Errorf("failed to attach databases to destination: %w", err) } @@ -66,40 +58,36 @@ func (c *Compactor) CompactWithSyncID(ctx context.Context, destSyncID string) er } }() - // Drop grants indexes to improve performance. - err = c.dest.DropGrantIndexes(ctx) - if err != nil { - return fmt.Errorf("failed to drop grants indexes: %w", err) - } - - if err := c.processRecords(ctx, attached, destSyncID, baseSyncID, appliedSyncID); err != nil { + if err := c.processRecords(ctx, attached, baseSync.GetSync(), appliedSync.GetSync()); err != nil { return fmt.Errorf("failed to process records: %w", err) } - // Re-create the destination database to re-create the grant indexes. - err = c.dest.InitTables(ctx) - if err != nil { - return fmt.Errorf("failed to re-create destination database: %w", err) - } - return nil } -func (c *Compactor) processRecords(ctx context.Context, attached *dotc1z.C1FileAttached, destSyncID string, baseSyncID string, appliedSyncID string) error { +func (c *Compactor) processRecords(ctx context.Context, attached *dotc1z.C1FileAttached, baseSync *reader_v2.SyncRun, appliedSync *reader_v2.SyncRun) error { + baseSyncID := baseSync.GetId() + appliedSyncID := appliedSync.GetId() + + // Update the base sync type to the union of the base and applied sync types. + if err := attached.UpdateSync(ctx, baseSync, appliedSync); err != nil { + return fmt.Errorf("failed to update sync %s: %w", baseSyncID, err) + } + // Compact all tables: copy base records and merge newer applied records using raw SQL - if err := attached.CompactResourceTypes(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { + if err := attached.CompactResourceTypes(ctx, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to compact resource types: %w", err) } - if err := attached.CompactResources(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { + if err := attached.CompactResources(ctx, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to compact resources: %w", err) } - if err := attached.CompactEntitlements(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { + if err := attached.CompactEntitlements(ctx, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to compact entitlements: %w", err) } - if err := attached.CompactGrants(ctx, destSyncID, baseSyncID, appliedSyncID); err != nil { + if err := attached.CompactGrants(ctx, baseSyncID, appliedSyncID); err != nil { return fmt.Errorf("failed to compact grants: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go index dc8a070d..2dafb58d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go @@ -16,7 +16,6 @@ import ( "github.com/conductorone/baton-sdk/pkg/sdk" "github.com/conductorone/baton-sdk/pkg/sync" "github.com/conductorone/baton-sdk/pkg/synccompactor/attached" - "github.com/conductorone/baton-sdk/pkg/synccompactor/naive" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.opentelemetry.io/otel" "go.uber.org/zap" @@ -27,13 +26,13 @@ var tracer = otel.Tracer("baton-sdk/pkg.synccompactor") type CompactorType string const ( - CompactorTypeNaive CompactorType = "naive" CompactorTypeAttached CompactorType = "attached" ) type Compactor struct { compactorType CompactorType entries []*CompactableSync + compactedC1z *dotc1z.C1File tmpDir string destDir string @@ -136,65 +135,95 @@ func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { default: } - // Base sync is c.entries[0], so compact all incrementals first, then apply that onto the base. - applied := c.entries[len(c.entries)-1] - for i := len(c.entries) - 2; i >= 0; i-- { - applied, err = c.doOneCompaction(ctx, c.entries[i], applied) - if err != nil { - return nil, err - } + opts := []dotc1z.C1ZOption{ + dotc1z.WithTmpDir(c.tmpDir), + // Performance improvements: + // NOTE: We do not close this c1z after compaction, so syncer will have these pragmas when expanding grants. + // We should re-evaluate these pragmas when partial syncs sync grants. + // Disable journaling. + dotc1z.WithPragma("journal_mode", "OFF"), + // Disable synchronous writes + dotc1z.WithPragma("synchronous", "OFF"), + // Use exclusive locking. + dotc1z.WithPragma("main.locking_mode", "EXCLUSIVE"), + // Use parallel decoding. + dotc1z.WithDecoderOptions(dotc1z.WithDecoderConcurrency(-1)), + // Use parallel encoding. + dotc1z.WithEncoderConcurrency(0), } - // Grant expansion doesn't use the connector interface at all, so giving syncer an empty connector is safe... for now. - // If that ever changes, we should implement a file connector that is a wrapper around the reader. - emptyConnector, err := sdk.NewEmptyConnector() + fileName := fmt.Sprintf("compacted-%s.c1z", c.entries[0].SyncID) + destFilePath := path.Join(c.tmpDir, fileName) + + c.compactedC1z, err = dotc1z.NewC1ZFile(ctx, destFilePath, opts...) if err != nil { - l.Error("error creating empty connector", zap.Error(err)) + l.Error("doOneCompaction failed: could not create c1z file", zap.Error(err)) return nil, err } - - // Use syncer to expand grants. - // TODO: Handle external resources. - syncOpts := []sync.SyncOpt{ - sync.WithC1ZPath(applied.FilePath), - sync.WithTmpDir(c.tmpDir), - sync.WithSyncID(applied.SyncID), - sync.WithOnlyExpandGrants(), + defer func() { + if c.compactedC1z == nil { + return + } + err := c.compactedC1z.Close(ctx) + if err != nil { + l.Error("error closing compacted c1z", zap.Error(err)) + } + }() + // Start new sync of type partial. If we compact syncs of other types, this sync type will be updated by attached.UpdateSync which is called by doOneCompaction(). + newSyncId, err := c.compactedC1z.StartNewSync(ctx, connectorstore.SyncTypePartial, "") + if err != nil { + return nil, fmt.Errorf("failed to start new sync: %w", err) } + err = c.compactedC1z.EndSync(ctx) + if err != nil { + return nil, fmt.Errorf("failed to end sync: %w", err) + } + l.Debug("new empty partial sync created", zap.String("sync_id", newSyncId)) - compactionDuration := time.Since(compactionStart) - runDuration := c.runDuration - compactionDuration - l.Debug("finished compaction", zap.Duration("compaction_duration", compactionDuration)) - - switch { - case c.runDuration > 0 && runDuration < 0: - return nil, fmt.Errorf("unable to finish compaction sync in run duration (%s). compactions took %s", c.runDuration, compactionDuration) - case runDuration > 0: - syncOpts = append(syncOpts, sync.WithRunDuration(runDuration)) + // Base sync is c.entries[0], so compact in reverse order. That way we compact the biggest sync last. + for i := len(c.entries) - 1; i >= 0; i-- { + err = c.doOneCompaction(ctx, c.entries[i]) + if err != nil { + return nil, fmt.Errorf("failed to compact sync %s: %w", c.entries[i].SyncID, err) + } } - syncer, err := sync.NewSyncer( - ctx, - emptyConnector, - syncOpts..., - ) + resp, err := c.compactedC1z.GetSync(ctx, reader_v2.SyncsReaderServiceGetSyncRequest_builder{ + SyncId: newSyncId, + }.Build()) if err != nil { - l.Error("error creating syncer", zap.Error(err)) - return nil, err + return nil, fmt.Errorf("failed to get sync: %w", err) + } + newSync := resp.GetSync() + if newSync == nil { + return nil, fmt.Errorf("no sync found") } - if err := syncer.Sync(ctx); err != nil { - l.Error("error syncing with grant expansion", zap.Error(err)) - return nil, err + if newSync.GetId() != newSyncId { + return nil, fmt.Errorf("new sync id does not match expected id: %s != %s", newSync.GetId(), newSyncId) } - if err := syncer.Close(ctx); err != nil { - l.Error("error closing syncer", zap.Error(err)) - return nil, err + + if newSync.GetSyncType() == string(connectorstore.SyncTypePartial) { + err = c.compactedC1z.Cleanup(ctx) + if err != nil { + return nil, fmt.Errorf("failed to cleanup compacted c1z: %w", err) + } + // Close compactedC1z so that the c1z file is written to disk before cpFile() is called. + err = c.compactedC1z.Close(ctx) + if err != nil { + return nil, fmt.Errorf("failed to close compacted c1z: %w", err) + } + c.compactedC1z = nil + } else { + err = c.expandGrants(ctx, newSyncId, compactionStart) + if err != nil { + return nil, fmt.Errorf("failed to expand grants: %w", err) + } } // Move last compacted file to the destination dir - finalPath := path.Join(c.destDir, fmt.Sprintf("compacted-%s.c1z", applied.SyncID)) - if err := cpFile(applied.FilePath, finalPath); err != nil { + finalPath := path.Join(c.destDir, fmt.Sprintf("compacted-%s.c1z", newSyncId)) + if err := cpFile(ctx, destFilePath, finalPath); err != nil { return nil, err } @@ -205,10 +234,18 @@ func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { } finalPath = abs } - return &CompactableSync{FilePath: finalPath, SyncID: applied.SyncID}, nil + return &CompactableSync{FilePath: finalPath, SyncID: newSyncId}, nil } -func cpFile(sourcePath string, destPath string) error { +func cpFile(ctx context.Context, sourcePath string, destPath string) error { + err := os.Rename(sourcePath, destPath) + if err == nil { + return nil + } + + l := ctxzap.Extract(ctx) + l.Warn("compactor: failed to rename final compacted file, falling back to copy", zap.Error(err), zap.String("source_path", sourcePath), zap.String("dest_path", destPath)) + source, err := os.Open(sourcePath) if err != nil { return fmt.Errorf("failed to open source file: %w", err) @@ -229,136 +266,94 @@ func cpFile(sourcePath string, destPath string) error { return nil } -func (c *Compactor) getLatestObjects(ctx context.Context, info *CompactableSync) (*reader_v2.SyncRun, *dotc1z.C1File, func(), error) { - cleanup := func() {} +func (c *Compactor) doOneCompaction(ctx context.Context, cs *CompactableSync) error { + ctx, span := tracer.Start(ctx, "Compactor.doOneCompaction") + defer span.End() + l := ctxzap.Extract(ctx) + l.Info( + "running compaction", + zap.String("apply_file", cs.FilePath), + zap.String("apply_sync", cs.SyncID), + zap.String("tmp_dir", c.tmpDir), + ) - baseFile, err := dotc1z.NewC1ZFile( + applyFile, err := dotc1z.NewC1ZFile( ctx, - info.FilePath, + cs.FilePath, dotc1z.WithTmpDir(c.tmpDir), - dotc1z.WithDecoderOptions(dotc1z.WithDecoderConcurrency(0)), + dotc1z.WithDecoderOptions(dotc1z.WithDecoderConcurrency(-1)), dotc1z.WithReadOnly(true), // We're only reading, so it's safe to use these pragmas. - dotc1z.WithPragma("journal_mode", "OFF"), dotc1z.WithPragma("synchronous", "OFF"), + dotc1z.WithPragma("journal_mode", "OFF"), + dotc1z.WithPragma("locking_mode", "EXCLUSIVE"), ) if err != nil { - return nil, nil, cleanup, err - } - - cleanup = func() { - _ = baseFile.Close() + return err } + defer func() { + err := applyFile.Close(ctx) + if err != nil { + l.Error("error closing apply file", zap.Error(err), zap.String("apply_file", cs.FilePath)) + } + }() - latestAppliedSync, err := baseFile.GetSync(ctx, reader_v2.SyncsReaderServiceGetSyncRequest_builder{ - SyncId: info.SyncID, - Annotations: nil, - }.Build()) - if err != nil { - return nil, nil, cleanup, err + runner := attached.NewAttachedCompactor(c.compactedC1z, applyFile) + if err := runner.Compact(ctx); err != nil { + l.Error("error running compaction", zap.Error(err), zap.String("apply_file", cs.FilePath)) + return err } - return latestAppliedSync.GetSync(), baseFile, cleanup, nil -} - -func unionSyncTypes(a, b connectorstore.SyncType) connectorstore.SyncType { - switch { - case a == connectorstore.SyncTypeFull || b == connectorstore.SyncTypeFull: - return connectorstore.SyncTypeFull - case a == connectorstore.SyncTypeResourcesOnly || b == connectorstore.SyncTypeResourcesOnly: - return connectorstore.SyncTypeResourcesOnly - default: - return connectorstore.SyncTypePartial - } + return nil } -func (c *Compactor) doOneCompaction(ctx context.Context, base *CompactableSync, applied *CompactableSync) (*CompactableSync, error) { - ctx, span := tracer.Start(ctx, "Compactor.doOneCompaction") - defer span.End() +func (c *Compactor) expandGrants(ctx context.Context, newSyncId string, compactionStart time.Time) error { l := ctxzap.Extract(ctx) - l.Info( - "running compaction", - zap.String("base_file", base.FilePath), - zap.String("base_sync", base.SyncID), - zap.String("applied_file", applied.FilePath), - zap.String("applied_sync", applied.SyncID), - zap.String("tmp_dir", c.tmpDir), - ) - opts := []dotc1z.C1ZOption{ - dotc1z.WithTmpDir(c.tmpDir), - // Performance improvements: - // Disable journaling. - dotc1z.WithPragma("journal_mode", "OFF"), - // Disable synchronous writes - dotc1z.WithPragma("synchronous", "OFF"), - // Use exclusive locking. - dotc1z.WithPragma("main.locking_mode", "EXCLUSIVE"), - // Use memory for temporary storage. - dotc1z.WithPragma("temp_store", "MEMORY"), - // We close this c1z after compaction, so syncer won't have these pragmas when expanding grants. - // Use parallel decoding. - dotc1z.WithDecoderOptions(dotc1z.WithDecoderConcurrency(0)), - // Use parallel encoding. - dotc1z.WithEncoderConcurrency(0), - } - - fileName := fmt.Sprintf("compacted-%s-%s.c1z", base.SyncID, applied.SyncID) - newFile, err := dotc1z.NewC1ZFile(ctx, path.Join(c.tmpDir, fileName), opts...) - if err != nil { - l.Error("doOneCompaction failed: could not create c1z file", zap.Error(err)) - return nil, err - } - defer func() { _ = newFile.Close() }() - - baseSync, baseFile, cleanupBase, err := c.getLatestObjects(ctx, base) - defer cleanupBase() + // Grant expansion doesn't use the connector interface at all, so giving syncer an empty connector is safe... for now. + // If that ever changes, we should implement a file connector that is a wrapper around the reader. + emptyConnector, err := sdk.NewEmptyConnector() if err != nil { - return nil, err + l.Error("error creating empty connector", zap.Error(err)) + return err } - appliedSync, appliedFile, cleanupApplied, err := c.getLatestObjects(ctx, applied) - defer cleanupApplied() - if err != nil { - return nil, err + // Use syncer to expand grants. + // TODO: Handle external resources. + syncOpts := []sync.SyncOpt{ + sync.WithConnectorStore(c.compactedC1z), // Use the existing C1File so we're not wasting time compressing & decompressing it. + sync.WithTmpDir(c.tmpDir), + sync.WithSyncID(newSyncId), + sync.WithOnlyExpandGrants(), } - syncType := unionSyncTypes(connectorstore.SyncType(baseSync.GetSyncType()), connectorstore.SyncType(appliedSync.GetSyncType())) + compactionDuration := time.Since(compactionStart) + runDuration := c.runDuration - compactionDuration + l.Debug("finished compaction", zap.Duration("compaction_duration", compactionDuration)) - newSyncId, err := newFile.StartNewSync(ctx, syncType, "") - if err != nil { - return nil, err + switch { + case c.runDuration > 0 && runDuration <= 0: + return fmt.Errorf("unable to finish compaction sync in run duration (%s). compactions took %s", c.runDuration, compactionDuration) + case runDuration > 0: + syncOpts = append(syncOpts, sync.WithRunDuration(runDuration)) } - switch c.compactorType { - case CompactorTypeNaive: - // TODO: Add support for syncID or remove naive compactor. - runner := naive.NewNaiveCompactor(baseFile, appliedFile, newFile) - if err := runner.Compact(ctx); err != nil { - l.Error("error running compaction", zap.Error(err)) - return nil, err - } - case CompactorTypeAttached: - runner := attached.NewAttachedCompactor(baseFile, appliedFile, newFile) - if err := runner.CompactWithSyncID(ctx, newSyncId); err != nil { - l.Error("error running compaction", zap.Error(err)) - return nil, err - } - default: - // c.compactorType defaults to attached, so this should never happen. - return nil, fmt.Errorf("invalid compactor type: %s", c.compactorType) + syncer, err := sync.NewSyncer( + ctx, + emptyConnector, + syncOpts..., + ) + if err != nil { + l.Error("error creating syncer", zap.Error(err)) + return err } - if err := newFile.EndSync(ctx); err != nil { - return nil, err + if err := syncer.Sync(ctx); err != nil { + l.Error("error syncing with grant expansion", zap.Error(err)) + return err } - - outputFilepath, err := newFile.OutputFilepath() - if err != nil { - return nil, err + if err := syncer.Close(ctx); err != nil { + l.Error("error closing syncer", zap.Error(err)) + return err } - - return &CompactableSync{ - FilePath: outputFilepath, - SyncID: newSyncId, - }, nil + return nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/create_account.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/create_account.go index eb45b3c4..f9e5255f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/create_account.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/create_account.go @@ -45,6 +45,7 @@ func (g *createAccountTaskHandler) HandleTask(ctx context.Context) error { AccountInfo: t.GetAccountInfo(), CredentialOptions: t.GetCredentialOptions(), EncryptionConfigs: t.GetEncryptionConfigs(), + ResourceTypeId: t.GetResourceTypeId(), }.Build()) if err != nil { l.Error("failed creating account", zap.Error(err)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go index 7d507117..bb581b9b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/local/accounter.go @@ -18,9 +18,10 @@ type localAccountManager struct { dbPath string o sync.Once - login string - email string - profile *structpb.Struct + login string + email string + profile *structpb.Struct + resourceTypeId string } func (m *localAccountManager) GetTempDir() string { @@ -35,7 +36,9 @@ func (m *localAccountManager) Next(ctx context.Context) (*v1.Task, time.Duration var task *v1.Task m.o.Do(func() { task = v1.Task_builder{ - CreateAccount: &v1.Task_CreateAccountTask{}, + CreateAccount: &v1.Task_CreateAccountTask{ + ResourceTypeId: m.resourceTypeId, + }, }.Build() }) return task, 0, nil @@ -45,7 +48,7 @@ func (m *localAccountManager) Process(ctx context.Context, task *v1.Task, cc typ ctx, span := tracer.Start(ctx, "localAccountManager.Process", trace.WithNewRoot()) defer span.End() - accountManager := provisioner.NewCreateAccountManager(cc, m.dbPath, m.login, m.email, m.profile) + accountManager := provisioner.NewCreateAccountManager(cc, m.dbPath, m.login, m.email, m.profile, m.resourceTypeId) err := accountManager.Run(ctx) if err != nil { @@ -60,12 +63,13 @@ func (m *localAccountManager) Process(ctx context.Context, task *v1.Task, cc typ return nil } -// NewGranter returns a task manager that queues a sync task. -func NewCreateAccountManager(ctx context.Context, dbPath string, login string, email string, profile *structpb.Struct) tasks.Manager { +// NewCreateAccountManager returns a task manager that queues a create account task. +func NewCreateAccountManager(ctx context.Context, dbPath string, login string, email string, profile *structpb.Struct, resourceTypeId string) tasks.Manager { return &localAccountManager{ - dbPath: dbPath, - login: login, - email: email, - profile: profile, + dbPath: dbPath, + login: login, + email: email, + profile: profile, + resourceTypeId: resourceTypeId, } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go index 8715c825..7a441a12 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/entitlement/entitlement.go @@ -32,6 +32,12 @@ func WithDisplayName(displayName string) EntitlementOption { } } +func WithSlug(slug string) EntitlementOption { + return func(g *v2.Entitlement) { + g.SetSlug(slug) + } +} + func WithDescription(description string) EntitlementOption { return func(g *v2.Entitlement) { g.SetDescription(description) @@ -72,6 +78,21 @@ func NewAssignmentEntitlement(resource *v2.Resource, name string, entitlementOpt return entitlement } +func NewOwnershipEntitlement(resource *v2.Resource, name string, entitlementOptions ...EntitlementOption) *v2.Entitlement { + entitlement := v2.Entitlement_builder{ + Id: NewEntitlementID(resource, name), + DisplayName: name, + Slug: name, + Purpose: v2.Entitlement_PURPOSE_VALUE_OWNERSHIP, + Resource: resource, + }.Build() + + for _, entitlementOption := range entitlementOptions { + entitlementOption(entitlement) + } + return entitlement +} + func NewEntitlement(resource *v2.Resource, name, purposeStr string, entitlementOptions ...EntitlementOption) *v2.Entitlement { var purpose v2.Entitlement_PurposeValue switch purposeStr { @@ -79,6 +100,8 @@ func NewEntitlement(resource *v2.Resource, name, purposeStr string, entitlementO purpose = v2.Entitlement_PURPOSE_VALUE_PERMISSION case "assignment": purpose = v2.Entitlement_PURPOSE_VALUE_ASSIGNMENT + case "ownership": + purpose = v2.Entitlement_PURPOSE_VALUE_OWNERSHIP default: purpose = v2.Entitlement_PURPOSE_VALUE_UNSPECIFIED } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go index 9b8218d3..939bb8f2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go @@ -13,22 +13,42 @@ import ( // SecurityInsightTraitOption is a functional option for configuring a SecurityInsightTrait. type SecurityInsightTraitOption func(*v2.SecurityInsightTrait) error -// WithInsightType sets the insight type. This is typically set via NewSecurityInsightTrait, -// but can be used to override or update the type on an existing trait. -func WithInsightType(insightType string) SecurityInsightTraitOption { +// WithRiskScore sets the insight type to risk score with the given value. +func WithRiskScore(value string) SecurityInsightTraitOption { return func(t *v2.SecurityInsightTrait) error { - if insightType == "" { - return fmt.Errorf("insight type cannot be empty") + if value == "" { + return fmt.Errorf("risk score value cannot be empty") } - t.SetInsightType(insightType) + t.SetRiskScore(&v2.RiskScore{ + Value: value, + }) return nil } } -// WithInsightValue sets the value of the security insight. -func WithInsightValue(value string) SecurityInsightTraitOption { +// WithIssue sets the insight type to issue with the given value. +func WithIssue(value string) SecurityInsightTraitOption { return func(t *v2.SecurityInsightTrait) error { - t.SetValue(value) + if value == "" { + return fmt.Errorf("issue value cannot be empty") + } + issue := &v2.Issue{ + Value: value, + } + t.SetIssue(issue) + return nil + } +} + +// WithIssueSeverity sets or updates the severity on an issue insight. +// This should be used after WithIssue or on an existing issue insight. +func WithIssueSeverity(severity string) SecurityInsightTraitOption { + return func(t *v2.SecurityInsightTrait) error { + issue := t.GetIssue() + if issue == nil { + return fmt.Errorf("cannot set severity: insight is not an issue type (use WithIssue first)") + } + issue.SetSeverity(severity) return nil } } @@ -73,23 +93,38 @@ func WithInsightExternalResourceTarget(externalId string, appHint string) Securi } } -// NewSecurityInsightTrait creates a new SecurityInsightTrait with the given insight type and options. -func NewSecurityInsightTrait(insightType string, opts ...SecurityInsightTraitOption) (*v2.SecurityInsightTrait, error) { - if insightType == "" { - return nil, fmt.Errorf("insight type cannot be empty") +// NewSecurityInsightTrait creates a new SecurityInsightTrait with the given options. +// You must provide either WithRiskScore or WithIssue to set the insight type. +// +// Example usage: +// +// trait, err := NewSecurityInsightTrait( +// WithIssue("CVE-2024-1234", "Critical"), +// WithInsightUserTarget("user@example.com")) +// +// trait, err := NewSecurityInsightTrait( +// WithRiskScore("85"), +// WithInsightResourceTarget(resourceId)) +func NewSecurityInsightTrait(opts ...SecurityInsightTraitOption) (*v2.SecurityInsightTrait, error) { + trait := &v2.SecurityInsightTrait{ + ObservedAt: timestamppb.Now(), } - trait := v2.SecurityInsightTrait_builder{ - InsightType: insightType, - ObservedAt: timestamppb.Now(), - }.Build() - for _, opt := range opts { if err := opt(trait); err != nil { return nil, err } } + // Validate that an insight type was set + if trait.GetRiskScore() == nil && trait.GetIssue() == nil { + return nil, fmt.Errorf("insight type must be set (use WithRiskScore or WithIssue)") + } + + if trait.GetTarget() == nil { + return nil, fmt.Errorf("target must be set (use WithInsightUserTarget, WithInsightResourceTarget, WithInsightExternalResourceTarget, or WithInsightAppUserTarget)") + } + return trait, nil } @@ -109,10 +144,20 @@ func GetSecurityInsightTrait(resource *v2.Resource) (*v2.SecurityInsightTrait, e } // WithSecurityInsightTrait adds or updates a SecurityInsightTrait annotation on a resource. -// The insightType parameter is required to ensure the trait is always valid. +// The insight type (risk score or issue) must be set via the provided options. // If the resource already has a SecurityInsightTrait, it will be updated with the provided options. -// If not, a new trait will be created with the given insightType. -func WithSecurityInsightTrait(insightType string, opts ...SecurityInsightTraitOption) ResourceOption { +// If not, a new trait will be created. +// +// Example usage: +// +// resource, err := NewResource( +// "Security Finding", +// resourceType, +// objectID, +// WithSecurityInsightTrait( +// WithIssue("CVE-2024-1234", "Critical"), +// WithInsightUserTarget("user@example.com"))) +func WithSecurityInsightTrait(opts ...SecurityInsightTraitOption) ResourceOption { return func(r *v2.Resource) error { t := &v2.SecurityInsightTrait{} annos := annotations.Annotations(r.GetAnnotations()) @@ -122,16 +167,9 @@ func WithSecurityInsightTrait(insightType string, opts ...SecurityInsightTraitOp } if !existing { - // Creating a new trait - insightType is required - if insightType == "" { - return fmt.Errorf("insight type is required when creating a new security insight trait") - } - t.SetInsightType(insightType) - } else if insightType != "" { - // Updating existing trait with a new type - t.SetInsightType(insightType) + // Creating a new trait - set default observation time + t.SetObservedAt(timestamppb.Now()) } - // If existing and insightType is empty, keep the existing type for _, o := range opts { if err := o(t); err != nil { @@ -139,6 +177,11 @@ func WithSecurityInsightTrait(insightType string, opts ...SecurityInsightTraitOp } } + // Validate that an insight type was set + if t.GetRiskScore() == nil && t.GetIssue() == nil { + return fmt.Errorf("insight type must be set (use WithRiskScore or WithIssue)") + } + annos.Update(t) r.SetAnnotations(annos) @@ -146,96 +189,89 @@ func WithSecurityInsightTrait(insightType string, opts ...SecurityInsightTraitOp } } -// NewUserSecurityInsightResource creates a security insight resource targeting a user by email. -// Use this when the insight should be resolved to a C1 User by Uplift. -func NewUserSecurityInsightResource( +// NewSecurityInsightResource creates a security insight resource with the given trait options. +// This is a flexible constructor that uses the options pattern to configure all aspects of the insight. +// +// Example usage: +// +// // Risk score for a user +// resource, err := NewSecurityInsightResource( +// "User Risk Score", +// securityInsightResourceType, +// "user-123", +// WithRiskScore("85"), +// WithInsightUserTarget("user@example.com")) +// +// // Issue with severity for a resource +// resource, err := NewSecurityInsightResource( +// "Critical Vulnerability", +// securityInsightResourceType, +// "vuln-456", +// WithIssue("CVE-2024-1234", "Critical"), +// WithInsightResourceTarget(resourceId)) +// +// // Issue for external resource with custom observation time +// resource, err := NewSecurityInsightResource( +// "AWS Security Finding", +// securityInsightResourceType, +// "finding-789", +// WithIssue("S3 bucket publicly accessible"), +// WithIssueSeverity("High"), +// WithInsightExternalResourceTarget("arn:aws:s3:::my-bucket", "aws"), +// WithInsightObservedAt(time.Now())) +func NewSecurityInsightResource( name string, resourceType *v2.ResourceType, objectID interface{}, - insightType string, - value string, - userEmail string, - traitOpts []SecurityInsightTraitOption, - opts ...ResourceOption, + traitOpts ...SecurityInsightTraitOption, ) (*v2.Resource, error) { - allTraitOpts := append([]SecurityInsightTraitOption{ - WithInsightValue(value), - WithInsightUserTarget(userEmail), - }, traitOpts...) - - trait, err := NewSecurityInsightTrait(insightType, allTraitOpts...) + trait, err := NewSecurityInsightTrait(traitOpts...) if err != nil { return nil, err } - opts = append(opts, WithAnnotation(trait)) - - return NewResource(name, resourceType, objectID, opts...) + return NewResource(name, resourceType, objectID, WithAnnotation(trait)) } -// NewResourceSecurityInsightResource creates a security insight resource with a direct resource reference. -// Use this when the connector knows the actual resource (synced by this connector). -func NewResourceSecurityInsightResource( - name string, - resourceType *v2.ResourceType, - objectID interface{}, - insightType string, - value string, - targetResourceId *v2.ResourceId, - traitOpts []SecurityInsightTraitOption, - opts ...ResourceOption, -) (*v2.Resource, error) { - allTraitOpts := append([]SecurityInsightTraitOption{ - WithInsightValue(value), - WithInsightResourceTarget(targetResourceId), - }, traitOpts...) - - trait, err := NewSecurityInsightTrait(insightType, allTraitOpts...) - if err != nil { - return nil, err +// IsSecurityInsightResource checks if a resource type has the TRAIT_SECURITY_INSIGHT trait. +func IsSecurityInsightResource(resourceType *v2.ResourceType) bool { + for _, trait := range resourceType.GetTraits() { + if trait == v2.ResourceType_TRAIT_SECURITY_INSIGHT { + return true + } } + return false +} - opts = append(opts, WithAnnotation(trait)) +// --- Insight type checkers --- - return NewResource(name, resourceType, objectID, opts...) +// IsRiskScore returns true if the insight is a risk score. +func IsRiskScore(trait *v2.SecurityInsightTrait) bool { + return trait.GetRiskScore() != nil } -// NewExternalResourceSecurityInsightResource creates a security insight resource targeting an external resource. -// Use this when the connector only has an external ID (e.g., ARN) and needs Uplift to resolve it. -func NewExternalResourceSecurityInsightResource( - name string, - resourceType *v2.ResourceType, - objectID interface{}, - insightType string, - value string, - targetExternalId string, - targetAppHint string, - traitOpts []SecurityInsightTraitOption, - opts ...ResourceOption, -) (*v2.Resource, error) { - allTraitOpts := append([]SecurityInsightTraitOption{ - WithInsightValue(value), - WithInsightExternalResourceTarget(targetExternalId, targetAppHint), - }, traitOpts...) +// IsIssue returns true if the insight is an issue. +func IsIssue(trait *v2.SecurityInsightTrait) bool { + return trait.GetIssue() != nil +} - trait, err := NewSecurityInsightTrait(insightType, allTraitOpts...) - if err != nil { - return nil, err +// GetInsightValue returns the value of the insight (either risk score or issue). +func GetInsightValue(trait *v2.SecurityInsightTrait) string { + if rs := trait.GetRiskScore(); rs != nil { + return rs.GetValue() } - - opts = append(opts, WithAnnotation(trait)) - - return NewResource(name, resourceType, objectID, opts...) + if issue := trait.GetIssue(); issue != nil { + return issue.GetValue() + } + return "" } -// IsSecurityInsightResource checks if a resource type has the TRAIT_SECURITY_INSIGHT trait. -func IsSecurityInsightResource(resourceType *v2.ResourceType) bool { - for _, trait := range resourceType.GetTraits() { - if trait == v2.ResourceType_TRAIT_SECURITY_INSIGHT { - return true - } +// GetIssueSeverity returns the severity of an issue insight, or empty string if not set or not an issue. +func GetIssueSeverity(trait *v2.SecurityInsightTrait) string { + if issue := trait.GetIssue(); issue != nil { + return issue.GetSeverity() } - return false + return "" } // --- Target type checkers --- diff --git a/vendor/modules.txt b/vendor/modules.txt index b9cff5c8..04dbd5ed 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -159,7 +159,7 @@ github.com/benbjohnson/clock # github.com/cenkalti/backoff/v4 v4.3.0 ## explicit; go 1.18 github.com/cenkalti/backoff/v4 -# github.com/conductorone/baton-sdk v0.6.9 +# github.com/conductorone/baton-sdk v0.6.24 ## explicit; go 1.25.2 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 @@ -204,7 +204,6 @@ github.com/conductorone/baton-sdk/pkg/sync/expand github.com/conductorone/baton-sdk/pkg/sync/expand/scc github.com/conductorone/baton-sdk/pkg/synccompactor github.com/conductorone/baton-sdk/pkg/synccompactor/attached -github.com/conductorone/baton-sdk/pkg/synccompactor/naive github.com/conductorone/baton-sdk/pkg/tasks github.com/conductorone/baton-sdk/pkg/tasks/c1api github.com/conductorone/baton-sdk/pkg/tasks/local From 8344244c6a449f43740a5d9825758a47189193c0 Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Wed, 28 Jan 2026 16:38:50 +0530 Subject: [PATCH 08/22] more updates --- go.mod | 2 +- go.sum | 4 +- pkg/connector/team.go | 150 +++++-- .../baton-sdk/pb/c1/config/v1/rules.pb.go | 125 +++++- .../pb/c1/config/v1/rules.pb.validate.go | 14 + .../pb/c1/config/v1/rules_protoopaque.pb.go | 126 +++++- .../pb/c1/connector/v2/annotation_trait.pb.go | 396 ++++++++++++++--- .../v2/annotation_trait_protoopaque.pb.go | 397 +++++++++++++++--- .../pb/c1/connector/v2/resource.pb.go | 65 ++- .../connector/v2/resource_protoopaque.pb.go | 37 +- .../baton-sdk/pkg/actions/actions.go | 2 +- .../baton-sdk/pkg/cli/commands.go | 82 +++- .../baton-sdk/pkg/config/config.go | 25 +- .../pkg/connectorbuilder/accounts.go | 28 +- .../baton-sdk/pkg/connectorbuilder/actions.go | 8 +- .../pkg/connectorbuilder/connectorbuilder.go | 10 +- .../pkg/connectorbuilder/credentials.go | 13 +- .../baton-sdk/pkg/connectorbuilder/events.go | 2 +- .../pkg/connectorbuilder/resource_manager.go | 21 +- .../connectorbuilder/resource_provisioner.go | 16 +- .../pkg/connectorbuilder/resource_syncer.go | 76 ++-- .../baton-sdk/pkg/connectorbuilder/tickets.go | 64 +-- .../baton-sdk/pkg/connectorrunner/runner.go | 108 +++-- .../baton-sdk/pkg/dotc1z/c1file.go | 24 ++ .../baton-sdk/pkg/dotc1z/c1file_attached.go | 227 +++++++++- .../baton-sdk/pkg/dotc1z/session_store.go | 6 +- .../baton-sdk/pkg/dotc1z/sql_helpers.go | 7 +- .../baton-sdk/pkg/dotc1z/sync_runs.go | 134 ++++-- .../baton-sdk/pkg/provisioner/provisioner.go | 4 +- .../conductorone/baton-sdk/pkg/sdk/version.go | 2 +- .../conductorone/baton-sdk/pkg/sync/syncer.go | 3 - .../pkg/synccompactor/attached/attached.go | 56 ++- .../baton-sdk/pkg/synccompactor/compactor.go | 11 + .../baton-sdk/pkg/tasks/c1api/actions.go | 17 + .../baton-sdk/pkg/types/grant/grant.go | 3 +- .../baton-sdk/pkg/types/resource/resource.go | 56 ++- .../pkg/types/resource/role_trait.go | 22 +- vendor/modules.txt | 2 +- 38 files changed, 1938 insertions(+), 407 deletions(-) diff --git a/go.mod b/go.mod index ee1d2d76..e8784351 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/conductorone/baton-github go 1.25.2 require ( - github.com/conductorone/baton-sdk v0.6.24 + github.com/conductorone/baton-sdk v0.7.4 github.com/deckarep/golang-set/v2 v2.8.0 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/golang-jwt/jwt/v5 v5.2.2 diff --git a/go.sum b/go.sum index 6aa1b6e0..45ac2db2 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/conductorone/baton-sdk v0.6.24 h1:0Uc0+EyJZx36a6XEoLurqsW2z/2yJVtMYxvMOn1CEf4= -github.com/conductorone/baton-sdk v0.6.24/go.mod h1:9S5feBOuIJxlNdGmkv3ObkCNHbVyOHr6foNrIrk+d4Y= +github.com/conductorone/baton-sdk v0.7.4 h1:JD79NYgIficX00ucugU/5//r2rpGPNqAsHlZsgE0GCM= +github.com/conductorone/baton-sdk v0.7.4/go.mod h1:9S5feBOuIJxlNdGmkv3ObkCNHbVyOHr6foNrIrk+d4Y= github.com/conductorone/dpop v0.2.3 h1:s91U3845GHQ6P6FWrdNr2SEOy1ES/jcFs1JtKSl2S+o= github.com/conductorone/dpop v0.2.3/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s= github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 h1:kLMCNIh0Mo2vbvvkCmJ3ixsPbXEJ6HPcW53Ku9yje3s= diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 92512e76..f220f884 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -390,34 +390,46 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr { Name: "name", DisplayName: "Team Name", - Description: "The name of the team to create", + Description: "The name of the team.", Field: &config.Field_StringField{}, IsRequired: true, }, { - Name: "parent", - DisplayName: "Parent Organization", - Description: "The organization to create the team in", - Field: &config.Field_ResourceIdField{ + Name: "description", + DisplayName: "Description", + Description: "The description of the team.", + Field: &config.Field_StringField{}, + }, + { + Name: "org", + DisplayName: "Organization", + Description: "The organization name. The name is not case sensitive.", + Field: &config.Field_ResourceIdField{ ResourceIdField: &config.ResourceIdField{ Rules: &config.ResourceIDRules{ AllowedResourceTypeIds: []string{resourceTypeOrg.Id}, }, }, }, - IsRequired: true, + IsRequired: true, }, { - Name: "description", - DisplayName: "Description", - Description: "A description of the team", - Field: &config.Field_StringField{}, + Name: "parent", + DisplayName: "Parent Team ID", + Description: "The name of a team to set as the parent team.", + Field: &config.Field_ResourceIdField{ + ResourceIdField: &config.ResourceIdField{ + Rules: &config.ResourceIDRules{ + AllowedResourceTypeIds: []string{resourceTypeTeam.Id}, + }, + }, + }, }, { Name: "privacy", DisplayName: "Privacy", - Description: "The privacy level: 'secret' or 'closed'", - Field: &config.Field_StringField{ + Description: "The privacy level of the team", + Field: &config.Field_StringField{ StringField: &config.StringField{ Options: []*config.StringFieldOption{ {Value: "secret", DisplayName: "Secret (only visible to org owners and team members)"}, @@ -427,14 +439,35 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr }, }, { - Name: "notification_setting", - DisplayName: "Notification Setting", - Description: "The notification setting for the team", - Field: &config.Field_StringField{ - StringField: &config.StringField{ - Options: []*config.StringFieldOption{ - {Value: "notifications_enabled", DisplayName: "Enabled"}, - {Value: "notifications_disabled", DisplayName: "Disabled"}, + Name: "notifications_enabled", + DisplayName: "Team Notifications", + Description: "Enable team notifications. When enabled, team members receive notifications when the team is @mentioned. Default: enabled", + Field: &config.Field_BoolField{ + BoolField: &config.BoolField{ + DefaultValue: true, + }, + }, + }, + { + Name: "maintainers", + DisplayName: "Maintainers", + Description: "List GitHub usernames for organization members who will become team maintainers.", + Field: &config.Field_ResourceIdSliceField{ + ResourceIdSliceField: &config.ResourceIdSliceField{ + Rules: &config.RepeatedResourceIdRules{ + AllowedResourceTypeIds: []string{resourceTypeUser.Id}, + }, + }, + }, + }, + { + Name: "repo_names", + DisplayName: "Repository Names", + Description: "The full name (e.g., organization-name/repository-name) of repositories to add the team to.", + Field: &config.Field_ResourceIdSliceField{ + ResourceIdSliceField: &config.ResourceIdSliceField{ + Rules: &config.RepeatedResourceIdRules{ + AllowedResourceTypeIds: []string{resourceTypeRepository.Id}, }, }, }, @@ -551,7 +584,7 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str return nil, nil, err } - parentResourceID, err := actions.RequireResourceIDArg(args, "parent") + parentResourceID, err := actions.RequireResourceIDArg(args, "org") if err != nil { return nil, nil, err } @@ -577,14 +610,79 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str newTeam.Description = github.Ptr(description) } + // Check if this is a nested team (has parent) + isNestedTeam := false + if parentTeamResourceID, ok := actions.GetResourceIDArg(args, "parent"); ok { + parentTeamID, err := strconv.ParseInt(parentTeamResourceID.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid parent team ID: %w", err) + } + newTeam.ParentTeamID = github.Ptr(parentTeamID) + isNestedTeam = true + } + + // Handle privacy with constraints based on team type: + // - For non-nested teams: "secret" (default) or "closed" + // - For nested/child teams: only "closed" is allowed (default: closed) if privacy, ok := actions.GetStringArg(args, "privacy"); ok && privacy != "" { - if privacy == "secret" || privacy == "closed" { - newTeam.Privacy = github.Ptr(privacy) + if isNestedTeam { + // Nested teams can only be "closed" + if privacy == "secret" { + l.Warn("github-connector: secret privacy not allowed for nested teams, using closed", + zap.String("requested_privacy", privacy), + ) + } + newTeam.Privacy = github.Ptr("closed") } else { - l.Warn("github-connector: invalid privacy value, using default", - zap.String("provided_privacy", privacy), - ) + // Non-nested teams can be "secret" or "closed" + if privacy == "secret" || privacy == "closed" { + newTeam.Privacy = github.Ptr(privacy) + } + } + } else if isNestedTeam { + // Default for nested teams is "closed" + newTeam.Privacy = github.Ptr("closed") + } + // Note: Default for non-nested teams is "secret" (handled by GitHub API) + + if notificationsEnabled, ok := actions.GetBoolArg(args, "notifications_enabled"); ok { + if notificationsEnabled { + newTeam.NotificationSetting = github.Ptr("notifications_enabled") + } else { + newTeam.NotificationSetting = github.Ptr("notifications_disabled") + } + } + + if maintainerIDs, ok := actions.GetResourceIdListArg(args, "maintainers"); ok && len(maintainerIDs) > 0 { + var maintainerLogins []string + for _, rid := range maintainerIDs { + userID, err := strconv.ParseInt(rid.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid maintainer user ID %s: %w", rid.Resource, err) + } + user, resp, err := o.client.Users.GetByID(ctx, userID) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get user %d", userID)) + } + maintainerLogins = append(maintainerLogins, user.GetLogin()) + } + newTeam.Maintainers = maintainerLogins + } + + if repoIDs, ok := actions.GetResourceIdListArg(args, "repo_names"); ok && len(repoIDs) > 0 { + var repoFullNames []string + for _, rid := range repoIDs { + repoID, err := strconv.ParseInt(rid.Resource, 10, 64) + if err != nil { + return nil, nil, fmt.Errorf("invalid repository ID %s: %w", rid.Resource, err) + } + repo, resp, err := o.client.Repositories.GetByID(ctx, repoID) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get repository %d", repoID)) + } + repoFullNames = append(repoFullNames, repo.GetFullName()) } + newTeam.RepoNames = repoFullNames } // Create the team via GitHub API diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.go index 11073384..afe1a1ff 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.go @@ -1487,8 +1487,20 @@ func (b0 ResourceIDRules_builder) Build() *ResourceIDRules { type RepeatedResourceIdRules struct { state protoimpl.MessageState `protogen:"hybrid.v1"` AllowedResourceTypeIds []string `protobuf:"bytes,1,rep,name=allowed_resource_type_ids,json=allowedResourceTypeIds,proto3" json:"allowed_resource_type_ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // MinItems specifies that this field must have the specified number of + // items at a minimum + MinItems *uint64 `protobuf:"varint,2,opt,name=min_items,json=minItems,proto3,oneof" json:"min_items,omitempty"` + // MaxItems specifies that this field must have the specified number of + // items at a maximum + MaxItems *uint64 `protobuf:"varint,3,opt,name=max_items,json=maxItems,proto3,oneof" json:"max_items,omitempty"` + // Unique specifies that all elements in this field must be unique. + Unique bool `protobuf:"varint,4,opt,name=unique,proto3" json:"unique,omitempty"` + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + ValidateEmpty bool `protobuf:"varint,5,opt,name=validate_empty,json=validateEmpty,proto3" json:"validate_empty,omitempty"` + IsRequired bool `protobuf:"varint,6,opt,name=is_required,json=isRequired,proto3" json:"is_required,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *RepeatedResourceIdRules) Reset() { @@ -1523,14 +1535,103 @@ func (x *RepeatedResourceIdRules) GetAllowedResourceTypeIds() []string { return nil } +func (x *RepeatedResourceIdRules) GetMinItems() uint64 { + if x != nil && x.MinItems != nil { + return *x.MinItems + } + return 0 +} + +func (x *RepeatedResourceIdRules) GetMaxItems() uint64 { + if x != nil && x.MaxItems != nil { + return *x.MaxItems + } + return 0 +} + +func (x *RepeatedResourceIdRules) GetUnique() bool { + if x != nil { + return x.Unique + } + return false +} + +func (x *RepeatedResourceIdRules) GetValidateEmpty() bool { + if x != nil { + return x.ValidateEmpty + } + return false +} + +func (x *RepeatedResourceIdRules) GetIsRequired() bool { + if x != nil { + return x.IsRequired + } + return false +} + func (x *RepeatedResourceIdRules) SetAllowedResourceTypeIds(v []string) { x.AllowedResourceTypeIds = v } +func (x *RepeatedResourceIdRules) SetMinItems(v uint64) { + x.MinItems = &v +} + +func (x *RepeatedResourceIdRules) SetMaxItems(v uint64) { + x.MaxItems = &v +} + +func (x *RepeatedResourceIdRules) SetUnique(v bool) { + x.Unique = v +} + +func (x *RepeatedResourceIdRules) SetValidateEmpty(v bool) { + x.ValidateEmpty = v +} + +func (x *RepeatedResourceIdRules) SetIsRequired(v bool) { + x.IsRequired = v +} + +func (x *RepeatedResourceIdRules) HasMinItems() bool { + if x == nil { + return false + } + return x.MinItems != nil +} + +func (x *RepeatedResourceIdRules) HasMaxItems() bool { + if x == nil { + return false + } + return x.MaxItems != nil +} + +func (x *RepeatedResourceIdRules) ClearMinItems() { + x.MinItems = nil +} + +func (x *RepeatedResourceIdRules) ClearMaxItems() { + x.MaxItems = nil +} + type RepeatedResourceIdRules_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. AllowedResourceTypeIds []string + // MinItems specifies that this field must have the specified number of + // items at a minimum + MinItems *uint64 + // MaxItems specifies that this field must have the specified number of + // items at a maximum + MaxItems *uint64 + // Unique specifies that all elements in this field must be unique. + Unique bool + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + ValidateEmpty bool + IsRequired bool } func (b0 RepeatedResourceIdRules_builder) Build() *RepeatedResourceIdRules { @@ -1538,6 +1639,11 @@ func (b0 RepeatedResourceIdRules_builder) Build() *RepeatedResourceIdRules { b, x := &b0, m0 _, _ = b, x x.AllowedResourceTypeIds = b.AllowedResourceTypeIds + x.MinItems = b.MinItems + x.MaxItems = b.MaxItems + x.Unique = b.Unique + x.ValidateEmpty = b.ValidateEmpty + x.IsRequired = b.IsRequired return m0 } @@ -1630,9 +1736,19 @@ const file_c1_config_v1_rules_proto_rawDesc = "" + "\vis_required\x18\x02 \x01(\bR\n" + "isRequired\"L\n" + "\x0fResourceIDRules\x129\n" + - "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\"T\n" + + "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\"\x94\x02\n" + "\x17RepeatedResourceIdRules\x129\n" + - "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds*\x99\x02\n" + + "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\x12 \n" + + "\tmin_items\x18\x02 \x01(\x04H\x00R\bminItems\x88\x01\x01\x12 \n" + + "\tmax_items\x18\x03 \x01(\x04H\x01R\bmaxItems\x88\x01\x01\x12\x16\n" + + "\x06unique\x18\x04 \x01(\bR\x06unique\x12%\n" + + "\x0evalidate_empty\x18\x05 \x01(\bR\rvalidateEmpty\x12\x1f\n" + + "\vis_required\x18\x06 \x01(\bR\n" + + "isRequiredB\f\n" + + "\n" + + "_min_itemsB\f\n" + + "\n" + + "_max_items*\x99\x02\n" + "\x0fWellKnownString\x12!\n" + "\x1dWELL_KNOWN_STRING_UNSPECIFIED\x10\x00\x12\x1b\n" + "\x17WELL_KNOWN_STRING_EMAIL\x10\x01\x12\x1e\n" + @@ -1684,6 +1800,7 @@ func file_c1_config_v1_rules_proto_init() { } file_c1_config_v1_rules_proto_msgTypes[3].OneofWrappers = []any{} file_c1_config_v1_rules_proto_msgTypes[4].OneofWrappers = []any{} + file_c1_config_v1_rules_proto_msgTypes[7].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.validate.go index f5f49e9e..ef7e9c54 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules.pb.validate.go @@ -1015,6 +1015,20 @@ func (m *RepeatedResourceIdRules) validate(all bool) error { var errors []error + // no validation rules for Unique + + // no validation rules for ValidateEmpty + + // no validation rules for IsRequired + + if m.MinItems != nil { + // no validation rules for MinItems + } + + if m.MaxItems != nil { + // no validation rules for MaxItems + } + if len(errors) > 0 { return RepeatedResourceIdRulesMultiError(errors) } diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules_protoopaque.pb.go index 87964c85..a4f425ba 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/rules_protoopaque.pb.go @@ -1524,6 +1524,13 @@ func (b0 ResourceIDRules_builder) Build() *ResourceIDRules { type RepeatedResourceIdRules struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_AllowedResourceTypeIds []string `protobuf:"bytes,1,rep,name=allowed_resource_type_ids,json=allowedResourceTypeIds,proto3"` + xxx_hidden_MinItems uint64 `protobuf:"varint,2,opt,name=min_items,json=minItems,proto3,oneof"` + xxx_hidden_MaxItems uint64 `protobuf:"varint,3,opt,name=max_items,json=maxItems,proto3,oneof"` + xxx_hidden_Unique bool `protobuf:"varint,4,opt,name=unique,proto3"` + xxx_hidden_ValidateEmpty bool `protobuf:"varint,5,opt,name=validate_empty,json=validateEmpty,proto3"` + xxx_hidden_IsRequired bool `protobuf:"varint,6,opt,name=is_required,json=isRequired,proto3"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1560,14 +1567,107 @@ func (x *RepeatedResourceIdRules) GetAllowedResourceTypeIds() []string { return nil } +func (x *RepeatedResourceIdRules) GetMinItems() uint64 { + if x != nil { + return x.xxx_hidden_MinItems + } + return 0 +} + +func (x *RepeatedResourceIdRules) GetMaxItems() uint64 { + if x != nil { + return x.xxx_hidden_MaxItems + } + return 0 +} + +func (x *RepeatedResourceIdRules) GetUnique() bool { + if x != nil { + return x.xxx_hidden_Unique + } + return false +} + +func (x *RepeatedResourceIdRules) GetValidateEmpty() bool { + if x != nil { + return x.xxx_hidden_ValidateEmpty + } + return false +} + +func (x *RepeatedResourceIdRules) GetIsRequired() bool { + if x != nil { + return x.xxx_hidden_IsRequired + } + return false +} + func (x *RepeatedResourceIdRules) SetAllowedResourceTypeIds(v []string) { x.xxx_hidden_AllowedResourceTypeIds = v } +func (x *RepeatedResourceIdRules) SetMinItems(v uint64) { + x.xxx_hidden_MinItems = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 6) +} + +func (x *RepeatedResourceIdRules) SetMaxItems(v uint64) { + x.xxx_hidden_MaxItems = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 6) +} + +func (x *RepeatedResourceIdRules) SetUnique(v bool) { + x.xxx_hidden_Unique = v +} + +func (x *RepeatedResourceIdRules) SetValidateEmpty(v bool) { + x.xxx_hidden_ValidateEmpty = v +} + +func (x *RepeatedResourceIdRules) SetIsRequired(v bool) { + x.xxx_hidden_IsRequired = v +} + +func (x *RepeatedResourceIdRules) HasMinItems() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *RepeatedResourceIdRules) HasMaxItems() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *RepeatedResourceIdRules) ClearMinItems() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_MinItems = 0 +} + +func (x *RepeatedResourceIdRules) ClearMaxItems() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_MaxItems = 0 +} + type RepeatedResourceIdRules_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. AllowedResourceTypeIds []string + // MinItems specifies that this field must have the specified number of + // items at a minimum + MinItems *uint64 + // MaxItems specifies that this field must have the specified number of + // items at a maximum + MaxItems *uint64 + // Unique specifies that all elements in this field must be unique. + Unique bool + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + ValidateEmpty bool + IsRequired bool } func (b0 RepeatedResourceIdRules_builder) Build() *RepeatedResourceIdRules { @@ -1575,6 +1675,17 @@ func (b0 RepeatedResourceIdRules_builder) Build() *RepeatedResourceIdRules { b, x := &b0, m0 _, _ = b, x x.xxx_hidden_AllowedResourceTypeIds = b.AllowedResourceTypeIds + if b.MinItems != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 6) + x.xxx_hidden_MinItems = *b.MinItems + } + if b.MaxItems != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 6) + x.xxx_hidden_MaxItems = *b.MaxItems + } + x.xxx_hidden_Unique = b.Unique + x.xxx_hidden_ValidateEmpty = b.ValidateEmpty + x.xxx_hidden_IsRequired = b.IsRequired return m0 } @@ -1667,9 +1778,19 @@ const file_c1_config_v1_rules_proto_rawDesc = "" + "\vis_required\x18\x02 \x01(\bR\n" + "isRequired\"L\n" + "\x0fResourceIDRules\x129\n" + - "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\"T\n" + + "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\"\x94\x02\n" + "\x17RepeatedResourceIdRules\x129\n" + - "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds*\x99\x02\n" + + "\x19allowed_resource_type_ids\x18\x01 \x03(\tR\x16allowedResourceTypeIds\x12 \n" + + "\tmin_items\x18\x02 \x01(\x04H\x00R\bminItems\x88\x01\x01\x12 \n" + + "\tmax_items\x18\x03 \x01(\x04H\x01R\bmaxItems\x88\x01\x01\x12\x16\n" + + "\x06unique\x18\x04 \x01(\bR\x06unique\x12%\n" + + "\x0evalidate_empty\x18\x05 \x01(\bR\rvalidateEmpty\x12\x1f\n" + + "\vis_required\x18\x06 \x01(\bR\n" + + "isRequiredB\f\n" + + "\n" + + "_min_itemsB\f\n" + + "\n" + + "_max_items*\x99\x02\n" + "\x0fWellKnownString\x12!\n" + "\x1dWELL_KNOWN_STRING_UNSPECIFIED\x10\x00\x12\x1b\n" + "\x17WELL_KNOWN_STRING_EMAIL\x10\x01\x12\x1e\n" + @@ -1721,6 +1842,7 @@ func file_c1_config_v1_rules_proto_init() { } file_c1_config_v1_rules_proto_msgTypes[3].OneofWrappers = []any{} file_c1_config_v1_rules_proto_msgTypes[4].OneofWrappers = []any{} + file_c1_config_v1_rules_proto_msgTypes[7].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait.pb.go index 7b79389a..8a50448f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait.pb.go @@ -583,10 +583,11 @@ func (b0 GroupTrait_builder) Build() *GroupTrait { } type RoleTrait struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Profile *structpb.Struct `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"hybrid.v1"` + Profile *structpb.Struct `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` + RoleScopeConditions *RoleScopeConditions `protobuf:"bytes,2,opt,name=role_scope_conditions,json=roleScopeConditions,proto3" json:"role_scope_conditions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *RoleTrait) Reset() { @@ -621,10 +622,21 @@ func (x *RoleTrait) GetProfile() *structpb.Struct { return nil } +func (x *RoleTrait) GetRoleScopeConditions() *RoleScopeConditions { + if x != nil { + return x.RoleScopeConditions + } + return nil +} + func (x *RoleTrait) SetProfile(v *structpb.Struct) { x.Profile = v } +func (x *RoleTrait) SetRoleScopeConditions(v *RoleScopeConditions) { + x.RoleScopeConditions = v +} + func (x *RoleTrait) HasProfile() bool { if x == nil { return false @@ -632,14 +644,26 @@ func (x *RoleTrait) HasProfile() bool { return x.Profile != nil } +func (x *RoleTrait) HasRoleScopeConditions() bool { + if x == nil { + return false + } + return x.RoleScopeConditions != nil +} + func (x *RoleTrait) ClearProfile() { x.Profile = nil } +func (x *RoleTrait) ClearRoleScopeConditions() { + x.RoleScopeConditions = nil +} + type RoleTrait_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - Profile *structpb.Struct + Profile *structpb.Struct + RoleScopeConditions *RoleScopeConditions } func (b0 RoleTrait_builder) Build() *RoleTrait { @@ -647,6 +671,234 @@ func (b0 RoleTrait_builder) Build() *RoleTrait { b, x := &b0, m0 _, _ = b, x x.Profile = b.Profile + x.RoleScopeConditions = b.RoleScopeConditions + return m0 +} + +type RoleScopeConditions struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Conditions []*RoleScopeCondition `protobuf:"bytes,3,rep,name=conditions,proto3" json:"conditions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleScopeConditions) Reset() { + *x = RoleScopeConditions{} + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleScopeConditions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleScopeConditions) ProtoMessage() {} + +func (x *RoleScopeConditions) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RoleScopeConditions) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *RoleScopeConditions) GetConditions() []*RoleScopeCondition { + if x != nil { + return x.Conditions + } + return nil +} + +func (x *RoleScopeConditions) SetType(v string) { + x.Type = v +} + +func (x *RoleScopeConditions) SetConditions(v []*RoleScopeCondition) { + x.Conditions = v +} + +type RoleScopeConditions_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Type string + Conditions []*RoleScopeCondition +} + +func (b0 RoleScopeConditions_builder) Build() *RoleScopeConditions { + m0 := &RoleScopeConditions{} + b, x := &b0, m0 + _, _ = b, x + x.Type = b.Type + x.Conditions = b.Conditions + return m0 +} + +type RoleScopeCondition struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Expression string `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleScopeCondition) Reset() { + *x = RoleScopeCondition{} + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleScopeCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleScopeCondition) ProtoMessage() {} + +func (x *RoleScopeCondition) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RoleScopeCondition) GetExpression() string { + if x != nil { + return x.Expression + } + return "" +} + +func (x *RoleScopeCondition) SetExpression(v string) { + x.Expression = v +} + +type RoleScopeCondition_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Expression string +} + +func (b0 RoleScopeCondition_builder) Build() *RoleScopeCondition { + m0 := &RoleScopeCondition{} + b, x := &b0, m0 + _, _ = b, x + x.Expression = b.Expression + return m0 +} + +// ScopeBindingTrait is used to scope a role to a resource or set of resources. +// The scope may be static (determined at crawl time) or dynamic (determined based on conditions). +// For example, in Azure a role definition can be scoped to a subscription, management group, or resource group. +// In that case, the role ID would be the resource ID of the role definition, and the scope resource ID would be the resource ID of the subscription, management group, or resource group. +type ScopeBindingTrait struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + RoleId *ResourceId `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // The role that is scoped. Must be a resource with the role trait. + // Remove required if we add more ways to scope roles. (eg: Expressions.) + ScopeResourceId *ResourceId `protobuf:"bytes,2,opt,name=scope_resource_id,json=scopeResourceId,proto3" json:"scope_resource_id,omitempty"` // The resource that the role is scoped to. + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScopeBindingTrait) Reset() { + *x = ScopeBindingTrait{} + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScopeBindingTrait) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScopeBindingTrait) ProtoMessage() {} + +func (x *ScopeBindingTrait) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ScopeBindingTrait) GetRoleId() *ResourceId { + if x != nil { + return x.RoleId + } + return nil +} + +func (x *ScopeBindingTrait) GetScopeResourceId() *ResourceId { + if x != nil { + return x.ScopeResourceId + } + return nil +} + +func (x *ScopeBindingTrait) SetRoleId(v *ResourceId) { + x.RoleId = v +} + +func (x *ScopeBindingTrait) SetScopeResourceId(v *ResourceId) { + x.ScopeResourceId = v +} + +func (x *ScopeBindingTrait) HasRoleId() bool { + if x == nil { + return false + } + return x.RoleId != nil +} + +func (x *ScopeBindingTrait) HasScopeResourceId() bool { + if x == nil { + return false + } + return x.ScopeResourceId != nil +} + +func (x *ScopeBindingTrait) ClearRoleId() { + x.RoleId = nil +} + +func (x *ScopeBindingTrait) ClearScopeResourceId() { + x.ScopeResourceId = nil +} + +type ScopeBindingTrait_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + RoleId *ResourceId + // Remove required if we add more ways to scope roles. (eg: Expressions.) + ScopeResourceId *ResourceId +} + +func (b0 ScopeBindingTrait_builder) Build() *ScopeBindingTrait { + m0 := &ScopeBindingTrait{} + b, x := &b0, m0 + _, _ = b, x + x.RoleId = b.RoleId + x.ScopeResourceId = b.ScopeResourceId return m0 } @@ -663,7 +915,7 @@ type AppTrait struct { func (x *AppTrait) Reset() { *x = AppTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -675,7 +927,7 @@ func (x *AppTrait) String() string { func (*AppTrait) ProtoMessage() {} func (x *AppTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -810,7 +1062,7 @@ type SecretTrait struct { func (x *SecretTrait) Reset() { *x = SecretTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -822,7 +1074,7 @@ func (x *SecretTrait) String() string { func (*SecretTrait) ProtoMessage() {} func (x *SecretTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1000,7 +1252,7 @@ type UserTrait_Email struct { func (x *UserTrait_Email) Reset() { *x = UserTrait_Email{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1012,7 +1264,7 @@ func (x *UserTrait_Email) String() string { func (*UserTrait_Email) ProtoMessage() {} func (x *UserTrait_Email) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1072,7 +1324,7 @@ type UserTrait_Status struct { func (x *UserTrait_Status) Reset() { *x = UserTrait_Status{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1084,7 +1336,7 @@ func (x *UserTrait_Status) String() string { func (*UserTrait_Status) ProtoMessage() {} func (x *UserTrait_Status) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1142,7 +1394,7 @@ type UserTrait_MFAStatus struct { func (x *UserTrait_MFAStatus) Reset() { *x = UserTrait_MFAStatus{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1154,7 +1406,7 @@ func (x *UserTrait_MFAStatus) String() string { func (*UserTrait_MFAStatus) ProtoMessage() {} func (x *UserTrait_MFAStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1199,7 +1451,7 @@ type UserTrait_SSOStatus struct { func (x *UserTrait_SSOStatus) Reset() { *x = UserTrait_SSOStatus{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1211,7 +1463,7 @@ func (x *UserTrait_SSOStatus) String() string { func (*UserTrait_SSOStatus) ProtoMessage() {} func (x *UserTrait_SSOStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1260,7 +1512,7 @@ type UserTrait_StructuredName struct { func (x *UserTrait_StructuredName) Reset() { *x = UserTrait_StructuredName{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1272,7 +1524,7 @@ func (x *UserTrait_StructuredName) String() string { func (*UserTrait_StructuredName) ProtoMessage() {} func (x *UserTrait_StructuredName) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1419,9 +1671,22 @@ const file_c1_connector_v2_annotation_trait_proto_rawDesc = "" + "\n" + "GroupTrait\x12-\n" + "\x04icon\x18\x01 \x01(\v2\x19.c1.connector.v2.AssetRefR\x04icon\x121\n" + - "\aprofile\x18\x02 \x01(\v2\x17.google.protobuf.StructR\aprofile\">\n" + + "\aprofile\x18\x02 \x01(\v2\x17.google.protobuf.StructR\aprofile\"\x98\x01\n" + "\tRoleTrait\x121\n" + - "\aprofile\x18\x01 \x01(\v2\x17.google.protobuf.StructR\aprofile\"\x9a\x03\n" + + "\aprofile\x18\x01 \x01(\v2\x17.google.protobuf.StructR\aprofile\x12X\n" + + "\x15role_scope_conditions\x18\x02 \x01(\v2$.c1.connector.v2.RoleScopeConditionsR\x13roleScopeConditions\"n\n" + + "\x13RoleScopeConditions\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12C\n" + + "\n" + + "conditions\x18\x03 \x03(\v2#.c1.connector.v2.RoleScopeConditionR\n" + + "conditions\"4\n" + + "\x12RoleScopeCondition\x12\x1e\n" + + "\n" + + "expression\x18\x01 \x01(\tR\n" + + "expression\"\xa6\x01\n" + + "\x11ScopeBindingTrait\x12>\n" + + "\arole_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x06roleId\x12Q\n" + + "\x11scope_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x0fscopeResourceId\"\x9a\x03\n" + "\bAppTrait\x125\n" + "\bhelp_url\x18\x01 \x01(\tB\x1a\xfaB\x17r\x15 \x01(\x80\b:\bhttps://\xd0\x01\x01\x88\x01\x01R\ahelpUrl\x12-\n" + "\x04icon\x18\x02 \x01(\v2\x19.c1.connector.v2.AssetRefR\x04icon\x12-\n" + @@ -1448,7 +1713,7 @@ const file_c1_connector_v2_annotation_trait_proto_rawDesc = "" + "identityIdB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" var file_c1_connector_v2_annotation_trait_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_c1_connector_v2_annotation_trait_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_c1_connector_v2_annotation_trait_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_c1_connector_v2_annotation_trait_proto_goTypes = []any{ (UserTrait_AccountType)(0), // 0: c1.connector.v2.UserTrait.AccountType (UserTrait_Status_Status)(0), // 1: c1.connector.v2.UserTrait.Status.Status @@ -1456,48 +1721,55 @@ var file_c1_connector_v2_annotation_trait_proto_goTypes = []any{ (*UserTrait)(nil), // 3: c1.connector.v2.UserTrait (*GroupTrait)(nil), // 4: c1.connector.v2.GroupTrait (*RoleTrait)(nil), // 5: c1.connector.v2.RoleTrait - (*AppTrait)(nil), // 6: c1.connector.v2.AppTrait - (*SecretTrait)(nil), // 7: c1.connector.v2.SecretTrait - (*UserTrait_Email)(nil), // 8: c1.connector.v2.UserTrait.Email - (*UserTrait_Status)(nil), // 9: c1.connector.v2.UserTrait.Status - (*UserTrait_MFAStatus)(nil), // 10: c1.connector.v2.UserTrait.MFAStatus - (*UserTrait_SSOStatus)(nil), // 11: c1.connector.v2.UserTrait.SSOStatus - (*UserTrait_StructuredName)(nil), // 12: c1.connector.v2.UserTrait.StructuredName - (*structpb.Struct)(nil), // 13: google.protobuf.Struct - (*AssetRef)(nil), // 14: c1.connector.v2.AssetRef - (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp - (*ResourceId)(nil), // 16: c1.connector.v2.ResourceId + (*RoleScopeConditions)(nil), // 6: c1.connector.v2.RoleScopeConditions + (*RoleScopeCondition)(nil), // 7: c1.connector.v2.RoleScopeCondition + (*ScopeBindingTrait)(nil), // 8: c1.connector.v2.ScopeBindingTrait + (*AppTrait)(nil), // 9: c1.connector.v2.AppTrait + (*SecretTrait)(nil), // 10: c1.connector.v2.SecretTrait + (*UserTrait_Email)(nil), // 11: c1.connector.v2.UserTrait.Email + (*UserTrait_Status)(nil), // 12: c1.connector.v2.UserTrait.Status + (*UserTrait_MFAStatus)(nil), // 13: c1.connector.v2.UserTrait.MFAStatus + (*UserTrait_SSOStatus)(nil), // 14: c1.connector.v2.UserTrait.SSOStatus + (*UserTrait_StructuredName)(nil), // 15: c1.connector.v2.UserTrait.StructuredName + (*structpb.Struct)(nil), // 16: google.protobuf.Struct + (*AssetRef)(nil), // 17: c1.connector.v2.AssetRef + (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp + (*ResourceId)(nil), // 19: c1.connector.v2.ResourceId } var file_c1_connector_v2_annotation_trait_proto_depIdxs = []int32{ - 8, // 0: c1.connector.v2.UserTrait.emails:type_name -> c1.connector.v2.UserTrait.Email - 9, // 1: c1.connector.v2.UserTrait.status:type_name -> c1.connector.v2.UserTrait.Status - 13, // 2: c1.connector.v2.UserTrait.profile:type_name -> google.protobuf.Struct - 14, // 3: c1.connector.v2.UserTrait.icon:type_name -> c1.connector.v2.AssetRef + 11, // 0: c1.connector.v2.UserTrait.emails:type_name -> c1.connector.v2.UserTrait.Email + 12, // 1: c1.connector.v2.UserTrait.status:type_name -> c1.connector.v2.UserTrait.Status + 16, // 2: c1.connector.v2.UserTrait.profile:type_name -> google.protobuf.Struct + 17, // 3: c1.connector.v2.UserTrait.icon:type_name -> c1.connector.v2.AssetRef 0, // 4: c1.connector.v2.UserTrait.account_type:type_name -> c1.connector.v2.UserTrait.AccountType - 15, // 5: c1.connector.v2.UserTrait.created_at:type_name -> google.protobuf.Timestamp - 15, // 6: c1.connector.v2.UserTrait.last_login:type_name -> google.protobuf.Timestamp - 10, // 7: c1.connector.v2.UserTrait.mfa_status:type_name -> c1.connector.v2.UserTrait.MFAStatus - 11, // 8: c1.connector.v2.UserTrait.sso_status:type_name -> c1.connector.v2.UserTrait.SSOStatus - 12, // 9: c1.connector.v2.UserTrait.structured_name:type_name -> c1.connector.v2.UserTrait.StructuredName - 14, // 10: c1.connector.v2.GroupTrait.icon:type_name -> c1.connector.v2.AssetRef - 13, // 11: c1.connector.v2.GroupTrait.profile:type_name -> google.protobuf.Struct - 13, // 12: c1.connector.v2.RoleTrait.profile:type_name -> google.protobuf.Struct - 14, // 13: c1.connector.v2.AppTrait.icon:type_name -> c1.connector.v2.AssetRef - 14, // 14: c1.connector.v2.AppTrait.logo:type_name -> c1.connector.v2.AssetRef - 13, // 15: c1.connector.v2.AppTrait.profile:type_name -> google.protobuf.Struct - 2, // 16: c1.connector.v2.AppTrait.flags:type_name -> c1.connector.v2.AppTrait.AppFlag - 13, // 17: c1.connector.v2.SecretTrait.profile:type_name -> google.protobuf.Struct - 15, // 18: c1.connector.v2.SecretTrait.created_at:type_name -> google.protobuf.Timestamp - 15, // 19: c1.connector.v2.SecretTrait.expires_at:type_name -> google.protobuf.Timestamp - 15, // 20: c1.connector.v2.SecretTrait.last_used_at:type_name -> google.protobuf.Timestamp - 16, // 21: c1.connector.v2.SecretTrait.created_by_id:type_name -> c1.connector.v2.ResourceId - 16, // 22: c1.connector.v2.SecretTrait.identity_id:type_name -> c1.connector.v2.ResourceId - 1, // 23: c1.connector.v2.UserTrait.Status.status:type_name -> c1.connector.v2.UserTrait.Status.Status - 24, // [24:24] is the sub-list for method output_type - 24, // [24:24] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 18, // 5: c1.connector.v2.UserTrait.created_at:type_name -> google.protobuf.Timestamp + 18, // 6: c1.connector.v2.UserTrait.last_login:type_name -> google.protobuf.Timestamp + 13, // 7: c1.connector.v2.UserTrait.mfa_status:type_name -> c1.connector.v2.UserTrait.MFAStatus + 14, // 8: c1.connector.v2.UserTrait.sso_status:type_name -> c1.connector.v2.UserTrait.SSOStatus + 15, // 9: c1.connector.v2.UserTrait.structured_name:type_name -> c1.connector.v2.UserTrait.StructuredName + 17, // 10: c1.connector.v2.GroupTrait.icon:type_name -> c1.connector.v2.AssetRef + 16, // 11: c1.connector.v2.GroupTrait.profile:type_name -> google.protobuf.Struct + 16, // 12: c1.connector.v2.RoleTrait.profile:type_name -> google.protobuf.Struct + 6, // 13: c1.connector.v2.RoleTrait.role_scope_conditions:type_name -> c1.connector.v2.RoleScopeConditions + 7, // 14: c1.connector.v2.RoleScopeConditions.conditions:type_name -> c1.connector.v2.RoleScopeCondition + 19, // 15: c1.connector.v2.ScopeBindingTrait.role_id:type_name -> c1.connector.v2.ResourceId + 19, // 16: c1.connector.v2.ScopeBindingTrait.scope_resource_id:type_name -> c1.connector.v2.ResourceId + 17, // 17: c1.connector.v2.AppTrait.icon:type_name -> c1.connector.v2.AssetRef + 17, // 18: c1.connector.v2.AppTrait.logo:type_name -> c1.connector.v2.AssetRef + 16, // 19: c1.connector.v2.AppTrait.profile:type_name -> google.protobuf.Struct + 2, // 20: c1.connector.v2.AppTrait.flags:type_name -> c1.connector.v2.AppTrait.AppFlag + 16, // 21: c1.connector.v2.SecretTrait.profile:type_name -> google.protobuf.Struct + 18, // 22: c1.connector.v2.SecretTrait.created_at:type_name -> google.protobuf.Timestamp + 18, // 23: c1.connector.v2.SecretTrait.expires_at:type_name -> google.protobuf.Timestamp + 18, // 24: c1.connector.v2.SecretTrait.last_used_at:type_name -> google.protobuf.Timestamp + 19, // 25: c1.connector.v2.SecretTrait.created_by_id:type_name -> c1.connector.v2.ResourceId + 19, // 26: c1.connector.v2.SecretTrait.identity_id:type_name -> c1.connector.v2.ResourceId + 1, // 27: c1.connector.v2.UserTrait.Status.status:type_name -> c1.connector.v2.UserTrait.Status.Status + 28, // [28:28] is the sub-list for method output_type + 28, // [28:28] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_c1_connector_v2_annotation_trait_proto_init() } @@ -1513,7 +1785,7 @@ func file_c1_connector_v2_annotation_trait_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_trait_proto_rawDesc), len(file_c1_connector_v2_annotation_trait_proto_rawDesc)), NumEnums: 3, - NumMessages: 10, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait_protoopaque.pb.go index c7a4531b..db2e7db8 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/annotation_trait_protoopaque.pb.go @@ -583,10 +583,11 @@ func (b0 GroupTrait_builder) Build() *GroupTrait { } type RoleTrait struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Profile *structpb.Struct `protobuf:"bytes,1,opt,name=profile,proto3"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Profile *structpb.Struct `protobuf:"bytes,1,opt,name=profile,proto3"` + xxx_hidden_RoleScopeConditions *RoleScopeConditions `protobuf:"bytes,2,opt,name=role_scope_conditions,json=roleScopeConditions,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *RoleTrait) Reset() { @@ -621,10 +622,21 @@ func (x *RoleTrait) GetProfile() *structpb.Struct { return nil } +func (x *RoleTrait) GetRoleScopeConditions() *RoleScopeConditions { + if x != nil { + return x.xxx_hidden_RoleScopeConditions + } + return nil +} + func (x *RoleTrait) SetProfile(v *structpb.Struct) { x.xxx_hidden_Profile = v } +func (x *RoleTrait) SetRoleScopeConditions(v *RoleScopeConditions) { + x.xxx_hidden_RoleScopeConditions = v +} + func (x *RoleTrait) HasProfile() bool { if x == nil { return false @@ -632,14 +644,26 @@ func (x *RoleTrait) HasProfile() bool { return x.xxx_hidden_Profile != nil } +func (x *RoleTrait) HasRoleScopeConditions() bool { + if x == nil { + return false + } + return x.xxx_hidden_RoleScopeConditions != nil +} + func (x *RoleTrait) ClearProfile() { x.xxx_hidden_Profile = nil } +func (x *RoleTrait) ClearRoleScopeConditions() { + x.xxx_hidden_RoleScopeConditions = nil +} + type RoleTrait_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - Profile *structpb.Struct + Profile *structpb.Struct + RoleScopeConditions *RoleScopeConditions } func (b0 RoleTrait_builder) Build() *RoleTrait { @@ -647,6 +671,235 @@ func (b0 RoleTrait_builder) Build() *RoleTrait { b, x := &b0, m0 _, _ = b, x x.xxx_hidden_Profile = b.Profile + x.xxx_hidden_RoleScopeConditions = b.RoleScopeConditions + return m0 +} + +type RoleScopeConditions struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Type string `protobuf:"bytes,1,opt,name=type,proto3"` + xxx_hidden_Conditions *[]*RoleScopeCondition `protobuf:"bytes,3,rep,name=conditions,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleScopeConditions) Reset() { + *x = RoleScopeConditions{} + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleScopeConditions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleScopeConditions) ProtoMessage() {} + +func (x *RoleScopeConditions) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RoleScopeConditions) GetType() string { + if x != nil { + return x.xxx_hidden_Type + } + return "" +} + +func (x *RoleScopeConditions) GetConditions() []*RoleScopeCondition { + if x != nil { + if x.xxx_hidden_Conditions != nil { + return *x.xxx_hidden_Conditions + } + } + return nil +} + +func (x *RoleScopeConditions) SetType(v string) { + x.xxx_hidden_Type = v +} + +func (x *RoleScopeConditions) SetConditions(v []*RoleScopeCondition) { + x.xxx_hidden_Conditions = &v +} + +type RoleScopeConditions_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Type string + Conditions []*RoleScopeCondition +} + +func (b0 RoleScopeConditions_builder) Build() *RoleScopeConditions { + m0 := &RoleScopeConditions{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Type = b.Type + x.xxx_hidden_Conditions = &b.Conditions + return m0 +} + +type RoleScopeCondition struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Expression string `protobuf:"bytes,1,opt,name=expression,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleScopeCondition) Reset() { + *x = RoleScopeCondition{} + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleScopeCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleScopeCondition) ProtoMessage() {} + +func (x *RoleScopeCondition) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RoleScopeCondition) GetExpression() string { + if x != nil { + return x.xxx_hidden_Expression + } + return "" +} + +func (x *RoleScopeCondition) SetExpression(v string) { + x.xxx_hidden_Expression = v +} + +type RoleScopeCondition_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Expression string +} + +func (b0 RoleScopeCondition_builder) Build() *RoleScopeCondition { + m0 := &RoleScopeCondition{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Expression = b.Expression + return m0 +} + +// ScopeBindingTrait is used to scope a role to a resource or set of resources. +// The scope may be static (determined at crawl time) or dynamic (determined based on conditions). +// For example, in Azure a role definition can be scoped to a subscription, management group, or resource group. +// In that case, the role ID would be the resource ID of the role definition, and the scope resource ID would be the resource ID of the subscription, management group, or resource group. +type ScopeBindingTrait struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_RoleId *ResourceId `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3"` + xxx_hidden_ScopeResourceId *ResourceId `protobuf:"bytes,2,opt,name=scope_resource_id,json=scopeResourceId,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScopeBindingTrait) Reset() { + *x = ScopeBindingTrait{} + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScopeBindingTrait) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScopeBindingTrait) ProtoMessage() {} + +func (x *ScopeBindingTrait) ProtoReflect() protoreflect.Message { + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ScopeBindingTrait) GetRoleId() *ResourceId { + if x != nil { + return x.xxx_hidden_RoleId + } + return nil +} + +func (x *ScopeBindingTrait) GetScopeResourceId() *ResourceId { + if x != nil { + return x.xxx_hidden_ScopeResourceId + } + return nil +} + +func (x *ScopeBindingTrait) SetRoleId(v *ResourceId) { + x.xxx_hidden_RoleId = v +} + +func (x *ScopeBindingTrait) SetScopeResourceId(v *ResourceId) { + x.xxx_hidden_ScopeResourceId = v +} + +func (x *ScopeBindingTrait) HasRoleId() bool { + if x == nil { + return false + } + return x.xxx_hidden_RoleId != nil +} + +func (x *ScopeBindingTrait) HasScopeResourceId() bool { + if x == nil { + return false + } + return x.xxx_hidden_ScopeResourceId != nil +} + +func (x *ScopeBindingTrait) ClearRoleId() { + x.xxx_hidden_RoleId = nil +} + +func (x *ScopeBindingTrait) ClearScopeResourceId() { + x.xxx_hidden_ScopeResourceId = nil +} + +type ScopeBindingTrait_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + RoleId *ResourceId + // Remove required if we add more ways to scope roles. (eg: Expressions.) + ScopeResourceId *ResourceId +} + +func (b0 ScopeBindingTrait_builder) Build() *ScopeBindingTrait { + m0 := &ScopeBindingTrait{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_RoleId = b.RoleId + x.xxx_hidden_ScopeResourceId = b.ScopeResourceId return m0 } @@ -663,7 +916,7 @@ type AppTrait struct { func (x *AppTrait) Reset() { *x = AppTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -675,7 +928,7 @@ func (x *AppTrait) String() string { func (*AppTrait) ProtoMessage() {} func (x *AppTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[3] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -810,7 +1063,7 @@ type SecretTrait struct { func (x *SecretTrait) Reset() { *x = SecretTrait{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -822,7 +1075,7 @@ func (x *SecretTrait) String() string { func (*SecretTrait) ProtoMessage() {} func (x *SecretTrait) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[4] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -999,7 +1252,7 @@ type UserTrait_Email struct { func (x *UserTrait_Email) Reset() { *x = UserTrait_Email{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1011,7 +1264,7 @@ func (x *UserTrait_Email) String() string { func (*UserTrait_Email) ProtoMessage() {} func (x *UserTrait_Email) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[5] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1071,7 +1324,7 @@ type UserTrait_Status struct { func (x *UserTrait_Status) Reset() { *x = UserTrait_Status{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1083,7 +1336,7 @@ func (x *UserTrait_Status) String() string { func (*UserTrait_Status) ProtoMessage() {} func (x *UserTrait_Status) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[6] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1141,7 +1394,7 @@ type UserTrait_MFAStatus struct { func (x *UserTrait_MFAStatus) Reset() { *x = UserTrait_MFAStatus{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1153,7 +1406,7 @@ func (x *UserTrait_MFAStatus) String() string { func (*UserTrait_MFAStatus) ProtoMessage() {} func (x *UserTrait_MFAStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[7] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1198,7 +1451,7 @@ type UserTrait_SSOStatus struct { func (x *UserTrait_SSOStatus) Reset() { *x = UserTrait_SSOStatus{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1210,7 +1463,7 @@ func (x *UserTrait_SSOStatus) String() string { func (*UserTrait_SSOStatus) ProtoMessage() {} func (x *UserTrait_SSOStatus) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[8] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1259,7 +1512,7 @@ type UserTrait_StructuredName struct { func (x *UserTrait_StructuredName) Reset() { *x = UserTrait_StructuredName{} - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1271,7 +1524,7 @@ func (x *UserTrait_StructuredName) String() string { func (*UserTrait_StructuredName) ProtoMessage() {} func (x *UserTrait_StructuredName) ProtoReflect() protoreflect.Message { - mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[9] + mi := &file_c1_connector_v2_annotation_trait_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1418,9 +1671,22 @@ const file_c1_connector_v2_annotation_trait_proto_rawDesc = "" + "\n" + "GroupTrait\x12-\n" + "\x04icon\x18\x01 \x01(\v2\x19.c1.connector.v2.AssetRefR\x04icon\x121\n" + - "\aprofile\x18\x02 \x01(\v2\x17.google.protobuf.StructR\aprofile\">\n" + + "\aprofile\x18\x02 \x01(\v2\x17.google.protobuf.StructR\aprofile\"\x98\x01\n" + "\tRoleTrait\x121\n" + - "\aprofile\x18\x01 \x01(\v2\x17.google.protobuf.StructR\aprofile\"\x9a\x03\n" + + "\aprofile\x18\x01 \x01(\v2\x17.google.protobuf.StructR\aprofile\x12X\n" + + "\x15role_scope_conditions\x18\x02 \x01(\v2$.c1.connector.v2.RoleScopeConditionsR\x13roleScopeConditions\"n\n" + + "\x13RoleScopeConditions\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12C\n" + + "\n" + + "conditions\x18\x03 \x03(\v2#.c1.connector.v2.RoleScopeConditionR\n" + + "conditions\"4\n" + + "\x12RoleScopeCondition\x12\x1e\n" + + "\n" + + "expression\x18\x01 \x01(\tR\n" + + "expression\"\xa6\x01\n" + + "\x11ScopeBindingTrait\x12>\n" + + "\arole_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x06roleId\x12Q\n" + + "\x11scope_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x01R\x0fscopeResourceId\"\x9a\x03\n" + "\bAppTrait\x125\n" + "\bhelp_url\x18\x01 \x01(\tB\x1a\xfaB\x17r\x15 \x01(\x80\b:\bhttps://\xd0\x01\x01\x88\x01\x01R\ahelpUrl\x12-\n" + "\x04icon\x18\x02 \x01(\v2\x19.c1.connector.v2.AssetRefR\x04icon\x12-\n" + @@ -1447,7 +1713,7 @@ const file_c1_connector_v2_annotation_trait_proto_rawDesc = "" + "identityIdB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" var file_c1_connector_v2_annotation_trait_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_c1_connector_v2_annotation_trait_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_c1_connector_v2_annotation_trait_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_c1_connector_v2_annotation_trait_proto_goTypes = []any{ (UserTrait_AccountType)(0), // 0: c1.connector.v2.UserTrait.AccountType (UserTrait_Status_Status)(0), // 1: c1.connector.v2.UserTrait.Status.Status @@ -1455,48 +1721,55 @@ var file_c1_connector_v2_annotation_trait_proto_goTypes = []any{ (*UserTrait)(nil), // 3: c1.connector.v2.UserTrait (*GroupTrait)(nil), // 4: c1.connector.v2.GroupTrait (*RoleTrait)(nil), // 5: c1.connector.v2.RoleTrait - (*AppTrait)(nil), // 6: c1.connector.v2.AppTrait - (*SecretTrait)(nil), // 7: c1.connector.v2.SecretTrait - (*UserTrait_Email)(nil), // 8: c1.connector.v2.UserTrait.Email - (*UserTrait_Status)(nil), // 9: c1.connector.v2.UserTrait.Status - (*UserTrait_MFAStatus)(nil), // 10: c1.connector.v2.UserTrait.MFAStatus - (*UserTrait_SSOStatus)(nil), // 11: c1.connector.v2.UserTrait.SSOStatus - (*UserTrait_StructuredName)(nil), // 12: c1.connector.v2.UserTrait.StructuredName - (*structpb.Struct)(nil), // 13: google.protobuf.Struct - (*AssetRef)(nil), // 14: c1.connector.v2.AssetRef - (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp - (*ResourceId)(nil), // 16: c1.connector.v2.ResourceId + (*RoleScopeConditions)(nil), // 6: c1.connector.v2.RoleScopeConditions + (*RoleScopeCondition)(nil), // 7: c1.connector.v2.RoleScopeCondition + (*ScopeBindingTrait)(nil), // 8: c1.connector.v2.ScopeBindingTrait + (*AppTrait)(nil), // 9: c1.connector.v2.AppTrait + (*SecretTrait)(nil), // 10: c1.connector.v2.SecretTrait + (*UserTrait_Email)(nil), // 11: c1.connector.v2.UserTrait.Email + (*UserTrait_Status)(nil), // 12: c1.connector.v2.UserTrait.Status + (*UserTrait_MFAStatus)(nil), // 13: c1.connector.v2.UserTrait.MFAStatus + (*UserTrait_SSOStatus)(nil), // 14: c1.connector.v2.UserTrait.SSOStatus + (*UserTrait_StructuredName)(nil), // 15: c1.connector.v2.UserTrait.StructuredName + (*structpb.Struct)(nil), // 16: google.protobuf.Struct + (*AssetRef)(nil), // 17: c1.connector.v2.AssetRef + (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp + (*ResourceId)(nil), // 19: c1.connector.v2.ResourceId } var file_c1_connector_v2_annotation_trait_proto_depIdxs = []int32{ - 8, // 0: c1.connector.v2.UserTrait.emails:type_name -> c1.connector.v2.UserTrait.Email - 9, // 1: c1.connector.v2.UserTrait.status:type_name -> c1.connector.v2.UserTrait.Status - 13, // 2: c1.connector.v2.UserTrait.profile:type_name -> google.protobuf.Struct - 14, // 3: c1.connector.v2.UserTrait.icon:type_name -> c1.connector.v2.AssetRef + 11, // 0: c1.connector.v2.UserTrait.emails:type_name -> c1.connector.v2.UserTrait.Email + 12, // 1: c1.connector.v2.UserTrait.status:type_name -> c1.connector.v2.UserTrait.Status + 16, // 2: c1.connector.v2.UserTrait.profile:type_name -> google.protobuf.Struct + 17, // 3: c1.connector.v2.UserTrait.icon:type_name -> c1.connector.v2.AssetRef 0, // 4: c1.connector.v2.UserTrait.account_type:type_name -> c1.connector.v2.UserTrait.AccountType - 15, // 5: c1.connector.v2.UserTrait.created_at:type_name -> google.protobuf.Timestamp - 15, // 6: c1.connector.v2.UserTrait.last_login:type_name -> google.protobuf.Timestamp - 10, // 7: c1.connector.v2.UserTrait.mfa_status:type_name -> c1.connector.v2.UserTrait.MFAStatus - 11, // 8: c1.connector.v2.UserTrait.sso_status:type_name -> c1.connector.v2.UserTrait.SSOStatus - 12, // 9: c1.connector.v2.UserTrait.structured_name:type_name -> c1.connector.v2.UserTrait.StructuredName - 14, // 10: c1.connector.v2.GroupTrait.icon:type_name -> c1.connector.v2.AssetRef - 13, // 11: c1.connector.v2.GroupTrait.profile:type_name -> google.protobuf.Struct - 13, // 12: c1.connector.v2.RoleTrait.profile:type_name -> google.protobuf.Struct - 14, // 13: c1.connector.v2.AppTrait.icon:type_name -> c1.connector.v2.AssetRef - 14, // 14: c1.connector.v2.AppTrait.logo:type_name -> c1.connector.v2.AssetRef - 13, // 15: c1.connector.v2.AppTrait.profile:type_name -> google.protobuf.Struct - 2, // 16: c1.connector.v2.AppTrait.flags:type_name -> c1.connector.v2.AppTrait.AppFlag - 13, // 17: c1.connector.v2.SecretTrait.profile:type_name -> google.protobuf.Struct - 15, // 18: c1.connector.v2.SecretTrait.created_at:type_name -> google.protobuf.Timestamp - 15, // 19: c1.connector.v2.SecretTrait.expires_at:type_name -> google.protobuf.Timestamp - 15, // 20: c1.connector.v2.SecretTrait.last_used_at:type_name -> google.protobuf.Timestamp - 16, // 21: c1.connector.v2.SecretTrait.created_by_id:type_name -> c1.connector.v2.ResourceId - 16, // 22: c1.connector.v2.SecretTrait.identity_id:type_name -> c1.connector.v2.ResourceId - 1, // 23: c1.connector.v2.UserTrait.Status.status:type_name -> c1.connector.v2.UserTrait.Status.Status - 24, // [24:24] is the sub-list for method output_type - 24, // [24:24] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 18, // 5: c1.connector.v2.UserTrait.created_at:type_name -> google.protobuf.Timestamp + 18, // 6: c1.connector.v2.UserTrait.last_login:type_name -> google.protobuf.Timestamp + 13, // 7: c1.connector.v2.UserTrait.mfa_status:type_name -> c1.connector.v2.UserTrait.MFAStatus + 14, // 8: c1.connector.v2.UserTrait.sso_status:type_name -> c1.connector.v2.UserTrait.SSOStatus + 15, // 9: c1.connector.v2.UserTrait.structured_name:type_name -> c1.connector.v2.UserTrait.StructuredName + 17, // 10: c1.connector.v2.GroupTrait.icon:type_name -> c1.connector.v2.AssetRef + 16, // 11: c1.connector.v2.GroupTrait.profile:type_name -> google.protobuf.Struct + 16, // 12: c1.connector.v2.RoleTrait.profile:type_name -> google.protobuf.Struct + 6, // 13: c1.connector.v2.RoleTrait.role_scope_conditions:type_name -> c1.connector.v2.RoleScopeConditions + 7, // 14: c1.connector.v2.RoleScopeConditions.conditions:type_name -> c1.connector.v2.RoleScopeCondition + 19, // 15: c1.connector.v2.ScopeBindingTrait.role_id:type_name -> c1.connector.v2.ResourceId + 19, // 16: c1.connector.v2.ScopeBindingTrait.scope_resource_id:type_name -> c1.connector.v2.ResourceId + 17, // 17: c1.connector.v2.AppTrait.icon:type_name -> c1.connector.v2.AssetRef + 17, // 18: c1.connector.v2.AppTrait.logo:type_name -> c1.connector.v2.AssetRef + 16, // 19: c1.connector.v2.AppTrait.profile:type_name -> google.protobuf.Struct + 2, // 20: c1.connector.v2.AppTrait.flags:type_name -> c1.connector.v2.AppTrait.AppFlag + 16, // 21: c1.connector.v2.SecretTrait.profile:type_name -> google.protobuf.Struct + 18, // 22: c1.connector.v2.SecretTrait.created_at:type_name -> google.protobuf.Timestamp + 18, // 23: c1.connector.v2.SecretTrait.expires_at:type_name -> google.protobuf.Timestamp + 18, // 24: c1.connector.v2.SecretTrait.last_used_at:type_name -> google.protobuf.Timestamp + 19, // 25: c1.connector.v2.SecretTrait.created_by_id:type_name -> c1.connector.v2.ResourceId + 19, // 26: c1.connector.v2.SecretTrait.identity_id:type_name -> c1.connector.v2.ResourceId + 1, // 27: c1.connector.v2.UserTrait.Status.status:type_name -> c1.connector.v2.UserTrait.Status.Status + 28, // [28:28] is the sub-list for method output_type + 28, // [28:28] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_c1_connector_v2_annotation_trait_proto_init() } @@ -1512,7 +1785,7 @@ func file_c1_connector_v2_annotation_trait_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connector_v2_annotation_trait_proto_rawDesc), len(file_c1_connector_v2_annotation_trait_proto_rawDesc)), NumEnums: 3, - NumMessages: 10, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go index e86d89c8..34601877 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource.pb.go @@ -35,6 +35,7 @@ const ( ResourceType_TRAIT_APP ResourceType_Trait = 4 ResourceType_TRAIT_SECRET ResourceType_Trait = 5 ResourceType_TRAIT_SECURITY_INSIGHT ResourceType_Trait = 6 + ResourceType_TRAIT_SCOPE_BINDING ResourceType_Trait = 7 ) // Enum value maps for ResourceType_Trait. @@ -47,6 +48,7 @@ var ( 4: "TRAIT_APP", 5: "TRAIT_SECRET", 6: "TRAIT_SECURITY_INSIGHT", + 7: "TRAIT_SCOPE_BINDING", } ResourceType_Trait_value = map[string]int32{ "TRAIT_UNSPECIFIED": 0, @@ -56,6 +58,7 @@ var ( "TRAIT_APP": 4, "TRAIT_SECRET": 5, "TRAIT_SECURITY_INSIGHT": 6, + "TRAIT_SCOPE_BINDING": 7, } ) @@ -81,7 +84,6 @@ func (x ResourceType_Trait) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// FIXME(mstanbCO): call this something else? Should it just be a bool? Possibly just use an annotation? type Resource_CreationSource int32 const ( @@ -2820,17 +2822,23 @@ func (b0 ResourceId_builder) Build() *ResourceId { } type Resource struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` - Id *ResourceId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` - DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - Annotations []*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - BatonResource bool `protobuf:"varint,6,opt,name=baton_resource,json=batonResource,proto3" json:"baton_resource,omitempty"` - ExternalId *ExternalId `protobuf:"bytes,7,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` - CreationSource Resource_CreationSource `protobuf:"varint,8,opt,name=creation_source,json=creationSource,proto3,enum=c1.connector.v2.Resource_CreationSource" json:"creation_source,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"hybrid.v1"` + Id *ResourceId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Annotations []*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + BatonResource bool `protobuf:"varint,6,opt,name=baton_resource,json=batonResource,proto3" json:"baton_resource,omitempty"` + // Deprecated. This is no longer used. + // + // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. + ExternalId *ExternalId `protobuf:"bytes,7,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // Deprecated. This is no longer used. + // + // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. + CreationSource Resource_CreationSource `protobuf:"varint,8,opt,name=creation_source,json=creationSource,proto3,enum=c1.connector.v2.Resource_CreationSource" json:"creation_source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Resource) Reset() { @@ -2900,6 +2908,7 @@ func (x *Resource) GetBatonResource() bool { return false } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) GetExternalId() *ExternalId { if x != nil { return x.ExternalId @@ -2907,6 +2916,7 @@ func (x *Resource) GetExternalId() *ExternalId { return nil } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) GetCreationSource() Resource_CreationSource { if x != nil { return x.CreationSource @@ -2938,10 +2948,12 @@ func (x *Resource) SetBatonResource(v bool) { x.BatonResource = v } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) SetExternalId(v *ExternalId) { x.ExternalId = v } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) SetCreationSource(v Resource_CreationSource) { x.CreationSource = v } @@ -2960,6 +2972,7 @@ func (x *Resource) HasParentResourceId() bool { return x.ParentResourceId != nil } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) HasExternalId() bool { if x == nil { return false @@ -2975,6 +2988,7 @@ func (x *Resource) ClearParentResourceId() { x.ParentResourceId = nil } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) ClearExternalId() { x.ExternalId = nil } @@ -2988,8 +3002,14 @@ type Resource_builder struct { Annotations []*anypb.Any Description string BatonResource bool - ExternalId *ExternalId - CreationSource Resource_CreationSource + // Deprecated. This is no longer used. + // + // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. + ExternalId *ExternalId + // Deprecated. This is no longer used. + // + // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. + CreationSource Resource_CreationSource } func (b0 Resource_builder) Build() *Resource { @@ -4453,7 +4473,7 @@ var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor const file_c1_connector_v2_resource_proto_rawDesc = "" + "\n" + - "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xd1\x03\n" + + "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xea\x03\n" + "\fResourceType\x12\x1a\n" + "\x02id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\x02id\x120\n" + @@ -4463,7 +4483,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80 \xd0\x01\x01R\vdescription\x12-\n" + - "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"\x8c\x01\n" + + "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"\xa5\x01\n" + "\x05Trait\x12\x15\n" + "\x11TRAIT_UNSPECIFIED\x10\x00\x12\x0e\n" + "\n" + @@ -4473,7 +4493,8 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "TRAIT_ROLE\x10\x03\x12\r\n" + "\tTRAIT_APP\x10\x04\x12\x10\n" + "\fTRAIT_SECRET\x10\x05\x12\x1a\n" + - "\x16TRAIT_SECURITY_INSIGHT\x10\x06\"\xa6\x02\n" + + "\x16TRAIT_SECURITY_INSIGHT\x10\x06\x12\x17\n" + + "\x13TRAIT_SCOPE_BINDING\x10\a\"\xa6\x02\n" + ",ResourceTypesServiceListResourceTypesRequest\x121\n" + "\x06parent\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\x06parent\x12'\n" + "\tpage_size\x18\x02 \x01(\rB\n" + @@ -4615,7 +4636,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\xfaB\ar\x05 \x01(\x80\bR\fresourceType\x12&\n" + "\bresource\x18\x02 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\bresource\x12%\n" + - "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf0\x04\n" + + "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf8\x04\n" + "\bResource\x12+\n" + "\x02id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x02id\x12I\n" + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\x120\n" + @@ -4624,10 +4645,10 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80\x10\xd0\x01\x01R\vdescription\x12%\n" + - "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12<\n" + - "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdR\n" + - "externalId\x12Q\n" + - "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceR\x0ecreationSource\"\x98\x01\n" + + "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12@\n" + + "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdB\x02\x18\x01R\n" + + "externalId\x12U\n" + + "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceB\x02\x18\x01R\x0ecreationSource\"\x98\x01\n" + "\x0eCreationSource\x12\x1f\n" + "\x1bCREATION_SOURCE_UNSPECIFIED\x10\x00\x12,\n" + "(CREATION_SOURCE_CONNECTOR_LIST_RESOURCES\x10\x01\x127\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go index c2093c67..12dcb8a5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connector/v2/resource_protoopaque.pb.go @@ -35,6 +35,7 @@ const ( ResourceType_TRAIT_APP ResourceType_Trait = 4 ResourceType_TRAIT_SECRET ResourceType_Trait = 5 ResourceType_TRAIT_SECURITY_INSIGHT ResourceType_Trait = 6 + ResourceType_TRAIT_SCOPE_BINDING ResourceType_Trait = 7 ) // Enum value maps for ResourceType_Trait. @@ -47,6 +48,7 @@ var ( 4: "TRAIT_APP", 5: "TRAIT_SECRET", 6: "TRAIT_SECURITY_INSIGHT", + 7: "TRAIT_SCOPE_BINDING", } ResourceType_Trait_value = map[string]int32{ "TRAIT_UNSPECIFIED": 0, @@ -56,6 +58,7 @@ var ( "TRAIT_APP": 4, "TRAIT_SECRET": 5, "TRAIT_SECURITY_INSIGHT": 6, + "TRAIT_SCOPE_BINDING": 7, } ) @@ -81,7 +84,6 @@ func (x ResourceType_Trait) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// FIXME(mstanbCO): call this something else? Should it just be a bool? Possibly just use an annotation? type Resource_CreationSource int32 const ( @@ -2878,6 +2880,7 @@ func (x *Resource) GetBatonResource() bool { return false } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) GetExternalId() *ExternalId { if x != nil { return x.xxx_hidden_ExternalId @@ -2885,6 +2888,7 @@ func (x *Resource) GetExternalId() *ExternalId { return nil } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) GetCreationSource() Resource_CreationSource { if x != nil { return x.xxx_hidden_CreationSource @@ -2916,10 +2920,12 @@ func (x *Resource) SetBatonResource(v bool) { x.xxx_hidden_BatonResource = v } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) SetExternalId(v *ExternalId) { x.xxx_hidden_ExternalId = v } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) SetCreationSource(v Resource_CreationSource) { x.xxx_hidden_CreationSource = v } @@ -2938,6 +2944,7 @@ func (x *Resource) HasParentResourceId() bool { return x.xxx_hidden_ParentResourceId != nil } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) HasExternalId() bool { if x == nil { return false @@ -2953,6 +2960,7 @@ func (x *Resource) ClearParentResourceId() { x.xxx_hidden_ParentResourceId = nil } +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. func (x *Resource) ClearExternalId() { x.xxx_hidden_ExternalId = nil } @@ -2966,8 +2974,14 @@ type Resource_builder struct { Annotations []*anypb.Any Description string BatonResource bool - ExternalId *ExternalId - CreationSource Resource_CreationSource + // Deprecated. This is no longer used. + // + // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. + ExternalId *ExternalId + // Deprecated. This is no longer used. + // + // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. + CreationSource Resource_CreationSource } func (b0 Resource_builder) Build() *Resource { @@ -4446,7 +4460,7 @@ var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor const file_c1_connector_v2_resource_proto_rawDesc = "" + "\n" + - "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xd1\x03\n" + + "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xea\x03\n" + "\fResourceType\x12\x1a\n" + "\x02id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\x02id\x120\n" + @@ -4456,7 +4470,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80 \xd0\x01\x01R\vdescription\x12-\n" + - "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"\x8c\x01\n" + + "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"\xa5\x01\n" + "\x05Trait\x12\x15\n" + "\x11TRAIT_UNSPECIFIED\x10\x00\x12\x0e\n" + "\n" + @@ -4466,7 +4480,8 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "TRAIT_ROLE\x10\x03\x12\r\n" + "\tTRAIT_APP\x10\x04\x12\x10\n" + "\fTRAIT_SECRET\x10\x05\x12\x1a\n" + - "\x16TRAIT_SECURITY_INSIGHT\x10\x06\"\xa6\x02\n" + + "\x16TRAIT_SECURITY_INSIGHT\x10\x06\x12\x17\n" + + "\x13TRAIT_SCOPE_BINDING\x10\a\"\xa6\x02\n" + ",ResourceTypesServiceListResourceTypesRequest\x121\n" + "\x06parent\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\x06parent\x12'\n" + "\tpage_size\x18\x02 \x01(\rB\n" + @@ -4608,7 +4623,7 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\xfaB\ar\x05 \x01(\x80\bR\fresourceType\x12&\n" + "\bresource\x18\x02 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\bresource\x12%\n" + - "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf0\x04\n" + + "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf8\x04\n" + "\bResource\x12+\n" + "\x02id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x02id\x12I\n" + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\x120\n" + @@ -4617,10 +4632,10 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80\x10\xd0\x01\x01R\vdescription\x12%\n" + - "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12<\n" + - "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdR\n" + - "externalId\x12Q\n" + - "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceR\x0ecreationSource\"\x98\x01\n" + + "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12@\n" + + "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdB\x02\x18\x01R\n" + + "externalId\x12U\n" + + "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceB\x02\x18\x01R\x0ecreationSource\"\x98\x01\n" + "\x0eCreationSource\x12\x1f\n" + "\x1bCREATION_SOURCE_UNSPECIFIED\x10\x00\x12,\n" + "(CREATION_SOURCE_CONNECTOR_LIST_RESOURCES\x10\x01\x127\n" + diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go b/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go index f63d01ba..5d997718 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/actions/actions.go @@ -522,7 +522,7 @@ func (a *ActionManager) invokeResourceAction( go func() { defer close(done) oa.SetStatus(ctx, v2.BatonActionStatus_BATON_ACTION_STATUS_RUNNING) - handlerCtx, cancel := context.WithTimeoutCause(context.Background(), 1*time.Hour, errors.New("action handler timed out")) + handlerCtx, cancel := context.WithTimeoutCause(ctxzap.ToContext(context.Background(), ctxzap.Extract(ctx)), 1*time.Hour, errors.New("action handler timed out")) defer cancel() var oaErr error oa.Rv, oa.Annos, oaErr = handler(handlerCtx, args) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go index ae3f324e..efbaff6b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go @@ -9,6 +9,8 @@ import ( "os" "time" + "github.com/conductorone/baton-sdk/pkg/connectorbuilder" + "github.com/conductorone/baton-sdk/pkg/types" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "github.com/maypok86/otter/v2" "github.com/spf13/cobra" @@ -605,6 +607,7 @@ func MakeCapabilitiesCommand[T field.Configurable]( v *viper.Viper, confschema field.Configuration, getconnector GetConnectorFunc2[T], + opts ...connectorrunner.Option, ) func(*cobra.Command, []string) error { return func(cmd *cobra.Command, args []string) error { // NOTE(shackra): bind all the flags (persistent and @@ -626,29 +629,59 @@ func MakeCapabilitiesCommand[T field.Configurable]( return err } - readFromPath := true - decodeOpts := field.WithAdditionalDecodeHooks(field.FileUploadDecodeHook(readFromPath)) - t, err := MakeGenericConfiguration[T](v, decodeOpts) + var c types.ConnectorServer + + c, err = defaultConnectorBuilder(ctx, opts...) if err != nil { - return fmt.Errorf("failed to make configuration: %w", err) + return fmt.Errorf("failed to build default connector: %w", err) } - // validate required fields and relationship constraints - if err := field.Validate(confschema, t, field.WithAuthMethod(v.GetString("auth-method"))); err != nil { - return err + + if c == nil { + readFromPath := true + decodeOpts := field.WithAdditionalDecodeHooks(field.FileUploadDecodeHook(readFromPath)) + t, err := MakeGenericConfiguration[T](v, decodeOpts) + if err != nil { + return fmt.Errorf("failed to make configuration: %w", err) + } + // validate required fields and relationship constraints + if err := field.Validate(confschema, t, field.WithAuthMethod(v.GetString("auth-method"))); err != nil { + return err + } + + c, err = getconnector(runCtx, t, RunTimeOpts{}) + if err != nil { + return err + } } - c, err := getconnector(runCtx, t, RunTimeOpts{}) - if err != nil { - return err + if c == nil { + return fmt.Errorf("could not create connector %w", err) } - md, err := c.GetMetadata(runCtx, &v2.ConnectorServiceGetMetadataRequest{}) - if err != nil { - return err + type getter interface { + GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilities, error) } - if !md.GetMetadata().HasCapabilities() { - return fmt.Errorf("connector does not support capabilities") + var capabilities *v2.ConnectorCapabilities + + if getCap, ok := c.(getter); ok { + capabilities, err = getCap.GetCapabilities(runCtx) + if err != nil { + return err + } + } + + if capabilities == nil { + md, err := c.GetMetadata(runCtx, &v2.ConnectorServiceGetMetadataRequest{}) + if err != nil { + return err + } + + if !md.GetMetadata().HasCapabilities() { + return fmt.Errorf("connector does not support capabilities") + } + + capabilities = md.GetMetadata().GetCapabilities() } protoMarshaller := protojson.MarshalOptions{ @@ -657,7 +690,7 @@ func MakeCapabilitiesCommand[T field.Configurable]( } a := &anypb.Any{} - err = anypb.MarshalFrom(a, md.GetMetadata().GetCapabilities(), proto.MarshalOptions{Deterministic: true}) + err = anypb.MarshalFrom(a, capabilities, proto.MarshalOptions{Deterministic: true}) if err != nil { return err } @@ -696,3 +729,20 @@ func MakeConfigSchemaCommand[T field.Configurable]( return nil } } + +func defaultConnectorBuilder(ctx context.Context, opts ...connectorrunner.Option) (types.ConnectorServer, error) { + defaultConnector, err := connectorrunner.ExtractDefaultConnector(ctx, opts...) + if err != nil { + return nil, err + } + + if defaultConnector == nil { + return nil, nil + } + + c, err := connectorbuilder.NewConnector(ctx, defaultConnector) + if err != nil { + return nil, err + } + return c, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go index d9304524..02cc5d18 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go @@ -207,15 +207,28 @@ func DefineConfigurationV2[T field.Configurable]( return nil, nil, err } - _, err = cli.AddCommand(mainCMD, v, &schema, &cobra.Command{ - Use: "capabilities", - Short: "Get connector capabilities", - RunE: cli.MakeCapabilitiesCommand(ctx, connectorName, v, confschema, connector), - }) - + defaultConnector, err := connectorrunner.ExtractDefaultConnector(ctx, options...) if err != nil { return nil, nil, err } + if defaultConnector == nil { + _, err = cli.AddCommand(mainCMD, v, &schema, &cobra.Command{ + Use: "capabilities", + Short: "Get connector capabilities", + RunE: cli.MakeCapabilitiesCommand(ctx, connectorName, v, confschema, connector), + }) + if err != nil { + return nil, nil, err + } + } else { + // We don't want to use cli.AddCommand here because we don't want to validate config flags + // So we can call capabilities even with incomplete config + mainCMD.AddCommand(&cobra.Command{ + Use: "capabilities", + Short: "Get connector capabilities", + RunE: cli.MakeCapabilitiesCommand(ctx, connectorName, v, confschema, connector, options...), + }) + } _, err = cli.AddCommand(mainCMD, v, nil, &cobra.Command{ Use: "config", diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go index ed7f1403..adccd2ef 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/accounts.go @@ -62,8 +62,9 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe if len(b.accountManagers) == 0 { l.Error("error: connector does not have account manager configured") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.Unimplemented, "connector does not have account manager configured") + err := status.Error(codes.Unimplemented, "connector does not have account manager configured") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } var accountManager AccountManagerLimited @@ -79,8 +80,9 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe var ok bool accountManager, ok = b.accountManagers["user"] if !ok { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.Unimplemented, "connector has multiple account managers configured, but no resource type specified, and no default account manager configured") + err := status.Error(codes.Unimplemented, "connector has multiple account managers configured, but no resource type specified, and no default account manager configured") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } } } @@ -91,29 +93,30 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe accountManager, ok = b.accountManagers[request.GetResourceTypeId()] if !ok { l.Error("error: connector does not have account manager configured") - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Errorf(codes.Unimplemented, "connector does not have account manager configured for resource type: %s", request.GetResourceTypeId()) + err := status.Errorf(codes.Unimplemented, "connector does not have account manager configured for resource type: %s", request.GetResourceTypeId()) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } } opts, err := crypto.ConvertCredentialOptions(ctx, b.clientSecret, request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: converting credential options failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: converting credential options failed: %w", err) } result, plaintexts, annos, err := accountManager.CreateAccount(ctx, request.GetAccountInfo(), opts) if err != nil { l.Error("error: create account failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: create account failed: %w", err) } pkem, err := crypto.NewEncryptionManager(request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: creating encryption manager failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: creating encryption manager failed: %w", err) } @@ -121,7 +124,7 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe for _, plaintextCredential := range plaintexts { encryptedData, err := pkem.Encrypt(ctx, plaintextCredential) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, err } encryptedDatas = append(encryptedDatas, encryptedData...) @@ -142,8 +145,9 @@ func (b *builder) CreateAccount(ctx context.Context, request *v2.CreateAccountRe case *v2.CreateAccountResponse_InProgressResult: rv.SetInProgress(proto.ValueOrDefault(r)) default: - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.Unimplemented, fmt.Sprintf("unknown result type: %T", result)) + err := status.Error(codes.Unimplemented, fmt.Sprintf("unknown result type: %T", result)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/actions.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/actions.go index 0edab281..b24adff3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/actions.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/actions.go @@ -108,7 +108,7 @@ func (b *builder) ListActionSchemas(ctx context.Context, request *v2.ListActionS actionSchemas, _, err := b.actionManager.ListActionSchemas(ctx, resourceTypeID) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: listing action schemas failed: %w", err) } @@ -129,7 +129,7 @@ func (b *builder) GetActionSchema(ctx context.Context, request *v2.GetActionSche actionSchema, annos, err := b.actionManager.GetActionSchema(ctx, request.GetName()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: action schema %s not found: %w", request.GetName(), err) } @@ -152,7 +152,7 @@ func (b *builder) InvokeAction(ctx context.Context, request *v2.InvokeActionRequ id, actionStatus, resp, annos, err := b.actionManager.InvokeAction(ctx, request.GetName(), resourceTypeID, request.GetArgs()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: invoking action failed: %w", err) } @@ -177,7 +177,7 @@ func (b *builder) GetActionStatus(ctx context.Context, request *v2.GetActionStat actionStatus, name, rv, annos, err := b.actionManager.GetActionStatus(ctx, request.GetId()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: action status for id %s not found: %w", request.GetId(), err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go index ab092893..e5fc4f9b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/connectorbuilder.go @@ -263,13 +263,13 @@ func (b *builder) GetMetadata(ctx context.Context, request *v2.ConnectorServiceG tt := tasks.GetMetadataType md, err := b.metadataProvider.Metadata(ctx) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, err } - md.Capabilities, err = b.getCapabilities(ctx) + md.Capabilities, err = b.GetCapabilities(ctx) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, err } @@ -332,8 +332,8 @@ func (b *builder) Cleanup(ctx context.Context, request *v2.ConnectorServiceClean return resp, err } -// getCapabilities gets all capabilities for a connector. -func (b *builder) getCapabilities(ctx context.Context) (*v2.ConnectorCapabilities, error) { +// GetCapabilities gets all capabilities for a connector. +func (b *builder) GetCapabilities(ctx context.Context) (*v2.ConnectorCapabilities, error) { connectorCaps := make(map[v2.Capability]struct{}) resourceTypeCapabilities := []*v2.ResourceTypeCapability{} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go index 4f303e94..ad8ea9af 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/credentials.go @@ -47,28 +47,29 @@ func (b *builder) RotateCredential(ctx context.Context, request *v2.RotateCreden manager, ok := b.credentialManagers[rt] if !ok { l.Error("error: resource type does not have credential manager configured", zap.String("resource_type", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.Unimplemented, "resource type does not have credential manager configured") + err := status.Error(codes.Unimplemented, "resource type does not have credential manager configured") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } opts, err := crypto.ConvertCredentialOptions(ctx, b.clientSecret, request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: converting credential options failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: converting credential options failed: %w", err) } plaintexts, annos, err := manager.Rotate(ctx, request.GetResourceId(), opts) if err != nil { l.Error("error: rotate credentials on resource failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: rotate credentials on resource failed: %w", err) } pkem, err := crypto.NewEncryptionManager(request.GetCredentialOptions(), request.GetEncryptionConfigs()) if err != nil { l.Error("error: creating encryption manager failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: creating encryption manager failed: %w", err) } @@ -76,7 +77,7 @@ func (b *builder) RotateCredential(ctx context.Context, request *v2.RotateCreden for _, plaintextCredential := range plaintexts { encryptedData, err := pkem.Encrypt(ctx, plaintextCredential) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, err } encryptedDatas = append(encryptedDatas, encryptedData...) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/events.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/events.go index c6bf352f..7b5bc745 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/events.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/events.go @@ -122,7 +122,7 @@ func (b *builder) ListEvents(ctx context.Context, request *v2.ListEventsRequest) Cursor: request.GetCursor(), }) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: listing events failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go index 4c47e653..e9ebbb7f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go @@ -82,13 +82,14 @@ func (b *builder) CreateResource(ctx context.Context, request *v2.CreateResource manager, ok := b.resourceManagers[rt] if !ok { l.Error("error: resource type does not have resource Create() configured", zap.String("resource_type", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Create() configured", rt)) + err := status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Create() configured", rt)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } resource, annos, err := manager.Create(ctx, request.GetResource()) if err != nil { l.Error("error: create resource failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: create resource failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -114,14 +115,15 @@ func (b *builder) DeleteResource(ctx context.Context, request *v2.DeleteResource if !ok { l.Error("error: resource type does not have resource Delete() configured", zap.String("resource_type", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Delete() configured", rt)) + err := status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Delete() configured", rt)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } annos, err := rsDeleter.Delete(ctx, request.GetResourceId(), request.GetParentResourceId()) if err != nil { l.Error("error: deleteV2 resource failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: delete resource failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -147,14 +149,15 @@ func (b *builder) DeleteResourceV2(ctx context.Context, request *v2.DeleteResour if !ok { l.Error("error: resource type does not have resource Delete() configured", zap.String("resource_type", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Delete() configured", rt)) + err := status.Error(codes.Unimplemented, fmt.Sprintf("resource type %s does not have resource Delete() configured", rt)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } annos, err := rsDeleter.Delete(ctx, request.GetResourceId(), request.GetParentResourceId()) if err != nil { l.Error("error: deleteV2 resource failed", zap.Error(err)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: delete resource failed: %w", err) } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go index d0f8cf2e..01c7f238 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go @@ -11,6 +11,8 @@ import ( "github.com/conductorone/baton-sdk/pkg/types/tasks" "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" "go.uber.org/zap" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) // ResourceProvisioner extends ResourceSyncer to add capabilities for granting and revoking access. @@ -71,8 +73,9 @@ func (b *builder) Grant(ctx context.Context, request *v2.GrantManagerServiceGran if !ok { l.Error("error: resource type does not have provisioner configured", zap.String("resource_type", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: resource type does not have provisioner configured") + err := status.Errorf(codes.Unimplemented, "resource type %s does not have provisioner configured", rt) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } retryer := retry.NewRetryer(ctx, retry.RetryConfig{ @@ -90,7 +93,7 @@ func (b *builder) Grant(ctx context.Context, request *v2.GrantManagerServiceGran if retryer.ShouldWaitAndRetry(ctx, err) { continue } - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("grant failed: %w", err) } } @@ -114,8 +117,9 @@ func (b *builder) Revoke(ctx context.Context, request *v2.GrantManagerServiceRev if revokeProvisioner == nil { l.Error("error: resource type does not have provisioner configured", zap.String("resource_type", rt)) - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: resource type does not have provisioner configured") + err := status.Errorf(codes.Unimplemented, "resource type %s does not have provisioner configured", rt) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } retryer := retry.NewRetryer(ctx, retry.RetryConfig{ @@ -133,7 +137,7 @@ func (b *builder) Revoke(ctx context.Context, request *v2.GrantManagerServiceRev if retryer.ShouldWaitAndRetry(ctx, err) { continue } - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("revoke failed: %w", err) } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_syncer.go index 4d52b830..4378730f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_syncer.go @@ -89,8 +89,9 @@ func (b *builder) ListResourceTypes( var out []*v2.ResourceType if len(b.resourceSyncers) == 0 { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: no resource builders found") + err := status.Error(codes.FailedPrecondition, "no resource builders found") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } for _, rb := range b.resourceSyncers { @@ -98,8 +99,9 @@ func (b *builder) ListResourceTypes( } if len(out) == 0 { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: no resource types found") + err := status.Error(codes.FailedPrecondition, "no resource types found") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -115,8 +117,9 @@ func (b *builder) ListResources(ctx context.Context, request *v2.ResourcesServic tt := tasks.ListResourcesType rb, ok := b.resourceSyncers[request.GetResourceTypeId()] if !ok { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: list resources with unknown resource type %s", request.GetResourceTypeId()) + err := fmt.Errorf("error: list resources with unknown resource type %s", request.GetResourceTypeId()) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } token := pagination.Token{ @@ -135,14 +138,15 @@ func (b *builder) ListResources(ctx context.Context, request *v2.ResourcesServic Annotations: retOptions.Annotations, }.Build() if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return resp, fmt.Errorf("error: listing resources failed: %w", err) } if request.GetPageToken() != "" && request.GetPageToken() == retOptions.NextPageToken { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - errMsg := fmt.Sprintf(" with page token %s resource type id %s and resource parent id: %s this is most likely a connector bug", + err := status.Errorf(codes.Internal, + "listing resources failed: next page token unchanged (token=%s, type=%s, parent=%s) - likely a connector bug", request.GetPageToken(), request.GetResourceTypeId(), request.GetParentResourceId()) - return resp, fmt.Errorf("error: listing resources failed: next page token is the same as the current page token %s", errMsg) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return resp, err } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -158,17 +162,19 @@ func (b *builder) GetResource(ctx context.Context, request *v2.ResourceGetterSer resourceType := request.GetResourceId().GetResourceType() rb, ok := b.resourceTargetedSyncers[resourceType] if !ok { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Errorf(codes.Unimplemented, "error: get resource with unknown resource type %s", resourceType) + err := status.Errorf(codes.Unimplemented, "error: get resource with unknown resource type %s", resourceType) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } resource, annos, err := rb.Get(ctx, request.GetResourceId(), request.GetParentResourceId()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: get resource failed: %w", err) } if resource == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, status.Error(codes.NotFound, "error: get resource returned nil") + err := status.Error(codes.NotFound, "error: get resource returned nil") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -188,8 +194,9 @@ func (b *builder) ListStaticEntitlements(ctx context.Context, request *v2.Entitl tt := tasks.ListStaticEntitlementsType rb, ok := b.resourceSyncers[request.GetResourceTypeId()] if !ok { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: list static entitlements with unknown resource type %s", request.GetResourceTypeId()) + err := fmt.Errorf("error: list static entitlements with unknown resource type %s", request.GetResourceTypeId()) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } rbse, ok := rb.(StaticEntitlementSyncerV2) if !ok { @@ -217,12 +224,13 @@ func (b *builder) ListStaticEntitlements(ctx context.Context, request *v2.Entitl Annotations: retOptions.Annotations, }.Build() if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: listing static entitlements failed: %w", err) } if request.GetPageToken() != "" && request.GetPageToken() == retOptions.NextPageToken { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return resp, fmt.Errorf("error: listing static entitlements failed: next page token is the same as the current page token. this is most likely a connector bug") + err := status.Error(codes.Internal, "listing static entitlements failed: next page token unchanged - likely a connector bug") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return resp, err } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -238,8 +246,9 @@ func (b *builder) ListEntitlements(ctx context.Context, request *v2.Entitlements tt := tasks.ListEntitlementsType rb, ok := b.resourceSyncers[request.GetResource().GetId().GetResourceType()] if !ok { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: list entitlements with unknown resource type %s", request.GetResource().GetId().GetResourceType()) + err := fmt.Errorf("error: list entitlements with unknown resource type %s", request.GetResource().GetId().GetResourceType()) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } token := pagination.Token{ Size: int(request.GetPageSize()), @@ -257,12 +266,13 @@ func (b *builder) ListEntitlements(ctx context.Context, request *v2.Entitlements Annotations: retOptions.Annotations, }.Build() if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return resp, fmt.Errorf("error: listing entitlements failed: %w", err) } if request.GetPageToken() != "" && request.GetPageToken() == retOptions.NextPageToken { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return resp, fmt.Errorf("error: listing entitlements failed: next page token is the same as the current page token. this is most likely a connector bug") + err := status.Error(codes.Internal, "listing entitlements failed: next page token unchanged - likely a connector bug") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return resp, err } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -279,8 +289,9 @@ func (b *builder) ListGrants(ctx context.Context, request *v2.GrantsServiceListG rid := request.GetResource().GetId() rb, ok := b.resourceSyncers[rid.GetResourceType()] if !ok { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: list grants with unknown resource type %s", rid.GetResourceType()) + err := fmt.Errorf("error: list grants with unknown resource type %s", rid.GetResourceType()) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } token := pagination.Token{ @@ -300,14 +311,15 @@ func (b *builder) ListGrants(ctx context.Context, request *v2.GrantsServiceListG }.Build() if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return resp, fmt.Errorf("error: listing grants for resource %s/%s failed: %w", rid.GetResourceType(), rid.GetResource(), err) } if request.GetPageToken() != "" && request.GetPageToken() == retOptions.NextPageToken { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return resp, fmt.Errorf("error: listing grants for resource %s/%s failed: next page token is the same as the current page token. this is most likely a connector bug", - rid.GetResourceType(), - rid.GetResource()) + err := status.Errorf(codes.Internal, + "listing grants for resource %s/%s failed: next page token unchanged - likely a connector bug", + rid.GetResourceType(), rid.GetResource()) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return resp, err } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/tickets.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/tickets.go index 740cc3c5..e1ea8bf5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/tickets.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/tickets.go @@ -10,6 +10,8 @@ import ( "github.com/conductorone/baton-sdk/pkg/pagination" "github.com/conductorone/baton-sdk/pkg/retry" "github.com/conductorone/baton-sdk/pkg/types/tasks" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) // TicketManager extends ConnectorBuilder to add capabilities for ticket management. @@ -37,19 +39,21 @@ func (b *builder) BulkCreateTickets(ctx context.Context, request *v2.TicketsServ start := b.nowFunc() tt := tasks.BulkCreateTicketsType if b.ticketManager == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: ticket manager not implemented") + err := status.Error(codes.Unimplemented, "ticket manager not implemented") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } reqBody := request.GetTicketRequests() if len(reqBody) == 0 { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: request body had no items") + err := status.Error(codes.InvalidArgument, "request body had no items") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } ticketsResponse, err := b.ticketManager.BulkCreateTickets(ctx, request) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: creating tickets failed: %w", err) } @@ -66,19 +70,21 @@ func (b *builder) BulkGetTickets(ctx context.Context, request *v2.TicketsService start := b.nowFunc() tt := tasks.BulkGetTicketsType if b.ticketManager == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: ticket manager not implemented") + err := status.Error(codes.Unimplemented, "ticket manager not implemented") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } reqBody := request.GetTicketRequests() if len(reqBody) == 0 { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: request body had no items") + err := status.Error(codes.InvalidArgument, "request body had no items") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } ticketsResponse, err := b.ticketManager.BulkGetTickets(ctx, request) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: fetching tickets failed: %w", err) } @@ -95,8 +101,9 @@ func (b *builder) ListTicketSchemas(ctx context.Context, request *v2.TicketsServ start := b.nowFunc() tt := tasks.ListTicketSchemasType if b.ticketManager == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: ticket manager not implemented") + err := status.Error(codes.Unimplemented, "ticket manager not implemented") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } retryer := retry.NewRetryer(ctx, retry.RetryConfig{ @@ -112,8 +119,9 @@ func (b *builder) ListTicketSchemas(ctx context.Context, request *v2.TicketsServ }) if err == nil { if request.GetPageToken() != "" && request.GetPageToken() == nextPageToken { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: listing ticket schemas failed: next page token is the same as the current page token. this is most likely a connector bug") + err := status.Error(codes.Internal, "listing ticket schemas failed: next page token unchanged - likely a connector bug") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } b.m.RecordTaskSuccess(ctx, tt, b.nowFunc().Sub(start)) @@ -126,7 +134,7 @@ func (b *builder) ListTicketSchemas(ctx context.Context, request *v2.TicketsServ if retryer.ShouldWaitAndRetry(ctx, err) { continue } - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: listing ticket schemas failed: %w", err) } } @@ -138,14 +146,16 @@ func (b *builder) CreateTicket(ctx context.Context, request *v2.TicketsServiceCr start := b.nowFunc() tt := tasks.CreateTicketType if b.ticketManager == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: ticket manager not implemented") + err := status.Error(codes.Unimplemented, "ticket manager not implemented") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } reqBody := request.GetRequest() if reqBody == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: request body is nil") + err := status.Error(codes.InvalidArgument, "request body is nil") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } cTicket := v2.Ticket_builder{ DisplayName: reqBody.GetDisplayName(), @@ -159,7 +169,7 @@ func (b *builder) CreateTicket(ctx context.Context, request *v2.TicketsServiceCr ticket, annos, err := b.ticketManager.CreateTicket(ctx, cTicket, request.GetSchema()) var resp *v2.TicketsServiceCreateTicketResponse if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) if ticket != nil { resp = v2.TicketsServiceCreateTicketResponse_builder{ Ticket: ticket, @@ -183,14 +193,15 @@ func (b *builder) GetTicket(ctx context.Context, request *v2.TicketsServiceGetTi start := b.nowFunc() tt := tasks.GetTicketType if b.ticketManager == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: ticket manager not implemented") + err := status.Error(codes.Unimplemented, "ticket manager not implemented") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } var resp *v2.TicketsServiceGetTicketResponse ticket, annos, err := b.ticketManager.GetTicket(ctx, request.GetId()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) if ticket != nil { resp = v2.TicketsServiceGetTicketResponse_builder{ Ticket: ticket, @@ -214,13 +225,14 @@ func (b *builder) GetTicketSchema(ctx context.Context, request *v2.TicketsServic start := b.nowFunc() tt := tasks.GetTicketSchemaType if b.ticketManager == nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) - return nil, fmt.Errorf("error: ticket manager not implemented") + err := status.Error(codes.Unimplemented, "ticket manager not implemented") + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) + return nil, err } ticketSchema, annos, err := b.ticketManager.GetTicketSchema(ctx, request.GetId()) if err != nil { - b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start)) + b.m.RecordTaskFailure(ctx, tt, b.nowFunc().Sub(start), err) return nil, fmt.Errorf("error: getting ticket metadata failed: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go index 5b7d2148..fb5201ae 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go @@ -11,6 +11,7 @@ import ( "time" "github.com/conductorone/baton-sdk/pkg/bid" + "github.com/conductorone/baton-sdk/pkg/connectorbuilder" "github.com/conductorone/baton-sdk/pkg/synccompactor" "golang.org/x/sync/semaphore" "google.golang.org/protobuf/types/known/structpb" @@ -324,39 +325,41 @@ type syncCompactorConfig struct { } type runnerConfig struct { - rlCfg *ratelimitV1.RateLimiterConfig - rlDescriptors []*ratelimitV1.RateLimitDescriptors_Entry - onDemand bool - c1zPath string - clientAuth bool - clientID string - clientSecret string - provisioningEnabled bool - ticketingEnabled bool - actionsEnabled bool - grantConfig *grantConfig - revokeConfig *revokeConfig - eventFeedConfig *eventStreamConfig - tempDir string - createAccountConfig *createAccountConfig - invokeActionConfig *invokeActionConfig - listActionSchemasConfig *listActionSchemasConfig - deleteResourceConfig *deleteResourceConfig - rotateCredentialsConfig *rotateCredentialsConfig - createTicketConfig *createTicketConfig - bulkCreateTicketConfig *bulkCreateTicketConfig - listTicketSchemasConfig *listTicketSchemasConfig - getTicketConfig *getTicketConfig - syncDifferConfig *syncDifferConfig - syncCompactorConfig *syncCompactorConfig - skipFullSync bool - targetedSyncResourceIDs []string - externalResourceC1Z string - externalResourceEntitlementIdFilter string - skipEntitlementsAndGrants bool - skipGrants bool - sessionStoreEnabled bool - syncResourceTypeIDs []string + rlCfg *ratelimitV1.RateLimiterConfig + rlDescriptors []*ratelimitV1.RateLimitDescriptors_Entry + onDemand bool + c1zPath string + clientAuth bool + clientID string + clientSecret string + provisioningEnabled bool + ticketingEnabled bool + actionsEnabled bool + grantConfig *grantConfig + revokeConfig *revokeConfig + eventFeedConfig *eventStreamConfig + tempDir string + createAccountConfig *createAccountConfig + invokeActionConfig *invokeActionConfig + listActionSchemasConfig *listActionSchemasConfig + deleteResourceConfig *deleteResourceConfig + rotateCredentialsConfig *rotateCredentialsConfig + createTicketConfig *createTicketConfig + bulkCreateTicketConfig *bulkCreateTicketConfig + listTicketSchemasConfig *listTicketSchemasConfig + getTicketConfig *getTicketConfig + syncDifferConfig *syncDifferConfig + syncCompactorConfig *syncCompactorConfig + skipFullSync bool + targetedSyncResourceIDs []string + externalResourceC1Z string + externalResourceEntitlementIdFilter string + skipEntitlementsAndGrants bool + skipGrants bool + sessionStoreEnabled bool + syncResourceTypeIDs []string + defaultCapabilitiesConnectorBuilder connectorbuilder.ConnectorBuilder + defaultCapabilitiesConnectorBuilderV2 connectorbuilder.ConnectorBuilderV2 } func WithSessionStoreEnabled() Option { @@ -701,6 +704,45 @@ func WithSkipGrants(skip bool) Option { } } +// WithDefaultCapabilitiesConnectorBuilder sets the default connector builder for the runner +// This is used by the "capabilities" sub-command to instantiate the connector. +func WithDefaultCapabilitiesConnectorBuilder(t connectorbuilder.ConnectorBuilder) Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.defaultCapabilitiesConnectorBuilder = t + return nil + } +} + +// WithDefaultCapabilitiesConnectorBuilderV2 sets the default connector builder for the runner +// This is used by the "capabilities" sub-command to instantiate the connector. +func WithDefaultCapabilitiesConnectorBuilderV2(t connectorbuilder.ConnectorBuilderV2) Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.defaultCapabilitiesConnectorBuilderV2 = t + return nil + } +} + +func ExtractDefaultConnector(ctx context.Context, options ...Option) (any, error) { + cfg := &runnerConfig{} + + for _, o := range options { + err := o(ctx, cfg) + if err != nil { + return nil, err + } + } + + if cfg.defaultCapabilitiesConnectorBuilder != nil { + return cfg.defaultCapabilitiesConnectorBuilder, nil + } + + if cfg.defaultCapabilitiesConnectorBuilderV2 != nil { + return cfg.defaultCapabilitiesConnectorBuilderV2, nil + } + + return nil, nil +} + func IsSessionStoreEnabled(ctx context.Context, options ...Option) (bool, error) { cfg := &runnerConfig{} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go index 911bf095..19876916 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file.go @@ -60,6 +60,9 @@ type C1File struct { slowQueryLogTimesMu sync.Mutex slowQueryThreshold time.Duration slowQueryLogFrequency time.Duration + + // Sync cleanup settings + syncLimit int } var _ connectorstore.Writer = (*C1File)(nil) @@ -93,6 +96,14 @@ func WithC1FEncoderConcurrency(concurrency int) C1FOption { } } +// WithC1FSyncCountLimit sets the number of syncs to keep during cleanup. +// If not set, defaults to 2 (or BATON_KEEP_SYNC_COUNT env var if set). +func WithC1FSyncCountLimit(limit int) C1FOption { + return func(o *C1File) { + o.syncLimit = limit + } +} + // Returns a C1File instance for the given db filepath. func NewC1File(ctx context.Context, dbFilePath string, opts ...C1FOption) (*C1File, error) { ctx, span := tracer.Start(ctx, "NewC1File") @@ -139,7 +150,9 @@ type c1zOptions struct { decoderOptions []DecoderOption readOnly bool encoderConcurrency int + syncLimit int } + type C1ZOption func(*c1zOptions) // WithTmpDir sets the temporary directory to extract the c1z file to. @@ -179,6 +192,14 @@ func WithEncoderConcurrency(concurrency int) C1ZOption { } } +// WithSyncLimit sets the number of syncs to keep during cleanup. +// If not set, defaults to 2 (or BATON_KEEP_SYNC_COUNT env var if set). +func WithSyncLimit(limit int) C1ZOption { + return func(o *c1zOptions) { + o.syncLimit = limit + } +} + // Returns a new C1File instance with its state stored at the provided filename. func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) (*C1File, error) { ctx, span := tracer.Start(ctx, "NewC1ZFile") @@ -207,6 +228,9 @@ func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) ( return nil, fmt.Errorf("encoder concurrency must be greater than 0") } c1fopts = append(c1fopts, WithC1FEncoderConcurrency(options.encoderConcurrency)) + if options.syncLimit > 0 { + c1fopts = append(c1fopts, WithC1FSyncCountLimit(options.syncLimit)) + } c1File, err := NewC1File(ctx, dbFilePath, c1fopts...) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go index d7ee4c6d..54e64f4f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/c1file_attached.go @@ -2,12 +2,15 @@ package dotc1z import ( "context" + "database/sql" "errors" "fmt" + "time" reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" "github.com/conductorone/baton-sdk/pkg/connectorstore" "github.com/doug-martin/goqu/v9" + "github.com/segmentio/ksuid" ) type C1FileAttached struct { @@ -37,8 +40,8 @@ func (c *C1FileAttached) CompactTable(ctx context.Context, baseSyncID string, ap selectList += ", " } columnList += col - if col == "sync_id" { - selectList += "? as sync_id" + if col == "sync_id" { //nolint:goconst,nolintlint // ... + selectList += "? as sync_id" //nolint:goconst,nolintlint // ... } else { selectList += col } @@ -174,3 +177,223 @@ func (c *C1FileAttached) UpdateSync(ctx context.Context, baseSync *reader_v2.Syn return nil } + +// GenerateSyncDiffFromFile compares the old sync (in attached) with the new sync (in main) +// and generates two new syncs in the main database. +// +// IMPORTANT: This assumes main=NEW/compacted and attached=OLD/base: +// - diffTableFromAttached: items in attached (OLD) not in main (NEW) = deletions +// - diffTableFromMain: items in main (NEW) not in attached (OLD) = upserts (additions) +// +// Parameters: +// - oldSyncID: the sync ID in the attached database (OLD/base state) +// - newSyncID: the sync ID in the main database (NEW/compacted state) +// +// Returns (upsertsSyncID, deletionsSyncID, error). +func (c *C1FileAttached) GenerateSyncDiffFromFile(ctx context.Context, oldSyncID string, newSyncID string) (string, string, error) { + if !c.safe { + return "", "", errors.New("database has been detached") + } + + ctx, span := tracer.Start(ctx, "C1FileAttached.GenerateSyncDiffFromFile") + defer span.End() + + // Generate unique IDs for the diff syncs + deletionsSyncID := ksuid.New().String() + upsertsSyncID := ksuid.New().String() + + // Start transaction for atomicity + tx, err := c.file.rawDb.BeginTx(ctx, nil) + if err != nil { + return "", "", fmt.Errorf("failed to begin transaction: %w", err) + } + + // Ensure rollback on error + committed := false + defer func() { + if !committed { + _ = tx.Rollback() + } + }() + + now := time.Now().Format("2006-01-02 15:04:05.999999999") + + // Create the deletions sync first (so upserts is "latest") + // Link it to upserts sync bidirectionally + deletionsInsert := c.file.db.Insert(syncRuns.Name()).Rows(goqu.Record{ + "sync_id": deletionsSyncID, + "started_at": now, + "sync_token": "", + "sync_type": connectorstore.SyncTypePartialDeletions, + "parent_sync_id": oldSyncID, + "linked_sync_id": upsertsSyncID, + }) + query, args, err := deletionsInsert.ToSQL() + if err != nil { + return "", "", fmt.Errorf("failed to build deletions sync insert: %w", err) + } + if _, err = tx.ExecContext(ctx, query, args...); err != nil { + return "", "", fmt.Errorf("failed to create deletions sync: %w", err) + } + + // Create the upserts sync, linked to deletions sync + upsertsInsert := c.file.db.Insert(syncRuns.Name()).Rows(goqu.Record{ + "sync_id": upsertsSyncID, + "started_at": now, + "sync_token": "", + "sync_type": connectorstore.SyncTypePartialUpserts, + "parent_sync_id": oldSyncID, + "linked_sync_id": deletionsSyncID, + }) + query, args, err = upsertsInsert.ToSQL() + if err != nil { + return "", "", fmt.Errorf("failed to build upserts sync insert: %w", err) + } + if _, err = tx.ExecContext(ctx, query, args...); err != nil { + return "", "", fmt.Errorf("failed to create upserts sync: %w", err) + } + + // Process each table + // main=NEW, attached=OLD + // - diffTableFromAttachedTx finds items in OLD not in NEW = deletions + // - diffTableFromMainTx finds items in NEW not in OLD or modified = upserts + tables := []string{"v1_resource_types", "v1_resources", "v1_entitlements", "v1_grants"} + for _, tableName := range tables { + if err := c.diffTableFromAttachedTx(ctx, tx, tableName, oldSyncID, newSyncID, deletionsSyncID); err != nil { + return "", "", fmt.Errorf("failed to generate deletions for %s: %w", tableName, err) + } + if err := c.diffTableFromMainTx(ctx, tx, tableName, oldSyncID, newSyncID, upsertsSyncID); err != nil { + return "", "", fmt.Errorf("failed to generate upserts for %s: %w", tableName, err) + } + } + + // End the syncs (deletions first, then upserts) + endedAt := time.Now().Format("2006-01-02 15:04:05.999999999") + + endDeletions := c.file.db.Update(syncRuns.Name()). + Set(goqu.Record{"ended_at": endedAt}). + Where(goqu.C("sync_id").Eq(deletionsSyncID), goqu.C("ended_at").IsNull()) + query, args, err = endDeletions.ToSQL() + if err != nil { + return "", "", fmt.Errorf("failed to build end deletions sync: %w", err) + } + if _, err = tx.ExecContext(ctx, query, args...); err != nil { + return "", "", fmt.Errorf("failed to end deletions sync: %w", err) + } + + endUpserts := c.file.db.Update(syncRuns.Name()). + Set(goqu.Record{"ended_at": endedAt}). + Where(goqu.C("sync_id").Eq(upsertsSyncID), goqu.C("ended_at").IsNull()) + query, args, err = endUpserts.ToSQL() + if err != nil { + return "", "", fmt.Errorf("failed to build end upserts sync: %w", err) + } + if _, err = tx.ExecContext(ctx, query, args...); err != nil { + return "", "", fmt.Errorf("failed to end upserts sync: %w", err) + } + + // Commit transaction + if err = tx.Commit(); err != nil { + return "", "", fmt.Errorf("failed to commit transaction: %w", err) + } + committed = true + c.file.dbUpdated = true + + return upsertsSyncID, deletionsSyncID, nil +} + +// diffTableFromAttachedTx finds items in attached (OLD) that don't exist in main (NEW). +// These are DELETIONS - items that existed before but no longer exist. +// Uses the provided transaction. +func (c *C1FileAttached) diffTableFromAttachedTx(ctx context.Context, tx *sql.Tx, tableName string, oldSyncID string, newSyncID string, targetSyncID string) error { + columns, err := c.getTableColumns(ctx, tableName) + if err != nil { + return err + } + + // Build column lists + columnList := "" + selectList := "" + for i, col := range columns { + if i > 0 { + columnList += ", " + selectList += ", " + } + columnList += col + if col == "sync_id" { + selectList += "? as sync_id" + } else { + selectList += col + } + } + + // Insert items from attached (OLD) that don't exist in main (NEW) + // oldSyncID is in attached, newSyncID is in main + //nolint:gosec // table names are from hardcoded list, not user input + query := fmt.Sprintf(` + INSERT INTO main.%s (%s) + SELECT %s + FROM attached.%s AS a + WHERE a.sync_id = ? + AND NOT EXISTS ( + SELECT 1 FROM main.%s AS m + WHERE m.external_id = a.external_id AND m.sync_id = ? + ) + `, tableName, columnList, selectList, tableName, tableName) + + _, err = tx.ExecContext(ctx, query, targetSyncID, oldSyncID, newSyncID) + return err +} + +// diffTableFromMainTx finds items in main (NEW) that are new or modified compared to attached (OLD). +// These are UPSERTS - items that are new or have changed. +// Uses the provided transaction. +func (c *C1FileAttached) diffTableFromMainTx(ctx context.Context, tx *sql.Tx, tableName string, oldSyncID string, newSyncID string, targetSyncID string) error { + columns, err := c.getTableColumns(ctx, tableName) + if err != nil { + return err + } + + // Build column lists + columnList := "" + selectList := "" + for i, col := range columns { + if i > 0 { + columnList += ", " + selectList += ", " + } + columnList += col + if col == "sync_id" { + selectList += "? as sync_id" + } else { + selectList += col + } + } + + // Insert items from main (NEW) that are: + // 1. Not in attached (OLD) - additions + // 2. In attached but with different data - modifications + // newSyncID is in main, oldSyncID is in attached + //nolint:gosec // table names are from hardcoded list, not user input + query := fmt.Sprintf(` + INSERT INTO main.%s (%s) + SELECT %s + FROM main.%s AS m + WHERE m.sync_id = ? + AND ( + NOT EXISTS ( + SELECT 1 FROM attached.%s AS a + WHERE a.external_id = m.external_id AND a.sync_id = ? + ) + OR EXISTS ( + SELECT 1 FROM attached.%s AS a + WHERE a.external_id = m.external_id + AND a.sync_id = ? + AND a.data != m.data + ) + ) + `, tableName, columnList, selectList, tableName, tableName, tableName) + + _, err = tx.ExecContext(ctx, query, targetSyncID, newSyncID, oldSyncID, oldSyncID) + return err +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/session_store.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/session_store.go index 796c0648..c20be9d6 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/session_store.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/session_store.go @@ -216,7 +216,8 @@ func (c *C1File) Clear(ctx context.Context, opt ...sessions.SessionStoreOption) q = q.Where(goqu.C("sync_id").Eq(bag.SyncID)) if bag.Prefix != "" { - q = q.Where(goqu.C("key").Like(escapeLike(bag.Prefix) + "%")) + pattern := escapeLike(bag.Prefix) + "%" + q = q.Where(goqu.L("key LIKE ? ESCAPE '\\'", pattern)) } sql, params, err := q.ToSQL() @@ -366,7 +367,8 @@ func (c *C1File) getAllChunk(ctx context.Context, pageToken string, sizeLimit in Limit(100) if bag.Prefix != "" { - q = q.Where(goqu.C("key").Like(escapeLike(bag.Prefix) + "%")) + pattern := escapeLike(bag.Prefix) + "%" + q = q.Where(goqu.L("key LIKE ? ESCAPE '\\'", pattern)) } if pageToken != "" { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go index 9c3efa34..296da43f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go @@ -279,7 +279,8 @@ func listConnectorObjects[T proto.Message](ctx context.Context, c *C1File, table return ret, nextPageToken, nil } -var protoMarshaler = proto.MarshalOptions{Deterministic: false} +// This is required for sync diffs to work. Its not much slower. +var protoMarshaler = proto.MarshalOptions{Deterministic: true} // prepareSingleConnectorObjectRow processes a single message and returns the prepared record. func prepareSingleConnectorObjectRow[T proto.Message]( @@ -344,8 +345,8 @@ func prepareConnectorObjectRowsParallel[T proto.Message]( protoMarshallers := make([]proto.MarshalOptions, numWorkers) for i := range numWorkers { - // Don't enable deterministic marshaling, as it sorts keys in lexicographical order which hurts performance. - protoMarshallers[i] = proto.MarshalOptions{} + // Deterministic marshaling is required for sync diffs to work. Its not much slower. + protoMarshallers[i] = proto.MarshalOptions{Deterministic: true} } rows := make([]*goqu.Record, len(msgs)) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go index e2b4ee78..4426a3e5 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sync_runs.go @@ -32,7 +32,8 @@ create table if not exists %s ( ended_at datetime, sync_token text not null, sync_type text not null default 'full', - parent_sync_id text not null default '' + parent_sync_id text not null default '', + linked_sync_id text not null default '' ); create unique index if not exists %s on %s (sync_id);` @@ -83,6 +84,19 @@ func (r *syncRunsTable) Migrations(ctx context.Context, db *goqu.Database) error } } + // Check if linked_sync_id column exists + var linkedSyncIDExists int + err = db.QueryRowContext(ctx, fmt.Sprintf("select count(*) from pragma_table_info('%s') where name='linked_sync_id'", r.Name())).Scan(&linkedSyncIDExists) + if err != nil { + return err + } + if linkedSyncIDExists == 0 { + _, err = db.ExecContext(ctx, fmt.Sprintf("alter table %s add column linked_sync_id text not null default ''", r.Name())) + if err != nil { + return err + } + } + return nil } @@ -93,6 +107,7 @@ type syncRun struct { SyncToken string Type connectorstore.SyncType ParentSyncID string + LinkedSyncID string } // getCachedViewSyncRun returns the cached sync run for read operations. @@ -144,7 +159,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connector oneWeekAgo := time.Now().AddDate(0, 0, -7) ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") + q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id") q = q.Where(goqu.C("ended_at").IsNull()) q = q.Where(goqu.C("started_at").Gte(oneWeekAgo)) q = q.Order(goqu.C("started_at").Desc()) @@ -160,7 +175,7 @@ func (c *C1File) getLatestUnfinishedSync(ctx context.Context, syncType connector row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -187,7 +202,7 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType conn ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") + q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id") q = q.Where(goqu.C("ended_at").IsNotNull()) if syncType != connectorstore.SyncTypeAny { q = q.Where(goqu.C("sync_type").Eq(syncType)) @@ -206,7 +221,7 @@ func (c *C1File) getFinishedSync(ctx context.Context, offset uint, syncType conn row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -227,7 +242,7 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui } q := c.db.From(syncRuns.Name()).Prepared(true) - q = q.Select("id", "sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") + q = q.Select("id", "sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id") if pageToken != "" { q = q.Where(goqu.C("id").Gte(pageToken)) @@ -262,7 +277,7 @@ func (c *C1File) ListSyncRuns(ctx context.Context, pageToken string, pageSize ui } rowId := 0 data := &syncRun{} - err := rows.Scan(&rowId, &data.ID, &data.StartedAt, &data.EndedAt, &data.SyncToken, &data.Type, &data.ParentSyncID) + err := rows.Scan(&rowId, &data.ID, &data.StartedAt, &data.EndedAt, &data.SyncToken, &data.Type, &data.ParentSyncID, &data.LinkedSyncID) if err != nil { return nil, "", err } @@ -351,7 +366,7 @@ func (c *C1File) getSync(ctx context.Context, syncID string) (*syncRun, error) { ret := &syncRun{} q := c.db.From(syncRuns.Name()) - q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id") + q = q.Select("sync_id", "started_at", "ended_at", "sync_token", "sync_type", "parent_sync_id", "linked_sync_id") q = q.Where(goqu.C("sync_id").Eq(syncID)) query, args, err := q.ToSQL() @@ -359,7 +374,7 @@ func (c *C1File) getSync(ctx context.Context, syncID string) (*syncRun, error) { return nil, err } row := c.db.QueryRowContext(ctx, query, args...) - err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID) + err = row.Scan(&ret.ID, &ret.StartedAt, &ret.EndedAt, &ret.SyncToken, &ret.Type, &ret.ParentSyncID, &ret.LinkedSyncID) if err != nil { return nil, err } @@ -558,6 +573,10 @@ func (c *C1File) StartNewSync(ctx context.Context, syncType connectorstore.SyncT } func (c *C1File) insertSyncRun(ctx context.Context, syncID string, syncType connectorstore.SyncType, parentSyncID string) error { + return c.insertSyncRunWithLink(ctx, syncID, syncType, parentSyncID, "") +} + +func (c *C1File) insertSyncRunWithLink(ctx context.Context, syncID string, syncType connectorstore.SyncType, parentSyncID string, linkedSyncID string) error { if c.readOnly { return ErrReadOnly } @@ -569,6 +588,7 @@ func (c *C1File) insertSyncRun(ctx context.Context, syncID string, syncType conn "sync_token": "", "sync_type": syncType, "parent_sync_id": parentSyncID, + "linked_sync_id": linkedSyncID, }) query, args, err := q.ToSQL() @@ -659,8 +679,9 @@ func (c *C1File) Cleanup(ctx context.Context) error { return nil } - var ret []*syncRun + var fullSyncs []*syncRun var partials []*syncRun + var diffSyncs []*syncRun pageToken := "" for { @@ -673,10 +694,13 @@ func (c *C1File) Cleanup(ctx context.Context) error { if sr.EndedAt == nil { continue } - if sr.Type == connectorstore.SyncTypePartial || sr.Type == connectorstore.SyncTypeResourcesOnly { + switch sr.Type { + case connectorstore.SyncTypePartial, connectorstore.SyncTypeResourcesOnly: partials = append(partials, sr) - } else { - ret = append(ret, sr) + case connectorstore.SyncTypePartialUpserts, connectorstore.SyncTypePartialDeletions: + diffSyncs = append(diffSyncs, sr) + default: + fullSyncs = append(fullSyncs, sr) } } @@ -687,27 +711,31 @@ func (c *C1File) Cleanup(ctx context.Context) error { } syncLimit := 2 - if customSyncLimit, err := strconv.ParseInt(os.Getenv("BATON_KEEP_SYNC_COUNT"), 10, 64); err == nil && customSyncLimit > 0 { + if c.syncLimit > 0 { + syncLimit = c.syncLimit + } else if customSyncLimit, err := strconv.ParseInt(os.Getenv("BATON_KEEP_SYNC_COUNT"), 10, 64); err == nil && customSyncLimit > 0 { syncLimit = int(customSyncLimit) } - l.Debug("found syncs", zap.Int("count", len(ret)), zap.Int("sync_limit", syncLimit)) - if len(ret) <= syncLimit { - return nil - } + l.Debug("found syncs", + zap.Int("full_count", len(fullSyncs)), + zap.Int("partial_count", len(partials)), + zap.Int("diff_count", len(diffSyncs)), + zap.Int("sync_limit", syncLimit)) - l.Info("Cleaning up old sync data...") - for i := 0; i < len(ret)-syncLimit; i++ { - err = c.DeleteSyncRun(ctx, ret[i].ID) - if err != nil { - return err + // Clean up old full syncs beyond the limit + if len(fullSyncs) > syncLimit { + l.Info("Cleaning up old sync data...") + for i := 0; i < len(fullSyncs)-syncLimit; i++ { + err = c.DeleteSyncRun(ctx, fullSyncs[i].ID) + if err != nil { + return err + } + l.Info("Removed old sync data.", zap.String("sync_date", fullSyncs[i].EndedAt.Format(time.RFC3339)), zap.String("sync_id", fullSyncs[i].ID)) } - l.Info("Removed old sync data.", zap.String("sync_date", ret[i].EndedAt.Format(time.RFC3339)), zap.String("sync_id", ret[i].ID)) - } - // Delete non-full syncs that ended before the earliest-kept full sync started - if len(ret) > syncLimit { - earliestKeptSync := ret[len(ret)-syncLimit] + // Delete partial syncs that ended before the earliest-kept full sync started + earliestKeptSync := fullSyncs[len(fullSyncs)-syncLimit] l.Debug("Earliest kept sync", zap.String("sync_id", earliestKeptSync.ID), zap.Time("started_at", *earliestKeptSync.StartedAt)) for _, partial := range partials { @@ -724,6 +752,56 @@ func (c *C1File) Cleanup(ctx context.Context) error { } } + // Clean up old diff syncs - keep only the most recent diff sync (upserts or deletions) and its linked pair (if present) + if len(diffSyncs) > 2 { + // Build a map for quick lookup by ID + syncByID := make(map[string]*syncRun) + for _, ds := range diffSyncs { + syncByID[ds.ID] = ds + } + + // Determine which syncs to keep. diffSyncs are ordered by row id (ascending), + // so the last element is the most recently created diff sync. + keepIDs := make(map[string]bool) + latestDiff := diffSyncs[len(diffSyncs)-1] + keepIDs[latestDiff.ID] = true + l.Debug("keeping latest diff sync", + zap.String("sync_id", latestDiff.ID), + zap.String("sync_type", string(latestDiff.Type))) + + // Also keep its linked pair if it exists. + // NOTE: We intentionally do NOT require a bidirectional link; if the latest diff sync exists, + // it's better to keep it and best-effort keep its linked partner (if present). + if latestDiff.LinkedSyncID != "" { + if linkedSync := syncByID[latestDiff.LinkedSyncID]; linkedSync != nil { + keepIDs[linkedSync.ID] = true + l.Debug("keeping linked diff sync", + zap.String("sync_id", linkedSync.ID), + zap.String("sync_type", string(linkedSync.Type))) + if linkedSync.LinkedSyncID != latestDiff.ID { + l.Warn("diff sync link is not bidirectional", + zap.String("sync_id", latestDiff.ID), + zap.String("linked_sync_id", latestDiff.LinkedSyncID), + zap.String("linked_sync_linked_sync_id", linkedSync.LinkedSyncID)) + } + } + } + + // Delete all diff syncs except the ones we're keeping + for _, ds := range diffSyncs { + if keepIDs[ds.ID] { + continue + } + err = c.DeleteSyncRun(ctx, ds.ID) + if err != nil { + return err + } + l.Info("Removed old diff sync.", + zap.String("sync_type", string(ds.Type)), + zap.String("sync_id", ds.ID)) + } + } + l.Debug("vacuuming database") err = c.Vacuum(ctx) if err != nil { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go b/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go index 18bd2d63..e69463df 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/provisioner/provisioner.go @@ -184,7 +184,7 @@ func (p *Provisioner) grant(ctx context.Context) error { DisplayName: principal.GetResource().GetDisplayName(), Annotations: principal.GetResource().GetAnnotations(), Description: principal.GetResource().GetDescription(), - ExternalId: principal.GetResource().GetExternalId(), + ExternalId: principal.GetResource().GetExternalId(), //nolint:staticcheck // Deprecated. // Omit parent resource ID so that behavior is the same as ConductorOne's provisioning mode ParentResourceId: nil, }.Build() @@ -247,7 +247,7 @@ func (p *Provisioner) revoke(ctx context.Context) error { DisplayName: principal.GetResource().GetDisplayName(), Annotations: principal.GetResource().GetAnnotations(), Description: principal.GetResource().GetDescription(), - ExternalId: principal.GetResource().GetExternalId(), + ExternalId: principal.GetResource().GetExternalId(), //nolint:staticcheck // Deprecated. // Omit parent resource ID so that behavior is the same as ConductorOne's provisioning mode ParentResourceId: nil, }.Build() diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go index ecef98b7..f2d6acbd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go @@ -1,3 +1,3 @@ package sdk -const Version = "v0.6.23" +const Version = "v0.7.3" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go index 8e175146..d2e8be55 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -1168,9 +1168,6 @@ func (s *syncer) syncResources(ctx context.Context) error { } } - // Set the resource creation source - r.SetCreationSource(v2.Resource_CREATION_SOURCE_CONNECTOR_LIST_RESOURCES) - bulkPutResoruces = append(bulkPutResoruces, r) err = s.getSubResources(ctx, r) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go index 00291d53..4542f26d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/attached/attached.go @@ -23,25 +23,59 @@ func NewAttachedCompactor(base *dotc1z.C1File, applied *dotc1z.C1File) *Compacto } } +func latestFinishedCompactableSync(ctx context.Context, f *dotc1z.C1File) (*reader_v2.SyncRun, error) { + // Compaction must NOT operate on diff syncs (partial_upserts / partial_deletions). + // We want the latest finished "snapshot-like" sync. + candidates := []connectorstore.SyncType{ + connectorstore.SyncTypeFull, + connectorstore.SyncTypeResourcesOnly, + connectorstore.SyncTypePartial, + } + + var best *reader_v2.SyncRun + for _, st := range candidates { + resp, err := f.GetLatestFinishedSync(ctx, reader_v2.SyncsReaderServiceGetLatestFinishedSyncRequest_builder{ + SyncType: string(st), + }.Build()) + if err != nil { + return nil, err + } + s := resp.GetSync() + if s == nil { + continue + } + + if best == nil || s.GetEndedAt().AsTime().After(best.GetEndedAt().AsTime()) { + best = s + } + } + + return best, nil +} + func (c *Compactor) Compact(ctx context.Context) error { - baseSync, err := c.base.GetLatestFinishedSync(ctx, reader_v2.SyncsReaderServiceGetLatestFinishedSyncRequest_builder{ - SyncType: string(connectorstore.SyncTypeAny), - }.Build()) + baseSync, err := latestFinishedCompactableSync(ctx, c.base) if err != nil { return fmt.Errorf("failed to get base sync: %w", err) } - if baseSync == nil || baseSync.GetSync() == nil { - return fmt.Errorf("no finished sync found in base") + if baseSync == nil { + return fmt.Errorf( + "no finished compactable sync found in base (diff sync types %q/%q are not compactable)", + string(connectorstore.SyncTypePartialUpserts), + string(connectorstore.SyncTypePartialDeletions), + ) } - appliedSync, err := c.applied.GetLatestFinishedSync(ctx, reader_v2.SyncsReaderServiceGetLatestFinishedSyncRequest_builder{ - SyncType: string(connectorstore.SyncTypeAny), - }.Build()) + appliedSync, err := latestFinishedCompactableSync(ctx, c.applied) if err != nil { return fmt.Errorf("failed to get applied sync: %w", err) } - if appliedSync == nil || appliedSync.GetSync() == nil { - return fmt.Errorf("no finished sync found in applied") + if appliedSync == nil { + return fmt.Errorf( + "no finished compactable sync found in applied (diff sync types %q/%q are not compactable)", + string(connectorstore.SyncTypePartialUpserts), + string(connectorstore.SyncTypePartialDeletions), + ) } l := ctxzap.Extract(ctx) @@ -58,7 +92,7 @@ func (c *Compactor) Compact(ctx context.Context) error { } }() - if err := c.processRecords(ctx, attached, baseSync.GetSync(), appliedSync.GetSync()); err != nil { + if err := c.processRecords(ctx, attached, baseSync, appliedSync); err != nil { return fmt.Errorf("failed to process records: %w", err) } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go index 2dafb58d..3a43622f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/synccompactor/compactor.go @@ -37,6 +37,7 @@ type Compactor struct { tmpDir string destDir string runDuration time.Duration + syncLimit int } type CompactableSync struct { @@ -68,6 +69,13 @@ func WithRunDuration(runDuration time.Duration) Option { } } +// WithSyncLimit sets the number of syncs to keep after compaction cleanup. +func WithSyncLimit(limit int) Option { + return func(c *Compactor) { + c.syncLimit = limit + } +} + func NewCompactor(ctx context.Context, outputDir string, compactableSyncs []*CompactableSync, opts ...Option) (*Compactor, func() error, error) { if len(compactableSyncs) < 2 { return nil, nil, ErrNotEnoughFilesToCompact @@ -151,6 +159,9 @@ func (c *Compactor) Compact(ctx context.Context) (*CompactableSync, error) { // Use parallel encoding. dotc1z.WithEncoderConcurrency(0), } + if c.syncLimit > 0 { + opts = append(opts, dotc1z.WithSyncLimit(c.syncLimit)) + } fileName := fmt.Sprintf("compacted-%s.c1z", c.entries[0].SyncID) destFilePath := path.Join(c.tmpDir, fileName) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/actions.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/actions.go index 323b5665..f6cdfaee 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/actions.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/actions.go @@ -139,6 +139,23 @@ func (c *actionInvokeTaskHandler) HandleTask(ctx context.Context) error { return c.helpers.FinishTask(ctx, nil, nil, err) } + // Check if the action itself failed and propagate the error + if resp.GetStatus() == v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED { + errMsg := "action failed" + if resp.GetResponse() != nil && resp.GetResponse().GetFields() != nil { + if errField, ok := resp.GetResponse().GetFields()["error"]; ok { + errMsg = errField.GetStringValue() + } + } + l.Error("ActionInvoke failed", + zap.String("error", errMsg), + zap.String("action_id", resp.GetId()), + zap.String("action_name", resp.GetName()), + zap.Stringer("status", resp.GetStatus()), + ) + return c.helpers.FinishTask(ctx, resp, nil, fmt.Errorf("%s", errMsg)) + } + l.Debug("ActionInvoke response", zap.Any("resp", resp)) // Check if the action itself failed and propagate the error diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go index 972c6344..b472ca99 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/grant/grant.go @@ -36,9 +36,10 @@ func WithGrantMetadata(metadata map[string]interface{}) GrantOption { } } +// WithExternalPrincipalID: Deprecated. This field is no longer used. func WithExternalPrincipalID(externalID *v2.ExternalId) GrantOption { return func(g *v2.Grant) error { - g.GetPrincipal().SetExternalId(externalID) + g.GetPrincipal().SetExternalId(externalID) //nolint:staticcheck // Deprecated. return nil } } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/resource.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/resource.go index 33d3f132..b7dae67e 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/resource.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/resource.go @@ -9,6 +9,8 @@ import ( "github.com/conductorone/baton-sdk/pkg/annotations" "github.com/conductorone/baton-sdk/pkg/pagination" "github.com/conductorone/baton-sdk/pkg/types/sessions" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) @@ -29,9 +31,10 @@ func WithAnnotation(msgs ...proto.Message) ResourceOption { } } +// WithExternalID: Deprecated. This field is no longer used. func WithExternalID(externalID *v2.ExternalId) ResourceOption { return func(r *v2.Resource) error { - r.SetExternalId(externalID) + r.SetExternalId(externalID) //nolint:staticcheck // Deprecated. return nil } } @@ -132,6 +135,39 @@ func WithRoleTrait(opts ...RoleTraitOption) ResourceOption { } } +func WithScopeBindingTrait(opts ...ScopeBindingTraitOption) ResourceOption { + return func(r *v2.Resource) error { + rt := &v2.ScopeBindingTrait{} + + annos := annotations.Annotations(r.GetAnnotations()) + _, err := annos.Pick(rt) + if err != nil { + return err + } + + for _, o := range opts { + err := o(rt) + if err != nil { + return err + } + } + + roleId := rt.GetRoleId() + scopeResourceId := rt.GetScopeResourceId() + if roleId == nil { + return status.Errorf(codes.InvalidArgument, "role ID is required for scope binding trait") + } + if scopeResourceId == nil { + return status.Errorf(codes.InvalidArgument, "scope resource ID is required for scope binding trait") + } + + annos.Update(rt) + r.SetAnnotations(annos) + + return nil + } +} + func WithAppTrait(opts ...AppTraitOption) ResourceOption { return func(r *v2.Resource) error { at := &v2.AppTrait{} @@ -304,6 +340,24 @@ func NewRoleResource( return ret, nil } +// NewScopeBindingResource returns a new resource instance with a configured scope binding trait. +func NewScopeBindingResource( + name string, + resourceType *v2.ResourceType, + objectID any, + scopeBindingOpts []ScopeBindingTraitOption, + opts ...ResourceOption, +) (*v2.Resource, error) { + opts = append(opts, WithScopeBindingTrait(scopeBindingOpts...)) + + ret, err := NewResource(name, resourceType, objectID, opts...) + if err != nil { + return nil, err + } + + return ret, nil +} + // NewAppResource returns a new resource instance with a configured app trait. // The trait is configured with the provided helpURL and profile. func NewAppResource( diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/role_trait.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/role_trait.go index bc534133..80b75a6d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/role_trait.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/role_trait.go @@ -1,10 +1,10 @@ package resource import ( - "fmt" - v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" "github.com/conductorone/baton-sdk/pkg/annotations" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/structpb" ) @@ -23,6 +23,22 @@ func WithRoleProfile(profile map[string]interface{}) RoleTraitOption { } } +func WithRoleScopeConditions(typ string, conditions []string) RoleTraitOption { + return func(rt *v2.RoleTrait) error { + rt.RoleScopeConditions = &v2.RoleScopeConditions{ + Type: typ, + Conditions: make([]*v2.RoleScopeCondition, len(conditions)), + } + for i, condition := range conditions { + rt.RoleScopeConditions.Conditions[i] = &v2.RoleScopeCondition{ + Expression: condition, + } + } + + return nil + } +} + // NewRoleTrait creates a new `RoleTrait` with the provided profile. func NewRoleTrait(opts ...RoleTraitOption) (*v2.RoleTrait, error) { groupTrait := &v2.RoleTrait{} @@ -46,7 +62,7 @@ func GetRoleTrait(resource *v2.Resource) (*v2.RoleTrait, error) { return nil, err } if !ok { - return nil, fmt.Errorf("role trait was not found on resource") + return nil, status.Errorf(codes.NotFound, "role trait was not found on resource") } return ret, nil diff --git a/vendor/modules.txt b/vendor/modules.txt index 04dbd5ed..3908fb9d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -159,7 +159,7 @@ github.com/benbjohnson/clock # github.com/cenkalti/backoff/v4 v4.3.0 ## explicit; go 1.18 github.com/cenkalti/backoff/v4 -# github.com/conductorone/baton-sdk v0.6.24 +# github.com/conductorone/baton-sdk v0.7.4 ## explicit; go 1.25.2 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 From fb27009007ad50d5a88e79548c777ccdfb518586 Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Wed, 28 Jan 2026 18:30:45 +0530 Subject: [PATCH 09/22] lint fix --- pkg/connector/team.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg/connector/team.go b/pkg/connector/team.go index f220f884..b1a5d6f1 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -25,6 +25,10 @@ import ( const ( teamRoleMember = "member" teamRoleMaintainer = "maintainer" + + // Team privacy levels + teamPrivacySecret = "secret" + teamPrivacyClosed = "closed" ) var teamAccessLevels = []string{ @@ -627,21 +631,19 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str if privacy, ok := actions.GetStringArg(args, "privacy"); ok && privacy != "" { if isNestedTeam { // Nested teams can only be "closed" - if privacy == "secret" { + if privacy == teamPrivacySecret { l.Warn("github-connector: secret privacy not allowed for nested teams, using closed", zap.String("requested_privacy", privacy), ) } - newTeam.Privacy = github.Ptr("closed") - } else { + newTeam.Privacy = github.Ptr(teamPrivacyClosed) + } else if privacy == teamPrivacySecret || privacy == teamPrivacyClosed { // Non-nested teams can be "secret" or "closed" - if privacy == "secret" || privacy == "closed" { - newTeam.Privacy = github.Ptr(privacy) - } + newTeam.Privacy = github.Ptr(privacy) } } else if isNestedTeam { // Default for nested teams is "closed" - newTeam.Privacy = github.Ptr("closed") + newTeam.Privacy = github.Ptr(teamPrivacyClosed) } // Note: Default for non-nested teams is "secret" (handled by GitHub API) @@ -752,7 +754,7 @@ func (o *teamResourceType) handleDeleteTeamAction(ctx context.Context, args *str } // Get the team to find its slug - team, resp, err := o.client.Teams.GetTeamByID(ctx, orgID, teamID) + team, resp, err := o.client.Teams.GetTeamByID(ctx, orgID, teamID) //nolint:staticcheck // TODO: migrate to GetTeamBySlug if err != nil { return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get team %d", teamID)) } @@ -819,7 +821,7 @@ func (o *teamResourceType) handleUpdateTeamAction(ctx context.Context, args *str } // Get the team to find its slug - team, resp, err := o.client.Teams.GetTeamByID(ctx, orgID, teamID) + team, resp, err := o.client.Teams.GetTeamByID(ctx, orgID, teamID) //nolint:staticcheck // TODO: migrate to GetTeamBySlug if err != nil { return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get team %d", teamID)) } @@ -851,7 +853,7 @@ func (o *teamResourceType) handleUpdateTeamAction(ctx context.Context, args *str } if privacy, ok := actions.GetStringArg(args, "privacy"); ok && privacy != "" { - if privacy == "secret" || privacy == "closed" { + if privacy == teamPrivacySecret || privacy == teamPrivacyClosed { updateTeam.Privacy = github.Ptr(privacy) hasUpdates = true } else { From f728c2704a06571c1d6e6b1e35cd195ac162b09d Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Fri, 30 Jan 2026 10:10:33 +0530 Subject: [PATCH 10/22] upgrade baton-sdk to 0.7.10 --- go.mod | 2 +- go.sum | 4 +- .../baton-sdk/pb/c1/config/v1/config.pb.go | 711 +++++++++++++++-- .../pb/c1/config/v1/config.pb.validate.go | 725 ++++++++++++++++++ .../pb/c1/config/v1/config_protoopaque.pb.go | 713 +++++++++++++++-- .../baton-sdk/pkg/actions/args.go | 228 ++++++ .../conductorone/baton-sdk/pkg/cli/cli.go | 8 +- .../baton-sdk/pkg/cli/commands.go | 16 +- .../baton-sdk/pkg/cli/lambda_server__added.go | 1 + .../baton-sdk/pkg/config/config.go | 27 +- .../connectorbuilder/resource_provisioner.go | 2 +- .../baton-sdk/pkg/connectorrunner/runner.go | 46 +- .../pkg/field/default_relationships.go | 4 + .../baton-sdk/pkg/field/defaults.go | 23 + .../conductorone/baton-sdk/pkg/sdk/version.go | 2 +- .../conductorone/baton-sdk/pkg/sync/syncer.go | 11 + .../baton-sdk/pkg/tasks/c1api/actions.go | 17 - .../types/resource/security_insight_trait.go | 33 + vendor/modules.txt | 3 +- 19 files changed, 2392 insertions(+), 184 deletions(-) diff --git a/go.mod b/go.mod index e8784351..60c37994 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/conductorone/baton-github go 1.25.2 require ( - github.com/conductorone/baton-sdk v0.7.4 + github.com/conductorone/baton-sdk v0.7.10 github.com/deckarep/golang-set/v2 v2.8.0 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/golang-jwt/jwt/v5 v5.2.2 diff --git a/go.sum b/go.sum index 45ac2db2..45850e97 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/conductorone/baton-sdk v0.7.4 h1:JD79NYgIficX00ucugU/5//r2rpGPNqAsHlZsgE0GCM= -github.com/conductorone/baton-sdk v0.7.4/go.mod h1:9S5feBOuIJxlNdGmkv3ObkCNHbVyOHr6foNrIrk+d4Y= +github.com/conductorone/baton-sdk v0.7.10 h1:eK/RTU8CZyTosYSNYmDzfAahGnxqpOq6rheBcwTx7w0= +github.com/conductorone/baton-sdk v0.7.10/go.mod h1:9S5feBOuIJxlNdGmkv3ObkCNHbVyOHr6foNrIrk+d4Y= github.com/conductorone/dpop v0.2.3 h1:s91U3845GHQ6P6FWrdNr2SEOy1ES/jcFs1JtKSl2S+o= github.com/conductorone/dpop v0.2.3/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s= github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 h1:kLMCNIh0Mo2vbvvkCmJ3ixsPbXEJ6HPcW53Ku9yje3s= diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go index 06945eed..d563d18f 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.go @@ -566,6 +566,8 @@ type Field struct { // *Field_ResourceIdSliceField // *Field_ResourceField // *Field_ResourceSliceField + // *Field_EntitlementSliceField + // *Field_GrantSliceField Field isField_Field `protobuf_oneof:"field"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -733,6 +735,24 @@ func (x *Field) GetResourceSliceField() *ResourceSliceField { return nil } +func (x *Field) GetEntitlementSliceField() *EntitlementSliceField { + if x != nil { + if x, ok := x.Field.(*Field_EntitlementSliceField); ok { + return x.EntitlementSliceField + } + } + return nil +} + +func (x *Field) GetGrantSliceField() *GrantSliceField { + if x != nil { + if x, ok := x.Field.(*Field_GrantSliceField); ok { + return x.GrantSliceField + } + } + return nil +} + func (x *Field) SetName(v string) { x.Name = v } @@ -833,6 +853,22 @@ func (x *Field) SetResourceSliceField(v *ResourceSliceField) { x.Field = &Field_ResourceSliceField{v} } +func (x *Field) SetEntitlementSliceField(v *EntitlementSliceField) { + if v == nil { + x.Field = nil + return + } + x.Field = &Field_EntitlementSliceField{v} +} + +func (x *Field) SetGrantSliceField(v *GrantSliceField) { + if v == nil { + x.Field = nil + return + } + x.Field = &Field_GrantSliceField{v} +} + func (x *Field) HasField() bool { if x == nil { return false @@ -912,6 +948,22 @@ func (x *Field) HasResourceSliceField() bool { return ok } +func (x *Field) HasEntitlementSliceField() bool { + if x == nil { + return false + } + _, ok := x.Field.(*Field_EntitlementSliceField) + return ok +} + +func (x *Field) HasGrantSliceField() bool { + if x == nil { + return false + } + _, ok := x.Field.(*Field_GrantSliceField) + return ok +} + func (x *Field) ClearField() { x.Field = nil } @@ -970,6 +1022,18 @@ func (x *Field) ClearResourceSliceField() { } } +func (x *Field) ClearEntitlementSliceField() { + if _, ok := x.Field.(*Field_EntitlementSliceField); ok { + x.Field = nil + } +} + +func (x *Field) ClearGrantSliceField() { + if _, ok := x.Field.(*Field_GrantSliceField); ok { + x.Field = nil + } +} + const Field_Field_not_set_case case_Field_Field = 0 const Field_StringField_case case_Field_Field = 100 const Field_IntField_case case_Field_Field = 101 @@ -980,6 +1044,8 @@ const Field_ResourceIdField_case case_Field_Field = 105 const Field_ResourceIdSliceField_case case_Field_Field = 106 const Field_ResourceField_case case_Field_Field = 107 const Field_ResourceSliceField_case case_Field_Field = 108 +const Field_EntitlementSliceField_case case_Field_Field = 109 +const Field_GrantSliceField_case case_Field_Field = 110 func (x *Field) WhichField() case_Field_Field { if x == nil { @@ -1004,6 +1070,10 @@ func (x *Field) WhichField() case_Field_Field { return Field_ResourceField_case case *Field_ResourceSliceField: return Field_ResourceSliceField_case + case *Field_EntitlementSliceField: + return Field_EntitlementSliceField_case + case *Field_GrantSliceField: + return Field_GrantSliceField_case default: return Field_Field_not_set_case } @@ -1028,8 +1098,10 @@ type Field_builder struct { ResourceIdField *ResourceIdField ResourceIdSliceField *ResourceIdSliceField // These are meant to serve as return types for actions. - ResourceField *ResourceField - ResourceSliceField *ResourceSliceField + ResourceField *ResourceField + ResourceSliceField *ResourceSliceField + EntitlementSliceField *EntitlementSliceField + GrantSliceField *GrantSliceField // -- end of Field } @@ -1071,6 +1143,12 @@ func (b0 Field_builder) Build() *Field { if b.ResourceSliceField != nil { x.Field = &Field_ResourceSliceField{b.ResourceSliceField} } + if b.EntitlementSliceField != nil { + x.Field = &Field_EntitlementSliceField{b.EntitlementSliceField} + } + if b.GrantSliceField != nil { + x.Field = &Field_GrantSliceField{b.GrantSliceField} + } return m0 } @@ -1125,6 +1203,14 @@ type Field_ResourceSliceField struct { ResourceSliceField *ResourceSliceField `protobuf:"bytes,108,opt,name=resource_slice_field,json=resourceSliceField,proto3,oneof"` } +type Field_EntitlementSliceField struct { + EntitlementSliceField *EntitlementSliceField `protobuf:"bytes,109,opt,name=entitlement_slice_field,json=entitlementSliceField,proto3,oneof"` +} + +type Field_GrantSliceField struct { + GrantSliceField *GrantSliceField `protobuf:"bytes,110,opt,name=grant_slice_field,json=grantSliceField,proto3,oneof"` +} + func (*Field_StringField) isField_Field() {} func (*Field_IntField) isField_Field() {} @@ -1143,6 +1229,10 @@ func (*Field_ResourceField) isField_Field() {} func (*Field_ResourceSliceField) isField_Field() {} +func (*Field_EntitlementSliceField) isField_Field() {} + +func (*Field_GrantSliceField) isField_Field() {} + // These are partially duplicate with the Resource proto in the connector package. // This is to avoid import cycles type Resource struct { @@ -1476,6 +1566,442 @@ func (b0 ResourceSliceField_builder) Build() *ResourceSliceField { return m0 } +// Simplified Entitlement for config return types (avoids import cycles with connector package) +type Entitlement struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Slug string `protobuf:"bytes,4,opt,name=slug,proto3" json:"slug,omitempty"` + Purpose string `protobuf:"bytes,5,opt,name=purpose,proto3" json:"purpose,omitempty"` // "PURPOSE_VALUE_ASSIGNMENT", "PURPOSE_VALUE_PERMISSION", or "PURPOSE_VALUE_OWNERSHIP" + GrantableToResourceTypeIds []string `protobuf:"bytes,6,rep,name=grantable_to_resource_type_ids,json=grantableToResourceTypeIds,proto3" json:"grantable_to_resource_type_ids,omitempty"` + ResourceId string `protobuf:"bytes,7,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + ResourceTypeId string `protobuf:"bytes,8,opt,name=resource_type_id,json=resourceTypeId,proto3" json:"resource_type_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Entitlement) Reset() { + *x = Entitlement{} + mi := &file_c1_config_v1_config_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Entitlement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Entitlement) ProtoMessage() {} + +func (x *Entitlement) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Entitlement) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Entitlement) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Entitlement) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Entitlement) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +func (x *Entitlement) GetPurpose() string { + if x != nil { + return x.Purpose + } + return "" +} + +func (x *Entitlement) GetGrantableToResourceTypeIds() []string { + if x != nil { + return x.GrantableToResourceTypeIds + } + return nil +} + +func (x *Entitlement) GetResourceId() string { + if x != nil { + return x.ResourceId + } + return "" +} + +func (x *Entitlement) GetResourceTypeId() string { + if x != nil { + return x.ResourceTypeId + } + return "" +} + +func (x *Entitlement) SetId(v string) { + x.Id = v +} + +func (x *Entitlement) SetDisplayName(v string) { + x.DisplayName = v +} + +func (x *Entitlement) SetDescription(v string) { + x.Description = v +} + +func (x *Entitlement) SetSlug(v string) { + x.Slug = v +} + +func (x *Entitlement) SetPurpose(v string) { + x.Purpose = v +} + +func (x *Entitlement) SetGrantableToResourceTypeIds(v []string) { + x.GrantableToResourceTypeIds = v +} + +func (x *Entitlement) SetResourceId(v string) { + x.ResourceId = v +} + +func (x *Entitlement) SetResourceTypeId(v string) { + x.ResourceTypeId = v +} + +type Entitlement_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id string + DisplayName string + Description string + Slug string + Purpose string + GrantableToResourceTypeIds []string + ResourceId string + ResourceTypeId string +} + +func (b0 Entitlement_builder) Build() *Entitlement { + m0 := &Entitlement{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.DisplayName = b.DisplayName + x.Description = b.Description + x.Slug = b.Slug + x.Purpose = b.Purpose + x.GrantableToResourceTypeIds = b.GrantableToResourceTypeIds + x.ResourceId = b.ResourceId + x.ResourceTypeId = b.ResourceTypeId + return m0 +} + +type EntitlementSliceField struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + DefaultValue []*Entitlement `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntitlementSliceField) Reset() { + *x = EntitlementSliceField{} + mi := &file_c1_config_v1_config_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntitlementSliceField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntitlementSliceField) ProtoMessage() {} + +func (x *EntitlementSliceField) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EntitlementSliceField) GetDefaultValue() []*Entitlement { + if x != nil { + return x.DefaultValue + } + return nil +} + +func (x *EntitlementSliceField) SetDefaultValue(v []*Entitlement) { + x.DefaultValue = v +} + +type EntitlementSliceField_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + DefaultValue []*Entitlement +} + +func (b0 EntitlementSliceField_builder) Build() *EntitlementSliceField { + m0 := &EntitlementSliceField{} + b, x := &b0, m0 + _, _ = b, x + x.DefaultValue = b.DefaultValue + return m0 +} + +// Reference to an entitlement (used in Grant) +type EntitlementRef struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntitlementRef) Reset() { + *x = EntitlementRef{} + mi := &file_c1_config_v1_config_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntitlementRef) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntitlementRef) ProtoMessage() {} + +func (x *EntitlementRef) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EntitlementRef) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EntitlementRef) SetId(v string) { + x.Id = v +} + +type EntitlementRef_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id string +} + +func (b0 EntitlementRef_builder) Build() *EntitlementRef { + m0 := &EntitlementRef{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + return m0 +} + +// Simplified Grant for config return types (avoids import cycles with connector package) +type Grant struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Entitlement *EntitlementRef `protobuf:"bytes,2,opt,name=entitlement,proto3" json:"entitlement,omitempty"` + Principal *Resource `protobuf:"bytes,3,opt,name=principal,proto3" json:"principal,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Grant) Reset() { + *x = Grant{} + mi := &file_c1_config_v1_config_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Grant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Grant) ProtoMessage() {} + +func (x *Grant) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Grant) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Grant) GetEntitlement() *EntitlementRef { + if x != nil { + return x.Entitlement + } + return nil +} + +func (x *Grant) GetPrincipal() *Resource { + if x != nil { + return x.Principal + } + return nil +} + +func (x *Grant) SetId(v string) { + x.Id = v +} + +func (x *Grant) SetEntitlement(v *EntitlementRef) { + x.Entitlement = v +} + +func (x *Grant) SetPrincipal(v *Resource) { + x.Principal = v +} + +func (x *Grant) HasEntitlement() bool { + if x == nil { + return false + } + return x.Entitlement != nil +} + +func (x *Grant) HasPrincipal() bool { + if x == nil { + return false + } + return x.Principal != nil +} + +func (x *Grant) ClearEntitlement() { + x.Entitlement = nil +} + +func (x *Grant) ClearPrincipal() { + x.Principal = nil +} + +type Grant_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id string + Entitlement *EntitlementRef + Principal *Resource +} + +func (b0 Grant_builder) Build() *Grant { + m0 := &Grant{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.Entitlement = b.Entitlement + x.Principal = b.Principal + return m0 +} + +type GrantSliceField struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + DefaultValue []*Grant `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrantSliceField) Reset() { + *x = GrantSliceField{} + mi := &file_c1_config_v1_config_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrantSliceField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantSliceField) ProtoMessage() {} + +func (x *GrantSliceField) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GrantSliceField) GetDefaultValue() []*Grant { + if x != nil { + return x.DefaultValue + } + return nil +} + +func (x *GrantSliceField) SetDefaultValue(v []*Grant) { + x.DefaultValue = v +} + +type GrantSliceField_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + DefaultValue []*Grant +} + +func (b0 GrantSliceField_builder) Build() *GrantSliceField { + m0 := &GrantSliceField{} + b, x := &b0, m0 + _, _ = b, x + x.DefaultValue = b.DefaultValue + return m0 +} + type ResourceIdField struct { state protoimpl.MessageState `protogen:"hybrid.v1"` DefaultValue *ResourceId `protobuf:"bytes,1,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` @@ -1486,7 +2012,7 @@ type ResourceIdField struct { func (x *ResourceIdField) Reset() { *x = ResourceIdField{} - mi := &file_c1_config_v1_config_proto_msgTypes[8] + mi := &file_c1_config_v1_config_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1498,7 +2024,7 @@ func (x *ResourceIdField) String() string { func (*ResourceIdField) ProtoMessage() {} func (x *ResourceIdField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[8] + mi := &file_c1_config_v1_config_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1579,7 +2105,7 @@ type ResourceIdSliceField struct { func (x *ResourceIdSliceField) Reset() { *x = ResourceIdSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[9] + mi := &file_c1_config_v1_config_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1591,7 +2117,7 @@ func (x *ResourceIdSliceField) String() string { func (*ResourceIdSliceField) ProtoMessage() {} func (x *ResourceIdSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[9] + mi := &file_c1_config_v1_config_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1662,7 +2188,7 @@ type IntField struct { func (x *IntField) Reset() { *x = IntField{} - mi := &file_c1_config_v1_config_proto_msgTypes[10] + mi := &file_c1_config_v1_config_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1674,7 +2200,7 @@ func (x *IntField) String() string { func (*IntField) ProtoMessage() {} func (x *IntField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[10] + mi := &file_c1_config_v1_config_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1745,7 +2271,7 @@ type BoolField struct { func (x *BoolField) Reset() { *x = BoolField{} - mi := &file_c1_config_v1_config_proto_msgTypes[11] + mi := &file_c1_config_v1_config_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1757,7 +2283,7 @@ func (x *BoolField) String() string { func (*BoolField) ProtoMessage() {} func (x *BoolField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[11] + mi := &file_c1_config_v1_config_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1827,7 +2353,7 @@ type StringSliceField struct { func (x *StringSliceField) Reset() { *x = StringSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[12] + mi := &file_c1_config_v1_config_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1839,7 +2365,7 @@ func (x *StringSliceField) String() string { func (*StringSliceField) ProtoMessage() {} func (x *StringSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[12] + mi := &file_c1_config_v1_config_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1909,7 +2435,7 @@ type StringMapField struct { func (x *StringMapField) Reset() { *x = StringMapField{} - mi := &file_c1_config_v1_config_proto_msgTypes[13] + mi := &file_c1_config_v1_config_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1921,7 +2447,7 @@ func (x *StringMapField) String() string { func (*StringMapField) ProtoMessage() {} func (x *StringMapField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[13] + mi := &file_c1_config_v1_config_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1992,7 +2518,7 @@ type StringFieldOption struct { func (x *StringFieldOption) Reset() { *x = StringFieldOption{} - mi := &file_c1_config_v1_config_proto_msgTypes[14] + mi := &file_c1_config_v1_config_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2004,7 +2530,7 @@ func (x *StringFieldOption) String() string { func (*StringFieldOption) ProtoMessage() {} func (x *StringFieldOption) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[14] + mi := &file_c1_config_v1_config_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2080,7 +2606,7 @@ type StringField struct { func (x *StringField) Reset() { *x = StringField{} - mi := &file_c1_config_v1_config_proto_msgTypes[15] + mi := &file_c1_config_v1_config_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2092,7 +2618,7 @@ func (x *StringField) String() string { func (*StringField) ProtoMessage() {} func (x *StringField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[15] + mi := &file_c1_config_v1_config_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2225,7 +2751,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x1b\n" + "\thelp_text\x18\x03 \x01(\tR\bhelpText\x12\x16\n" + "\x06fields\x18\x04 \x03(\tR\x06fields\x12\x18\n" + - "\adefault\x18\x05 \x01(\bR\adefault\"\xf1\x06\n" + + "\adefault\x18\x05 \x01(\bR\adefault\"\x9d\b\n" + "\x05Field\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + @@ -2244,7 +2770,9 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x11resource_id_field\x18i \x01(\v2\x1d.c1.config.v1.ResourceIdFieldH\x00R\x0fresourceIdField\x12[\n" + "\x17resource_id_slice_field\x18j \x01(\v2\".c1.config.v1.ResourceIdSliceFieldH\x00R\x14resourceIdSliceField\x12D\n" + "\x0eresource_field\x18k \x01(\v2\x1b.c1.config.v1.ResourceFieldH\x00R\rresourceField\x12T\n" + - "\x14resource_slice_field\x18l \x01(\v2 .c1.config.v1.ResourceSliceFieldH\x00R\x12resourceSliceFieldB\a\n" + + "\x14resource_slice_field\x18l \x01(\v2 .c1.config.v1.ResourceSliceFieldH\x00R\x12resourceSliceField\x12]\n" + + "\x17entitlement_slice_field\x18m \x01(\v2#.c1.config.v1.EntitlementSliceFieldH\x00R\x15entitlementSliceField\x12K\n" + + "\x11grant_slice_field\x18n \x01(\v2\x1d.c1.config.v1.GrantSliceFieldH\x00R\x0fgrantSliceFieldB\a\n" + "\x05field\"\x8a\x02\n" + "\bResource\x129\n" + "\vresource_id\x18\x01 \x01(\v2\x18.c1.config.v1.ResourceIdR\n" + @@ -2261,7 +2789,27 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\rResourceField\x12;\n" + "\rdefault_value\x18\x01 \x01(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"Q\n" + "\x12ResourceSliceField\x12;\n" + - "\rdefault_value\x18\x01 \x03(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"\x94\x01\n" + + "\rdefault_value\x18\x01 \x03(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"\x9f\x02\n" + + "\vEntitlement\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x12\n" + + "\x04slug\x18\x04 \x01(\tR\x04slug\x12\x18\n" + + "\apurpose\x18\x05 \x01(\tR\apurpose\x12B\n" + + "\x1egrantable_to_resource_type_ids\x18\x06 \x03(\tR\x1agrantableToResourceTypeIds\x12\x1f\n" + + "\vresource_id\x18\a \x01(\tR\n" + + "resourceId\x12(\n" + + "\x10resource_type_id\x18\b \x01(\tR\x0eresourceTypeId\"W\n" + + "\x15EntitlementSliceField\x12>\n" + + "\rdefault_value\x18\x01 \x03(\v2\x19.c1.config.v1.EntitlementR\fdefaultValue\" \n" + + "\x0eEntitlementRef\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\x8d\x01\n" + + "\x05Grant\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12>\n" + + "\ventitlement\x18\x02 \x01(\v2\x1c.c1.config.v1.EntitlementRefR\ventitlement\x124\n" + + "\tprincipal\x18\x03 \x01(\v2\x16.c1.config.v1.ResourceR\tprincipal\"K\n" + + "\x0fGrantSliceField\x128\n" + + "\rdefault_value\x18\x01 \x03(\v2\x13.c1.config.v1.GrantR\fdefaultValue\"\x94\x01\n" + "\x0fResourceIdField\x12=\n" + "\rdefault_value\x18\x01 \x01(\v2\x18.c1.config.v1.ResourceIdR\fdefaultValue\x128\n" + "\x05rules\x18\x03 \x01(\v2\x1d.c1.config.v1.ResourceIDRulesH\x00R\x05rules\x88\x01\x01B\b\n" + @@ -2314,7 +2862,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x1dSTRING_FIELD_TYPE_FILE_UPLOAD\x10\x04B3Z1github.com/conductorone/baton-sdk/pb/c1/config/v1b\x06proto3" var file_c1_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_c1_config_v1_config_proto_goTypes = []any{ (ConstraintKind)(0), // 0: c1.config.v1.ConstraintKind (StringFieldType)(0), // 1: c1.config.v1.StringFieldType @@ -2326,61 +2874,72 @@ var file_c1_config_v1_config_proto_goTypes = []any{ (*ResourceId)(nil), // 7: c1.config.v1.ResourceId (*ResourceField)(nil), // 8: c1.config.v1.ResourceField (*ResourceSliceField)(nil), // 9: c1.config.v1.ResourceSliceField - (*ResourceIdField)(nil), // 10: c1.config.v1.ResourceIdField - (*ResourceIdSliceField)(nil), // 11: c1.config.v1.ResourceIdSliceField - (*IntField)(nil), // 12: c1.config.v1.IntField - (*BoolField)(nil), // 13: c1.config.v1.BoolField - (*StringSliceField)(nil), // 14: c1.config.v1.StringSliceField - (*StringMapField)(nil), // 15: c1.config.v1.StringMapField - (*StringFieldOption)(nil), // 16: c1.config.v1.StringFieldOption - (*StringField)(nil), // 17: c1.config.v1.StringField - nil, // 18: c1.config.v1.StringMapField.DefaultValueEntry - (*anypb.Any)(nil), // 19: google.protobuf.Any - (*ResourceIDRules)(nil), // 20: c1.config.v1.ResourceIDRules - (*RepeatedResourceIdRules)(nil), // 21: c1.config.v1.RepeatedResourceIdRules - (*Int64Rules)(nil), // 22: c1.config.v1.Int64Rules - (*BoolRules)(nil), // 23: c1.config.v1.BoolRules - (*RepeatedStringRules)(nil), // 24: c1.config.v1.RepeatedStringRules - (*StringMapRules)(nil), // 25: c1.config.v1.StringMapRules - (*StringRules)(nil), // 26: c1.config.v1.StringRules + (*Entitlement)(nil), // 10: c1.config.v1.Entitlement + (*EntitlementSliceField)(nil), // 11: c1.config.v1.EntitlementSliceField + (*EntitlementRef)(nil), // 12: c1.config.v1.EntitlementRef + (*Grant)(nil), // 13: c1.config.v1.Grant + (*GrantSliceField)(nil), // 14: c1.config.v1.GrantSliceField + (*ResourceIdField)(nil), // 15: c1.config.v1.ResourceIdField + (*ResourceIdSliceField)(nil), // 16: c1.config.v1.ResourceIdSliceField + (*IntField)(nil), // 17: c1.config.v1.IntField + (*BoolField)(nil), // 18: c1.config.v1.BoolField + (*StringSliceField)(nil), // 19: c1.config.v1.StringSliceField + (*StringMapField)(nil), // 20: c1.config.v1.StringMapField + (*StringFieldOption)(nil), // 21: c1.config.v1.StringFieldOption + (*StringField)(nil), // 22: c1.config.v1.StringField + nil, // 23: c1.config.v1.StringMapField.DefaultValueEntry + (*anypb.Any)(nil), // 24: google.protobuf.Any + (*ResourceIDRules)(nil), // 25: c1.config.v1.ResourceIDRules + (*RepeatedResourceIdRules)(nil), // 26: c1.config.v1.RepeatedResourceIdRules + (*Int64Rules)(nil), // 27: c1.config.v1.Int64Rules + (*BoolRules)(nil), // 28: c1.config.v1.BoolRules + (*RepeatedStringRules)(nil), // 29: c1.config.v1.RepeatedStringRules + (*StringMapRules)(nil), // 30: c1.config.v1.StringMapRules + (*StringRules)(nil), // 31: c1.config.v1.StringRules } var file_c1_config_v1_config_proto_depIdxs = []int32{ 5, // 0: c1.config.v1.Configuration.fields:type_name -> c1.config.v1.Field 3, // 1: c1.config.v1.Configuration.constraints:type_name -> c1.config.v1.Constraint 4, // 2: c1.config.v1.Configuration.field_groups:type_name -> c1.config.v1.FieldGroup 0, // 3: c1.config.v1.Constraint.kind:type_name -> c1.config.v1.ConstraintKind - 17, // 4: c1.config.v1.Field.string_field:type_name -> c1.config.v1.StringField - 12, // 5: c1.config.v1.Field.int_field:type_name -> c1.config.v1.IntField - 13, // 6: c1.config.v1.Field.bool_field:type_name -> c1.config.v1.BoolField - 14, // 7: c1.config.v1.Field.string_slice_field:type_name -> c1.config.v1.StringSliceField - 15, // 8: c1.config.v1.Field.string_map_field:type_name -> c1.config.v1.StringMapField - 10, // 9: c1.config.v1.Field.resource_id_field:type_name -> c1.config.v1.ResourceIdField - 11, // 10: c1.config.v1.Field.resource_id_slice_field:type_name -> c1.config.v1.ResourceIdSliceField + 22, // 4: c1.config.v1.Field.string_field:type_name -> c1.config.v1.StringField + 17, // 5: c1.config.v1.Field.int_field:type_name -> c1.config.v1.IntField + 18, // 6: c1.config.v1.Field.bool_field:type_name -> c1.config.v1.BoolField + 19, // 7: c1.config.v1.Field.string_slice_field:type_name -> c1.config.v1.StringSliceField + 20, // 8: c1.config.v1.Field.string_map_field:type_name -> c1.config.v1.StringMapField + 15, // 9: c1.config.v1.Field.resource_id_field:type_name -> c1.config.v1.ResourceIdField + 16, // 10: c1.config.v1.Field.resource_id_slice_field:type_name -> c1.config.v1.ResourceIdSliceField 8, // 11: c1.config.v1.Field.resource_field:type_name -> c1.config.v1.ResourceField 9, // 12: c1.config.v1.Field.resource_slice_field:type_name -> c1.config.v1.ResourceSliceField - 7, // 13: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId - 7, // 14: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId - 19, // 15: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any - 6, // 16: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource - 6, // 17: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource - 7, // 18: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId - 20, // 19: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules - 10, // 20: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField - 21, // 21: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules - 22, // 22: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules - 23, // 23: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules - 24, // 24: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules - 18, // 25: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry - 25, // 26: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules - 26, // 27: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules - 1, // 28: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType - 16, // 29: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption - 19, // 30: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any - 31, // [31:31] is the sub-list for method output_type - 31, // [31:31] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name + 11, // 13: c1.config.v1.Field.entitlement_slice_field:type_name -> c1.config.v1.EntitlementSliceField + 14, // 14: c1.config.v1.Field.grant_slice_field:type_name -> c1.config.v1.GrantSliceField + 7, // 15: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId + 7, // 16: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId + 24, // 17: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any + 6, // 18: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource + 6, // 19: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource + 10, // 20: c1.config.v1.EntitlementSliceField.default_value:type_name -> c1.config.v1.Entitlement + 12, // 21: c1.config.v1.Grant.entitlement:type_name -> c1.config.v1.EntitlementRef + 6, // 22: c1.config.v1.Grant.principal:type_name -> c1.config.v1.Resource + 13, // 23: c1.config.v1.GrantSliceField.default_value:type_name -> c1.config.v1.Grant + 7, // 24: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId + 25, // 25: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules + 15, // 26: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField + 26, // 27: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules + 27, // 28: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules + 28, // 29: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules + 29, // 30: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules + 23, // 31: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry + 30, // 32: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules + 31, // 33: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules + 1, // 34: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType + 21, // 35: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption + 24, // 36: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any + 37, // [37:37] is the sub-list for method output_type + 37, // [37:37] is the sub-list for method input_type + 37, // [37:37] is the sub-list for extension type_name + 37, // [37:37] is the sub-list for extension extendee + 0, // [0:37] is the sub-list for field type_name } func init() { file_c1_config_v1_config_proto_init() } @@ -2399,21 +2958,23 @@ func file_c1_config_v1_config_proto_init() { (*Field_ResourceIdSliceField)(nil), (*Field_ResourceField)(nil), (*Field_ResourceSliceField)(nil), + (*Field_EntitlementSliceField)(nil), + (*Field_GrantSliceField)(nil), } - file_c1_config_v1_config_proto_msgTypes[8].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[9].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[10].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[11].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[12].OneofWrappers = []any{} file_c1_config_v1_config_proto_msgTypes[13].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[14].OneofWrappers = []any{} file_c1_config_v1_config_proto_msgTypes[15].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[16].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[17].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[18].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[20].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_config_v1_config_proto_rawDesc), len(file_c1_config_v1_config_proto_rawDesc)), NumEnums: 2, - NumMessages: 17, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go index c58e2bd2..3c99fe9b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config.pb.validate.go @@ -870,6 +870,88 @@ func (m *Field) validate(all bool) error { } } + case *Field_EntitlementSliceField: + if v == nil { + err := FieldValidationError{ + field: "Field", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetEntitlementSliceField()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, FieldValidationError{ + field: "EntitlementSliceField", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, FieldValidationError{ + field: "EntitlementSliceField", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEntitlementSliceField()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FieldValidationError{ + field: "EntitlementSliceField", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Field_GrantSliceField: + if v == nil { + err := FieldValidationError{ + field: "Field", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetGrantSliceField()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, FieldValidationError{ + field: "GrantSliceField", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, FieldValidationError{ + field: "GrantSliceField", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGrantSliceField()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return FieldValidationError{ + field: "GrantSliceField", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -1514,6 +1596,649 @@ var _ interface { ErrorName() string } = ResourceSliceFieldValidationError{} +// Validate checks the field values on Entitlement with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Entitlement) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Entitlement with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in EntitlementMultiError, or +// nil if none found. +func (m *Entitlement) ValidateAll() error { + return m.validate(true) +} + +func (m *Entitlement) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for DisplayName + + // no validation rules for Description + + // no validation rules for Slug + + // no validation rules for Purpose + + // no validation rules for ResourceId + + // no validation rules for ResourceTypeId + + if len(errors) > 0 { + return EntitlementMultiError(errors) + } + + return nil +} + +// EntitlementMultiError is an error wrapping multiple validation errors +// returned by Entitlement.ValidateAll() if the designated constraints aren't met. +type EntitlementMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m EntitlementMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m EntitlementMultiError) AllErrors() []error { return m } + +// EntitlementValidationError is the validation error returned by +// Entitlement.Validate if the designated constraints aren't met. +type EntitlementValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e EntitlementValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e EntitlementValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e EntitlementValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e EntitlementValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e EntitlementValidationError) ErrorName() string { return "EntitlementValidationError" } + +// Error satisfies the builtin error interface +func (e EntitlementValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sEntitlement.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = EntitlementValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = EntitlementValidationError{} + +// Validate checks the field values on EntitlementSliceField with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *EntitlementSliceField) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on EntitlementSliceField with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// EntitlementSliceFieldMultiError, or nil if none found. +func (m *EntitlementSliceField) ValidateAll() error { + return m.validate(true) +} + +func (m *EntitlementSliceField) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetDefaultValue() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, EntitlementSliceFieldValidationError{ + field: fmt.Sprintf("DefaultValue[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, EntitlementSliceFieldValidationError{ + field: fmt.Sprintf("DefaultValue[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return EntitlementSliceFieldValidationError{ + field: fmt.Sprintf("DefaultValue[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return EntitlementSliceFieldMultiError(errors) + } + + return nil +} + +// EntitlementSliceFieldMultiError is an error wrapping multiple validation +// errors returned by EntitlementSliceField.ValidateAll() if the designated +// constraints aren't met. +type EntitlementSliceFieldMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m EntitlementSliceFieldMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m EntitlementSliceFieldMultiError) AllErrors() []error { return m } + +// EntitlementSliceFieldValidationError is the validation error returned by +// EntitlementSliceField.Validate if the designated constraints aren't met. +type EntitlementSliceFieldValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e EntitlementSliceFieldValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e EntitlementSliceFieldValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e EntitlementSliceFieldValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e EntitlementSliceFieldValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e EntitlementSliceFieldValidationError) ErrorName() string { + return "EntitlementSliceFieldValidationError" +} + +// Error satisfies the builtin error interface +func (e EntitlementSliceFieldValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sEntitlementSliceField.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = EntitlementSliceFieldValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = EntitlementSliceFieldValidationError{} + +// Validate checks the field values on EntitlementRef with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *EntitlementRef) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on EntitlementRef with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in EntitlementRefMultiError, +// or nil if none found. +func (m *EntitlementRef) ValidateAll() error { + return m.validate(true) +} + +func (m *EntitlementRef) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return EntitlementRefMultiError(errors) + } + + return nil +} + +// EntitlementRefMultiError is an error wrapping multiple validation errors +// returned by EntitlementRef.ValidateAll() if the designated constraints +// aren't met. +type EntitlementRefMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m EntitlementRefMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m EntitlementRefMultiError) AllErrors() []error { return m } + +// EntitlementRefValidationError is the validation error returned by +// EntitlementRef.Validate if the designated constraints aren't met. +type EntitlementRefValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e EntitlementRefValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e EntitlementRefValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e EntitlementRefValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e EntitlementRefValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e EntitlementRefValidationError) ErrorName() string { return "EntitlementRefValidationError" } + +// Error satisfies the builtin error interface +func (e EntitlementRefValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sEntitlementRef.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = EntitlementRefValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = EntitlementRefValidationError{} + +// Validate checks the field values on Grant with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Grant) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Grant with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in GrantMultiError, or nil if none found. +func (m *Grant) ValidateAll() error { + return m.validate(true) +} + +func (m *Grant) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if all { + switch v := interface{}(m.GetEntitlement()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GrantValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GrantValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetEntitlement()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrantValidationError{ + field: "Entitlement", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetPrincipal()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GrantValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GrantValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPrincipal()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrantValidationError{ + field: "Principal", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return GrantMultiError(errors) + } + + return nil +} + +// GrantMultiError is an error wrapping multiple validation errors returned by +// Grant.ValidateAll() if the designated constraints aren't met. +type GrantMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GrantMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GrantMultiError) AllErrors() []error { return m } + +// GrantValidationError is the validation error returned by Grant.Validate if +// the designated constraints aren't met. +type GrantValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GrantValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GrantValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GrantValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GrantValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GrantValidationError) ErrorName() string { return "GrantValidationError" } + +// Error satisfies the builtin error interface +func (e GrantValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGrant.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GrantValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GrantValidationError{} + +// Validate checks the field values on GrantSliceField with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *GrantSliceField) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GrantSliceField with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GrantSliceFieldMultiError, or nil if none found. +func (m *GrantSliceField) ValidateAll() error { + return m.validate(true) +} + +func (m *GrantSliceField) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetDefaultValue() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GrantSliceFieldValidationError{ + field: fmt.Sprintf("DefaultValue[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GrantSliceFieldValidationError{ + field: fmt.Sprintf("DefaultValue[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GrantSliceFieldValidationError{ + field: fmt.Sprintf("DefaultValue[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return GrantSliceFieldMultiError(errors) + } + + return nil +} + +// GrantSliceFieldMultiError is an error wrapping multiple validation errors +// returned by GrantSliceField.ValidateAll() if the designated constraints +// aren't met. +type GrantSliceFieldMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GrantSliceFieldMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GrantSliceFieldMultiError) AllErrors() []error { return m } + +// GrantSliceFieldValidationError is the validation error returned by +// GrantSliceField.Validate if the designated constraints aren't met. +type GrantSliceFieldValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GrantSliceFieldValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GrantSliceFieldValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GrantSliceFieldValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GrantSliceFieldValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GrantSliceFieldValidationError) ErrorName() string { return "GrantSliceFieldValidationError" } + +// Error satisfies the builtin error interface +func (e GrantSliceFieldValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGrantSliceField.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GrantSliceFieldValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GrantSliceFieldValidationError{} + // Validate checks the field values on ResourceIdField with the rules defined // in the proto definition for this message. If any rules are violated, the // first error encountered is returned, or nil if there are no violations. diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go index 5cc36692..a236f5f3 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/config/v1/config_protoopaque.pb.go @@ -721,6 +721,24 @@ func (x *Field) GetResourceSliceField() *ResourceSliceField { return nil } +func (x *Field) GetEntitlementSliceField() *EntitlementSliceField { + if x != nil { + if x, ok := x.xxx_hidden_Field.(*field_EntitlementSliceField); ok { + return x.EntitlementSliceField + } + } + return nil +} + +func (x *Field) GetGrantSliceField() *GrantSliceField { + if x != nil { + if x, ok := x.xxx_hidden_Field.(*field_GrantSliceField); ok { + return x.GrantSliceField + } + } + return nil +} + func (x *Field) SetName(v string) { x.xxx_hidden_Name = v } @@ -821,6 +839,22 @@ func (x *Field) SetResourceSliceField(v *ResourceSliceField) { x.xxx_hidden_Field = &field_ResourceSliceField{v} } +func (x *Field) SetEntitlementSliceField(v *EntitlementSliceField) { + if v == nil { + x.xxx_hidden_Field = nil + return + } + x.xxx_hidden_Field = &field_EntitlementSliceField{v} +} + +func (x *Field) SetGrantSliceField(v *GrantSliceField) { + if v == nil { + x.xxx_hidden_Field = nil + return + } + x.xxx_hidden_Field = &field_GrantSliceField{v} +} + func (x *Field) HasField() bool { if x == nil { return false @@ -900,6 +934,22 @@ func (x *Field) HasResourceSliceField() bool { return ok } +func (x *Field) HasEntitlementSliceField() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Field.(*field_EntitlementSliceField) + return ok +} + +func (x *Field) HasGrantSliceField() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Field.(*field_GrantSliceField) + return ok +} + func (x *Field) ClearField() { x.xxx_hidden_Field = nil } @@ -958,6 +1008,18 @@ func (x *Field) ClearResourceSliceField() { } } +func (x *Field) ClearEntitlementSliceField() { + if _, ok := x.xxx_hidden_Field.(*field_EntitlementSliceField); ok { + x.xxx_hidden_Field = nil + } +} + +func (x *Field) ClearGrantSliceField() { + if _, ok := x.xxx_hidden_Field.(*field_GrantSliceField); ok { + x.xxx_hidden_Field = nil + } +} + const Field_Field_not_set_case case_Field_Field = 0 const Field_StringField_case case_Field_Field = 100 const Field_IntField_case case_Field_Field = 101 @@ -968,6 +1030,8 @@ const Field_ResourceIdField_case case_Field_Field = 105 const Field_ResourceIdSliceField_case case_Field_Field = 106 const Field_ResourceField_case case_Field_Field = 107 const Field_ResourceSliceField_case case_Field_Field = 108 +const Field_EntitlementSliceField_case case_Field_Field = 109 +const Field_GrantSliceField_case case_Field_Field = 110 func (x *Field) WhichField() case_Field_Field { if x == nil { @@ -992,6 +1056,10 @@ func (x *Field) WhichField() case_Field_Field { return Field_ResourceField_case case *field_ResourceSliceField: return Field_ResourceSliceField_case + case *field_EntitlementSliceField: + return Field_EntitlementSliceField_case + case *field_GrantSliceField: + return Field_GrantSliceField_case default: return Field_Field_not_set_case } @@ -1016,8 +1084,10 @@ type Field_builder struct { ResourceIdField *ResourceIdField ResourceIdSliceField *ResourceIdSliceField // These are meant to serve as return types for actions. - ResourceField *ResourceField - ResourceSliceField *ResourceSliceField + ResourceField *ResourceField + ResourceSliceField *ResourceSliceField + EntitlementSliceField *EntitlementSliceField + GrantSliceField *GrantSliceField // -- end of xxx_hidden_Field } @@ -1059,6 +1129,12 @@ func (b0 Field_builder) Build() *Field { if b.ResourceSliceField != nil { x.xxx_hidden_Field = &field_ResourceSliceField{b.ResourceSliceField} } + if b.EntitlementSliceField != nil { + x.xxx_hidden_Field = &field_EntitlementSliceField{b.EntitlementSliceField} + } + if b.GrantSliceField != nil { + x.xxx_hidden_Field = &field_GrantSliceField{b.GrantSliceField} + } return m0 } @@ -1113,6 +1189,14 @@ type field_ResourceSliceField struct { ResourceSliceField *ResourceSliceField `protobuf:"bytes,108,opt,name=resource_slice_field,json=resourceSliceField,proto3,oneof"` } +type field_EntitlementSliceField struct { + EntitlementSliceField *EntitlementSliceField `protobuf:"bytes,109,opt,name=entitlement_slice_field,json=entitlementSliceField,proto3,oneof"` +} + +type field_GrantSliceField struct { + GrantSliceField *GrantSliceField `protobuf:"bytes,110,opt,name=grant_slice_field,json=grantSliceField,proto3,oneof"` +} + func (*field_StringField) isField_Field() {} func (*field_IntField) isField_Field() {} @@ -1131,6 +1215,10 @@ func (*field_ResourceField) isField_Field() {} func (*field_ResourceSliceField) isField_Field() {} +func (*field_EntitlementSliceField) isField_Field() {} + +func (*field_GrantSliceField) isField_Field() {} + // These are partially duplicate with the Resource proto in the connector package. // This is to avoid import cycles type Resource struct { @@ -1468,6 +1556,446 @@ func (b0 ResourceSliceField_builder) Build() *ResourceSliceField { return m0 } +// Simplified Entitlement for config return types (avoids import cycles with connector package) +type Entitlement struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id string `protobuf:"bytes,1,opt,name=id,proto3"` + xxx_hidden_DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3"` + xxx_hidden_Description string `protobuf:"bytes,3,opt,name=description,proto3"` + xxx_hidden_Slug string `protobuf:"bytes,4,opt,name=slug,proto3"` + xxx_hidden_Purpose string `protobuf:"bytes,5,opt,name=purpose,proto3"` + xxx_hidden_GrantableToResourceTypeIds []string `protobuf:"bytes,6,rep,name=grantable_to_resource_type_ids,json=grantableToResourceTypeIds,proto3"` + xxx_hidden_ResourceId string `protobuf:"bytes,7,opt,name=resource_id,json=resourceId,proto3"` + xxx_hidden_ResourceTypeId string `protobuf:"bytes,8,opt,name=resource_type_id,json=resourceTypeId,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Entitlement) Reset() { + *x = Entitlement{} + mi := &file_c1_config_v1_config_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Entitlement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Entitlement) ProtoMessage() {} + +func (x *Entitlement) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Entitlement) GetId() string { + if x != nil { + return x.xxx_hidden_Id + } + return "" +} + +func (x *Entitlement) GetDisplayName() string { + if x != nil { + return x.xxx_hidden_DisplayName + } + return "" +} + +func (x *Entitlement) GetDescription() string { + if x != nil { + return x.xxx_hidden_Description + } + return "" +} + +func (x *Entitlement) GetSlug() string { + if x != nil { + return x.xxx_hidden_Slug + } + return "" +} + +func (x *Entitlement) GetPurpose() string { + if x != nil { + return x.xxx_hidden_Purpose + } + return "" +} + +func (x *Entitlement) GetGrantableToResourceTypeIds() []string { + if x != nil { + return x.xxx_hidden_GrantableToResourceTypeIds + } + return nil +} + +func (x *Entitlement) GetResourceId() string { + if x != nil { + return x.xxx_hidden_ResourceId + } + return "" +} + +func (x *Entitlement) GetResourceTypeId() string { + if x != nil { + return x.xxx_hidden_ResourceTypeId + } + return "" +} + +func (x *Entitlement) SetId(v string) { + x.xxx_hidden_Id = v +} + +func (x *Entitlement) SetDisplayName(v string) { + x.xxx_hidden_DisplayName = v +} + +func (x *Entitlement) SetDescription(v string) { + x.xxx_hidden_Description = v +} + +func (x *Entitlement) SetSlug(v string) { + x.xxx_hidden_Slug = v +} + +func (x *Entitlement) SetPurpose(v string) { + x.xxx_hidden_Purpose = v +} + +func (x *Entitlement) SetGrantableToResourceTypeIds(v []string) { + x.xxx_hidden_GrantableToResourceTypeIds = v +} + +func (x *Entitlement) SetResourceId(v string) { + x.xxx_hidden_ResourceId = v +} + +func (x *Entitlement) SetResourceTypeId(v string) { + x.xxx_hidden_ResourceTypeId = v +} + +type Entitlement_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id string + DisplayName string + Description string + Slug string + Purpose string + GrantableToResourceTypeIds []string + ResourceId string + ResourceTypeId string +} + +func (b0 Entitlement_builder) Build() *Entitlement { + m0 := &Entitlement{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Id = b.Id + x.xxx_hidden_DisplayName = b.DisplayName + x.xxx_hidden_Description = b.Description + x.xxx_hidden_Slug = b.Slug + x.xxx_hidden_Purpose = b.Purpose + x.xxx_hidden_GrantableToResourceTypeIds = b.GrantableToResourceTypeIds + x.xxx_hidden_ResourceId = b.ResourceId + x.xxx_hidden_ResourceTypeId = b.ResourceTypeId + return m0 +} + +type EntitlementSliceField struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_DefaultValue *[]*Entitlement `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntitlementSliceField) Reset() { + *x = EntitlementSliceField{} + mi := &file_c1_config_v1_config_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntitlementSliceField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntitlementSliceField) ProtoMessage() {} + +func (x *EntitlementSliceField) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EntitlementSliceField) GetDefaultValue() []*Entitlement { + if x != nil { + if x.xxx_hidden_DefaultValue != nil { + return *x.xxx_hidden_DefaultValue + } + } + return nil +} + +func (x *EntitlementSliceField) SetDefaultValue(v []*Entitlement) { + x.xxx_hidden_DefaultValue = &v +} + +type EntitlementSliceField_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + DefaultValue []*Entitlement +} + +func (b0 EntitlementSliceField_builder) Build() *EntitlementSliceField { + m0 := &EntitlementSliceField{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_DefaultValue = &b.DefaultValue + return m0 +} + +// Reference to an entitlement (used in Grant) +type EntitlementRef struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id string `protobuf:"bytes,1,opt,name=id,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EntitlementRef) Reset() { + *x = EntitlementRef{} + mi := &file_c1_config_v1_config_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EntitlementRef) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntitlementRef) ProtoMessage() {} + +func (x *EntitlementRef) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EntitlementRef) GetId() string { + if x != nil { + return x.xxx_hidden_Id + } + return "" +} + +func (x *EntitlementRef) SetId(v string) { + x.xxx_hidden_Id = v +} + +type EntitlementRef_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id string +} + +func (b0 EntitlementRef_builder) Build() *EntitlementRef { + m0 := &EntitlementRef{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Id = b.Id + return m0 +} + +// Simplified Grant for config return types (avoids import cycles with connector package) +type Grant struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id string `protobuf:"bytes,1,opt,name=id,proto3"` + xxx_hidden_Entitlement *EntitlementRef `protobuf:"bytes,2,opt,name=entitlement,proto3"` + xxx_hidden_Principal *Resource `protobuf:"bytes,3,opt,name=principal,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Grant) Reset() { + *x = Grant{} + mi := &file_c1_config_v1_config_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Grant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Grant) ProtoMessage() {} + +func (x *Grant) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Grant) GetId() string { + if x != nil { + return x.xxx_hidden_Id + } + return "" +} + +func (x *Grant) GetEntitlement() *EntitlementRef { + if x != nil { + return x.xxx_hidden_Entitlement + } + return nil +} + +func (x *Grant) GetPrincipal() *Resource { + if x != nil { + return x.xxx_hidden_Principal + } + return nil +} + +func (x *Grant) SetId(v string) { + x.xxx_hidden_Id = v +} + +func (x *Grant) SetEntitlement(v *EntitlementRef) { + x.xxx_hidden_Entitlement = v +} + +func (x *Grant) SetPrincipal(v *Resource) { + x.xxx_hidden_Principal = v +} + +func (x *Grant) HasEntitlement() bool { + if x == nil { + return false + } + return x.xxx_hidden_Entitlement != nil +} + +func (x *Grant) HasPrincipal() bool { + if x == nil { + return false + } + return x.xxx_hidden_Principal != nil +} + +func (x *Grant) ClearEntitlement() { + x.xxx_hidden_Entitlement = nil +} + +func (x *Grant) ClearPrincipal() { + x.xxx_hidden_Principal = nil +} + +type Grant_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id string + Entitlement *EntitlementRef + Principal *Resource +} + +func (b0 Grant_builder) Build() *Grant { + m0 := &Grant{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Id = b.Id + x.xxx_hidden_Entitlement = b.Entitlement + x.xxx_hidden_Principal = b.Principal + return m0 +} + +type GrantSliceField struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_DefaultValue *[]*Grant `protobuf:"bytes,1,rep,name=default_value,json=defaultValue,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrantSliceField) Reset() { + *x = GrantSliceField{} + mi := &file_c1_config_v1_config_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrantSliceField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantSliceField) ProtoMessage() {} + +func (x *GrantSliceField) ProtoReflect() protoreflect.Message { + mi := &file_c1_config_v1_config_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GrantSliceField) GetDefaultValue() []*Grant { + if x != nil { + if x.xxx_hidden_DefaultValue != nil { + return *x.xxx_hidden_DefaultValue + } + } + return nil +} + +func (x *GrantSliceField) SetDefaultValue(v []*Grant) { + x.xxx_hidden_DefaultValue = &v +} + +type GrantSliceField_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + DefaultValue []*Grant +} + +func (b0 GrantSliceField_builder) Build() *GrantSliceField { + m0 := &GrantSliceField{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_DefaultValue = &b.DefaultValue + return m0 +} + type ResourceIdField struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_DefaultValue *ResourceId `protobuf:"bytes,1,opt,name=default_value,json=defaultValue,proto3"` @@ -1478,7 +2006,7 @@ type ResourceIdField struct { func (x *ResourceIdField) Reset() { *x = ResourceIdField{} - mi := &file_c1_config_v1_config_proto_msgTypes[8] + mi := &file_c1_config_v1_config_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1490,7 +2018,7 @@ func (x *ResourceIdField) String() string { func (*ResourceIdField) ProtoMessage() {} func (x *ResourceIdField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[8] + mi := &file_c1_config_v1_config_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1571,7 +2099,7 @@ type ResourceIdSliceField struct { func (x *ResourceIdSliceField) Reset() { *x = ResourceIdSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[9] + mi := &file_c1_config_v1_config_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1583,7 +2111,7 @@ func (x *ResourceIdSliceField) String() string { func (*ResourceIdSliceField) ProtoMessage() {} func (x *ResourceIdSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[9] + mi := &file_c1_config_v1_config_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1655,7 +2183,7 @@ type IntField struct { func (x *IntField) Reset() { *x = IntField{} - mi := &file_c1_config_v1_config_proto_msgTypes[10] + mi := &file_c1_config_v1_config_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1667,7 +2195,7 @@ func (x *IntField) String() string { func (*IntField) ProtoMessage() {} func (x *IntField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[10] + mi := &file_c1_config_v1_config_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1738,7 +2266,7 @@ type BoolField struct { func (x *BoolField) Reset() { *x = BoolField{} - mi := &file_c1_config_v1_config_proto_msgTypes[11] + mi := &file_c1_config_v1_config_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1750,7 +2278,7 @@ func (x *BoolField) String() string { func (*BoolField) ProtoMessage() {} func (x *BoolField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[11] + mi := &file_c1_config_v1_config_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1820,7 +2348,7 @@ type StringSliceField struct { func (x *StringSliceField) Reset() { *x = StringSliceField{} - mi := &file_c1_config_v1_config_proto_msgTypes[12] + mi := &file_c1_config_v1_config_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1832,7 +2360,7 @@ func (x *StringSliceField) String() string { func (*StringSliceField) ProtoMessage() {} func (x *StringSliceField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[12] + mi := &file_c1_config_v1_config_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1902,7 +2430,7 @@ type StringMapField struct { func (x *StringMapField) Reset() { *x = StringMapField{} - mi := &file_c1_config_v1_config_proto_msgTypes[13] + mi := &file_c1_config_v1_config_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1914,7 +2442,7 @@ func (x *StringMapField) String() string { func (*StringMapField) ProtoMessage() {} func (x *StringMapField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[13] + mi := &file_c1_config_v1_config_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1985,7 +2513,7 @@ type StringFieldOption struct { func (x *StringFieldOption) Reset() { *x = StringFieldOption{} - mi := &file_c1_config_v1_config_proto_msgTypes[14] + mi := &file_c1_config_v1_config_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1997,7 +2525,7 @@ func (x *StringFieldOption) String() string { func (*StringFieldOption) ProtoMessage() {} func (x *StringFieldOption) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[14] + mi := &file_c1_config_v1_config_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2072,7 +2600,7 @@ type StringField struct { func (x *StringField) Reset() { *x = StringField{} - mi := &file_c1_config_v1_config_proto_msgTypes[15] + mi := &file_c1_config_v1_config_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2084,7 +2612,7 @@ func (x *StringField) String() string { func (*StringField) ProtoMessage() {} func (x *StringField) ProtoReflect() protoreflect.Message { - mi := &file_c1_config_v1_config_proto_msgTypes[15] + mi := &file_c1_config_v1_config_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2219,7 +2747,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x1b\n" + "\thelp_text\x18\x03 \x01(\tR\bhelpText\x12\x16\n" + "\x06fields\x18\x04 \x03(\tR\x06fields\x12\x18\n" + - "\adefault\x18\x05 \x01(\bR\adefault\"\xf1\x06\n" + + "\adefault\x18\x05 \x01(\bR\adefault\"\x9d\b\n" + "\x05Field\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + @@ -2238,7 +2766,9 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x11resource_id_field\x18i \x01(\v2\x1d.c1.config.v1.ResourceIdFieldH\x00R\x0fresourceIdField\x12[\n" + "\x17resource_id_slice_field\x18j \x01(\v2\".c1.config.v1.ResourceIdSliceFieldH\x00R\x14resourceIdSliceField\x12D\n" + "\x0eresource_field\x18k \x01(\v2\x1b.c1.config.v1.ResourceFieldH\x00R\rresourceField\x12T\n" + - "\x14resource_slice_field\x18l \x01(\v2 .c1.config.v1.ResourceSliceFieldH\x00R\x12resourceSliceFieldB\a\n" + + "\x14resource_slice_field\x18l \x01(\v2 .c1.config.v1.ResourceSliceFieldH\x00R\x12resourceSliceField\x12]\n" + + "\x17entitlement_slice_field\x18m \x01(\v2#.c1.config.v1.EntitlementSliceFieldH\x00R\x15entitlementSliceField\x12K\n" + + "\x11grant_slice_field\x18n \x01(\v2\x1d.c1.config.v1.GrantSliceFieldH\x00R\x0fgrantSliceFieldB\a\n" + "\x05field\"\x8a\x02\n" + "\bResource\x129\n" + "\vresource_id\x18\x01 \x01(\v2\x18.c1.config.v1.ResourceIdR\n" + @@ -2255,7 +2785,27 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\rResourceField\x12;\n" + "\rdefault_value\x18\x01 \x01(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"Q\n" + "\x12ResourceSliceField\x12;\n" + - "\rdefault_value\x18\x01 \x03(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"\x94\x01\n" + + "\rdefault_value\x18\x01 \x03(\v2\x16.c1.config.v1.ResourceR\fdefaultValue\"\x9f\x02\n" + + "\vEntitlement\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x12\n" + + "\x04slug\x18\x04 \x01(\tR\x04slug\x12\x18\n" + + "\apurpose\x18\x05 \x01(\tR\apurpose\x12B\n" + + "\x1egrantable_to_resource_type_ids\x18\x06 \x03(\tR\x1agrantableToResourceTypeIds\x12\x1f\n" + + "\vresource_id\x18\a \x01(\tR\n" + + "resourceId\x12(\n" + + "\x10resource_type_id\x18\b \x01(\tR\x0eresourceTypeId\"W\n" + + "\x15EntitlementSliceField\x12>\n" + + "\rdefault_value\x18\x01 \x03(\v2\x19.c1.config.v1.EntitlementR\fdefaultValue\" \n" + + "\x0eEntitlementRef\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\x8d\x01\n" + + "\x05Grant\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12>\n" + + "\ventitlement\x18\x02 \x01(\v2\x1c.c1.config.v1.EntitlementRefR\ventitlement\x124\n" + + "\tprincipal\x18\x03 \x01(\v2\x16.c1.config.v1.ResourceR\tprincipal\"K\n" + + "\x0fGrantSliceField\x128\n" + + "\rdefault_value\x18\x01 \x03(\v2\x13.c1.config.v1.GrantR\fdefaultValue\"\x94\x01\n" + "\x0fResourceIdField\x12=\n" + "\rdefault_value\x18\x01 \x01(\v2\x18.c1.config.v1.ResourceIdR\fdefaultValue\x128\n" + "\x05rules\x18\x03 \x01(\v2\x1d.c1.config.v1.ResourceIDRulesH\x00R\x05rules\x88\x01\x01B\b\n" + @@ -2308,7 +2858,7 @@ const file_c1_config_v1_config_proto_rawDesc = "" + "\x1dSTRING_FIELD_TYPE_FILE_UPLOAD\x10\x04B3Z1github.com/conductorone/baton-sdk/pb/c1/config/v1b\x06proto3" var file_c1_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_c1_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_c1_config_v1_config_proto_goTypes = []any{ (ConstraintKind)(0), // 0: c1.config.v1.ConstraintKind (StringFieldType)(0), // 1: c1.config.v1.StringFieldType @@ -2320,61 +2870,72 @@ var file_c1_config_v1_config_proto_goTypes = []any{ (*ResourceId)(nil), // 7: c1.config.v1.ResourceId (*ResourceField)(nil), // 8: c1.config.v1.ResourceField (*ResourceSliceField)(nil), // 9: c1.config.v1.ResourceSliceField - (*ResourceIdField)(nil), // 10: c1.config.v1.ResourceIdField - (*ResourceIdSliceField)(nil), // 11: c1.config.v1.ResourceIdSliceField - (*IntField)(nil), // 12: c1.config.v1.IntField - (*BoolField)(nil), // 13: c1.config.v1.BoolField - (*StringSliceField)(nil), // 14: c1.config.v1.StringSliceField - (*StringMapField)(nil), // 15: c1.config.v1.StringMapField - (*StringFieldOption)(nil), // 16: c1.config.v1.StringFieldOption - (*StringField)(nil), // 17: c1.config.v1.StringField - nil, // 18: c1.config.v1.StringMapField.DefaultValueEntry - (*anypb.Any)(nil), // 19: google.protobuf.Any - (*ResourceIDRules)(nil), // 20: c1.config.v1.ResourceIDRules - (*RepeatedResourceIdRules)(nil), // 21: c1.config.v1.RepeatedResourceIdRules - (*Int64Rules)(nil), // 22: c1.config.v1.Int64Rules - (*BoolRules)(nil), // 23: c1.config.v1.BoolRules - (*RepeatedStringRules)(nil), // 24: c1.config.v1.RepeatedStringRules - (*StringMapRules)(nil), // 25: c1.config.v1.StringMapRules - (*StringRules)(nil), // 26: c1.config.v1.StringRules + (*Entitlement)(nil), // 10: c1.config.v1.Entitlement + (*EntitlementSliceField)(nil), // 11: c1.config.v1.EntitlementSliceField + (*EntitlementRef)(nil), // 12: c1.config.v1.EntitlementRef + (*Grant)(nil), // 13: c1.config.v1.Grant + (*GrantSliceField)(nil), // 14: c1.config.v1.GrantSliceField + (*ResourceIdField)(nil), // 15: c1.config.v1.ResourceIdField + (*ResourceIdSliceField)(nil), // 16: c1.config.v1.ResourceIdSliceField + (*IntField)(nil), // 17: c1.config.v1.IntField + (*BoolField)(nil), // 18: c1.config.v1.BoolField + (*StringSliceField)(nil), // 19: c1.config.v1.StringSliceField + (*StringMapField)(nil), // 20: c1.config.v1.StringMapField + (*StringFieldOption)(nil), // 21: c1.config.v1.StringFieldOption + (*StringField)(nil), // 22: c1.config.v1.StringField + nil, // 23: c1.config.v1.StringMapField.DefaultValueEntry + (*anypb.Any)(nil), // 24: google.protobuf.Any + (*ResourceIDRules)(nil), // 25: c1.config.v1.ResourceIDRules + (*RepeatedResourceIdRules)(nil), // 26: c1.config.v1.RepeatedResourceIdRules + (*Int64Rules)(nil), // 27: c1.config.v1.Int64Rules + (*BoolRules)(nil), // 28: c1.config.v1.BoolRules + (*RepeatedStringRules)(nil), // 29: c1.config.v1.RepeatedStringRules + (*StringMapRules)(nil), // 30: c1.config.v1.StringMapRules + (*StringRules)(nil), // 31: c1.config.v1.StringRules } var file_c1_config_v1_config_proto_depIdxs = []int32{ 5, // 0: c1.config.v1.Configuration.fields:type_name -> c1.config.v1.Field 3, // 1: c1.config.v1.Configuration.constraints:type_name -> c1.config.v1.Constraint 4, // 2: c1.config.v1.Configuration.field_groups:type_name -> c1.config.v1.FieldGroup 0, // 3: c1.config.v1.Constraint.kind:type_name -> c1.config.v1.ConstraintKind - 17, // 4: c1.config.v1.Field.string_field:type_name -> c1.config.v1.StringField - 12, // 5: c1.config.v1.Field.int_field:type_name -> c1.config.v1.IntField - 13, // 6: c1.config.v1.Field.bool_field:type_name -> c1.config.v1.BoolField - 14, // 7: c1.config.v1.Field.string_slice_field:type_name -> c1.config.v1.StringSliceField - 15, // 8: c1.config.v1.Field.string_map_field:type_name -> c1.config.v1.StringMapField - 10, // 9: c1.config.v1.Field.resource_id_field:type_name -> c1.config.v1.ResourceIdField - 11, // 10: c1.config.v1.Field.resource_id_slice_field:type_name -> c1.config.v1.ResourceIdSliceField + 22, // 4: c1.config.v1.Field.string_field:type_name -> c1.config.v1.StringField + 17, // 5: c1.config.v1.Field.int_field:type_name -> c1.config.v1.IntField + 18, // 6: c1.config.v1.Field.bool_field:type_name -> c1.config.v1.BoolField + 19, // 7: c1.config.v1.Field.string_slice_field:type_name -> c1.config.v1.StringSliceField + 20, // 8: c1.config.v1.Field.string_map_field:type_name -> c1.config.v1.StringMapField + 15, // 9: c1.config.v1.Field.resource_id_field:type_name -> c1.config.v1.ResourceIdField + 16, // 10: c1.config.v1.Field.resource_id_slice_field:type_name -> c1.config.v1.ResourceIdSliceField 8, // 11: c1.config.v1.Field.resource_field:type_name -> c1.config.v1.ResourceField 9, // 12: c1.config.v1.Field.resource_slice_field:type_name -> c1.config.v1.ResourceSliceField - 7, // 13: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId - 7, // 14: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId - 19, // 15: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any - 6, // 16: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource - 6, // 17: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource - 7, // 18: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId - 20, // 19: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules - 10, // 20: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField - 21, // 21: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules - 22, // 22: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules - 23, // 23: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules - 24, // 24: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules - 18, // 25: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry - 25, // 26: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules - 26, // 27: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules - 1, // 28: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType - 16, // 29: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption - 19, // 30: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any - 31, // [31:31] is the sub-list for method output_type - 31, // [31:31] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name + 11, // 13: c1.config.v1.Field.entitlement_slice_field:type_name -> c1.config.v1.EntitlementSliceField + 14, // 14: c1.config.v1.Field.grant_slice_field:type_name -> c1.config.v1.GrantSliceField + 7, // 15: c1.config.v1.Resource.resource_id:type_name -> c1.config.v1.ResourceId + 7, // 16: c1.config.v1.Resource.parent_resource_id:type_name -> c1.config.v1.ResourceId + 24, // 17: c1.config.v1.Resource.annotations:type_name -> google.protobuf.Any + 6, // 18: c1.config.v1.ResourceField.default_value:type_name -> c1.config.v1.Resource + 6, // 19: c1.config.v1.ResourceSliceField.default_value:type_name -> c1.config.v1.Resource + 10, // 20: c1.config.v1.EntitlementSliceField.default_value:type_name -> c1.config.v1.Entitlement + 12, // 21: c1.config.v1.Grant.entitlement:type_name -> c1.config.v1.EntitlementRef + 6, // 22: c1.config.v1.Grant.principal:type_name -> c1.config.v1.Resource + 13, // 23: c1.config.v1.GrantSliceField.default_value:type_name -> c1.config.v1.Grant + 7, // 24: c1.config.v1.ResourceIdField.default_value:type_name -> c1.config.v1.ResourceId + 25, // 25: c1.config.v1.ResourceIdField.rules:type_name -> c1.config.v1.ResourceIDRules + 15, // 26: c1.config.v1.ResourceIdSliceField.default_value:type_name -> c1.config.v1.ResourceIdField + 26, // 27: c1.config.v1.ResourceIdSliceField.rules:type_name -> c1.config.v1.RepeatedResourceIdRules + 27, // 28: c1.config.v1.IntField.rules:type_name -> c1.config.v1.Int64Rules + 28, // 29: c1.config.v1.BoolField.rules:type_name -> c1.config.v1.BoolRules + 29, // 30: c1.config.v1.StringSliceField.rules:type_name -> c1.config.v1.RepeatedStringRules + 23, // 31: c1.config.v1.StringMapField.default_value:type_name -> c1.config.v1.StringMapField.DefaultValueEntry + 30, // 32: c1.config.v1.StringMapField.rules:type_name -> c1.config.v1.StringMapRules + 31, // 33: c1.config.v1.StringField.rules:type_name -> c1.config.v1.StringRules + 1, // 34: c1.config.v1.StringField.type:type_name -> c1.config.v1.StringFieldType + 21, // 35: c1.config.v1.StringField.options:type_name -> c1.config.v1.StringFieldOption + 24, // 36: c1.config.v1.StringMapField.DefaultValueEntry.value:type_name -> google.protobuf.Any + 37, // [37:37] is the sub-list for method output_type + 37, // [37:37] is the sub-list for method input_type + 37, // [37:37] is the sub-list for extension type_name + 37, // [37:37] is the sub-list for extension extendee + 0, // [0:37] is the sub-list for field type_name } func init() { file_c1_config_v1_config_proto_init() } @@ -2393,21 +2954,23 @@ func file_c1_config_v1_config_proto_init() { (*field_ResourceIdSliceField)(nil), (*field_ResourceField)(nil), (*field_ResourceSliceField)(nil), + (*field_EntitlementSliceField)(nil), + (*field_GrantSliceField)(nil), } - file_c1_config_v1_config_proto_msgTypes[8].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[9].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[10].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[11].OneofWrappers = []any{} - file_c1_config_v1_config_proto_msgTypes[12].OneofWrappers = []any{} file_c1_config_v1_config_proto_msgTypes[13].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[14].OneofWrappers = []any{} file_c1_config_v1_config_proto_msgTypes[15].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[16].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[17].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[18].OneofWrappers = []any{} + file_c1_config_v1_config_proto_msgTypes[20].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_config_v1_config_proto_rawDesc), len(file_c1_config_v1_config_proto_rawDesc)), NumEnums: 2, - NumMessages: 17, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/actions/args.go b/vendor/github.com/conductorone/baton-sdk/pkg/actions/args.go index 367b3287..995a4cb2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/actions/args.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/actions/args.go @@ -541,3 +541,231 @@ func NewReturnValues(success bool, fields ...ReturnField) *structpb.Struct { return rv } + +// entitlementToBasicEntitlement converts a v2.Entitlement to a config.Entitlement. +func entitlementToBasicEntitlement(entitlement *v2.Entitlement) *config.Entitlement { + var grantableToResourceTypeIDs []string + for _, rt := range entitlement.GetGrantableTo() { + grantableToResourceTypeIDs = append(grantableToResourceTypeIDs, rt.GetId()) + } + + var resourceId, resourceTypeId string + if entitlement.GetResource() != nil && entitlement.GetResource().GetId() != nil { + resourceId = entitlement.GetResource().GetId().GetResource() + resourceTypeId = entitlement.GetResource().GetId().GetResourceType() + } + + return config.Entitlement_builder{ + Id: entitlement.GetId(), + DisplayName: entitlement.GetDisplayName(), + Description: entitlement.GetDescription(), + Slug: entitlement.GetSlug(), + Purpose: entitlement.GetPurpose().String(), + GrantableToResourceTypeIds: grantableToResourceTypeIDs, + ResourceId: resourceId, + ResourceTypeId: resourceTypeId, + }.Build() +} + +// basicEntitlementToEntitlement converts a config.Entitlement to a v2.Entitlement. +func basicEntitlementToEntitlement(basicEntitlement *config.Entitlement) *v2.Entitlement { + var grantableTo []*v2.ResourceType + for _, rtId := range basicEntitlement.GetGrantableToResourceTypeIds() { + grantableTo = append(grantableTo, &v2.ResourceType{Id: rtId}) + } + + var resource *v2.Resource + if basicEntitlement.GetResourceId() != "" && basicEntitlement.GetResourceTypeId() != "" { + resource = &v2.Resource{ + Id: &v2.ResourceId{ + Resource: basicEntitlement.GetResourceId(), + ResourceType: basicEntitlement.GetResourceTypeId(), + }, + } + } + + // Parse purpose from string + purposeValue := v2.Entitlement_PURPOSE_VALUE_UNSPECIFIED + switch basicEntitlement.GetPurpose() { + case "PURPOSE_VALUE_ASSIGNMENT": + purposeValue = v2.Entitlement_PURPOSE_VALUE_ASSIGNMENT + case "PURPOSE_VALUE_PERMISSION": + purposeValue = v2.Entitlement_PURPOSE_VALUE_PERMISSION + case "PURPOSE_VALUE_OWNERSHIP": + purposeValue = v2.Entitlement_PURPOSE_VALUE_OWNERSHIP + } + + return &v2.Entitlement{ + Id: basicEntitlement.GetId(), + DisplayName: basicEntitlement.GetDisplayName(), + Description: basicEntitlement.GetDescription(), + Slug: basicEntitlement.GetSlug(), + Purpose: purposeValue, + GrantableTo: grantableTo, + Resource: resource, + } +} + +// grantToBasicGrant converts a v2.Grant to a config.Grant. +func grantToBasicGrant(grant *v2.Grant) *config.Grant { + var entitlementRef *config.EntitlementRef + if grant.GetEntitlement() != nil { + entitlementRef = config.EntitlementRef_builder{ + Id: grant.GetEntitlement().GetId(), + }.Build() + } + + var principal *config.Resource + if grant.GetPrincipal() != nil { + principal = resourceToBasicResource(grant.GetPrincipal()) + } + + return config.Grant_builder{ + Id: grant.GetId(), + Entitlement: entitlementRef, + Principal: principal, + }.Build() +} + +// basicGrantToGrant converts a config.Grant to a v2.Grant. +func basicGrantToGrant(basicGrant *config.Grant) *v2.Grant { + var entitlement *v2.Entitlement + if basicGrant.GetEntitlement() != nil { + entitlement = &v2.Entitlement{ + Id: basicGrant.GetEntitlement().GetId(), + } + } + + var principal *v2.Resource + if basicGrant.GetPrincipal() != nil { + principal = basicResourceToResource(basicGrant.GetPrincipal()) + } + + return &v2.Grant{ + Id: basicGrant.GetId(), + Entitlement: entitlement, + Principal: principal, + } +} + +// GetEntitlementListFieldArg extracts a list of Entitlement proto messages from the args struct by key. +// Each Entitlement is expected to be stored as a JSON-serialized struct value. +// Returns the list of Entitlement and true if found and valid, or nil and false otherwise. +func GetEntitlementListFieldArg(args *structpb.Struct, key string) ([]*v2.Entitlement, bool) { + if args == nil || args.Fields == nil { + return nil, false + } + value, ok := args.Fields[key] + if !ok { + return nil, false + } + listValue, ok := value.GetKind().(*structpb.Value_ListValue) + if !ok { + return nil, false + } + var entitlements []*v2.Entitlement + for _, v := range listValue.ListValue.Values { + structValue, ok := v.GetKind().(*structpb.Value_StructValue) + if !ok { + return nil, false + } + + // Marshal the struct value back to JSON, then unmarshal into the proto message + jsonBytes, err := protojson.Marshal(structValue.StructValue) + if err != nil { + return nil, false + } + + basicEntitlement := &config.Entitlement{} + if err := protojson.Unmarshal(jsonBytes, basicEntitlement); err != nil { + return nil, false + } + + entitlements = append(entitlements, basicEntitlementToEntitlement(basicEntitlement)) + } + return entitlements, true +} + +// GetGrantListFieldArg extracts a list of Grant proto messages from the args struct by key. +// Each Grant is expected to be stored as a JSON-serialized struct value. +// Returns the list of Grant and true if found and valid, or nil and false otherwise. +func GetGrantListFieldArg(args *structpb.Struct, key string) ([]*v2.Grant, bool) { + if args == nil || args.Fields == nil { + return nil, false + } + value, ok := args.Fields[key] + if !ok { + return nil, false + } + listValue, ok := value.GetKind().(*structpb.Value_ListValue) + if !ok { + return nil, false + } + var grants []*v2.Grant + for _, v := range listValue.ListValue.Values { + structValue, ok := v.GetKind().(*structpb.Value_StructValue) + if !ok { + return nil, false + } + + // Marshal the struct value back to JSON, then unmarshal into the proto message + jsonBytes, err := protojson.Marshal(structValue.StructValue) + if err != nil { + return nil, false + } + + basicGrant := &config.Grant{} + if err := protojson.Unmarshal(jsonBytes, basicGrant); err != nil { + return nil, false + } + + grants = append(grants, basicGrantToGrant(basicGrant)) + } + return grants, true +} + +// NewEntitlementListReturnField creates a return field with a list of Entitlement proto values. +func NewEntitlementListReturnField(key string, entitlements []*v2.Entitlement) (ReturnField, error) { + listValues := make([]*structpb.Value, len(entitlements)) + for i, entitlement := range entitlements { + if entitlement == nil { + return ReturnField{}, fmt.Errorf("entitlement at index %d cannot be nil", i) + } + basicEntitlement := entitlementToBasicEntitlement(entitlement) + jsonBytes, err := protojson.Marshal(basicEntitlement) + if err != nil { + return ReturnField{}, fmt.Errorf("failed to marshal entitlement: %w", err) + } + + structValue := &structpb.Struct{} + if err := protojson.Unmarshal(jsonBytes, structValue); err != nil { + return ReturnField{}, fmt.Errorf("failed to unmarshal entitlement to struct: %w", err) + } + + listValues[i] = structpb.NewStructValue(structValue) + } + return ReturnField{Key: key, Value: structpb.NewListValue(&structpb.ListValue{Values: listValues})}, nil +} + +// NewGrantListReturnField creates a return field with a list of Grant proto values. +func NewGrantListReturnField(key string, grants []*v2.Grant) (ReturnField, error) { + listValues := make([]*structpb.Value, len(grants)) + for i, grant := range grants { + if grant == nil { + return ReturnField{}, fmt.Errorf("grant at index %d cannot be nil", i) + } + basicGrant := grantToBasicGrant(grant) + jsonBytes, err := protojson.Marshal(basicGrant) + if err != nil { + return ReturnField{}, fmt.Errorf("failed to marshal grant: %w", err) + } + + structValue := &structpb.Struct{} + if err := protojson.Unmarshal(jsonBytes, structValue); err != nil { + return ReturnField{}, fmt.Errorf("failed to unmarshal grant to struct: %w", err) + } + + listValues[i] = structpb.NewStructValue(structValue) + } + return ReturnField{Key: key, Value: structpb.NewListValue(&structpb.ListValue{Values: listValues})}, nil +} diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go index 93a6e3ba..8adde283 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/cli.go @@ -16,8 +16,9 @@ import ( ) type RunTimeOpts struct { - SessionStore sessions.SessionStore - TokenSource oauth2.TokenSource + SessionStore sessions.SessionStore + TokenSource oauth2.TokenSource + SelectedAuthMethod string } // GetConnectorFunc is a function type that creates a connector instance. @@ -35,7 +36,8 @@ func WithSessionCache(ctx context.Context, constructor sessions.SessionStoreCons } type ConnectorOpts struct { - TokenSource oauth2.TokenSource + TokenSource oauth2.TokenSource + SelectedAuthMethod string } type NewConnector[T field.Configurable] func(ctx context.Context, cfg T, opts *ConnectorOpts) (connectorbuilder.ConnectorBuilderV2, []connectorbuilder.Opt, error) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go index efbaff6b..1b7aadcd 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/commands.go @@ -179,6 +179,13 @@ func MakeMainCommand[T field.Configurable]( if v.GetBool("skip-full-sync") { opts = append(opts, connectorrunner.WithFullSyncDisabled()) } + if v.GetBool("health-check") { + opts = append(opts, connectorrunner.WithHealthCheck( + true, + v.GetInt("health-check-port"), + v.GetString("health-check-bind-address"), + )) + } } else { switch { case v.GetString("grant-entitlement") != "": @@ -373,7 +380,8 @@ func MakeMainCommand[T field.Configurable]( opts = append(opts, connectorrunner.WithSkipGrants(v.GetBool("skip-grants"))) } - c, err := getconnector(runCtx, t, RunTimeOpts{}) + // Save the selected authentication method and get the connector. + c, err := getconnector(runCtx, t, RunTimeOpts{SelectedAuthMethod: v.GetString("auth-method")}) if err != nil { return err } @@ -542,6 +550,7 @@ func MakeGRPCServerCommand[T field.Configurable]( otterOptions.MaximumWeight = uint64(sessionStoreMaximumSize) } }), + SelectedAuthMethod: v.GetString("auth-method"), }) if err != nil { return err @@ -643,12 +652,13 @@ func MakeCapabilitiesCommand[T field.Configurable]( if err != nil { return fmt.Errorf("failed to make configuration: %w", err) } + authMethod := v.GetString("auth-method") // validate required fields and relationship constraints - if err := field.Validate(confschema, t, field.WithAuthMethod(v.GetString("auth-method"))); err != nil { + if err := field.Validate(confschema, t, field.WithAuthMethod(authMethod)); err != nil { return err } - c, err = getconnector(runCtx, t, RunTimeOpts{}) + c, err = getconnector(runCtx, t, RunTimeOpts{SelectedAuthMethod: authMethod}) if err != nil { return err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go b/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go index ae5e0c20..3d9cf060 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/cli/lambda_server__added.go @@ -226,6 +226,7 @@ func OptionallyAddLambdaCommand[T field.Configurable]( otterOptions.MaximumWeight = uint64(sessionStoreMaximumSize) } }), + SelectedAuthMethod: authMethodStr, } if hasOauthField(schemaFields) { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go index 02cc5d18..f6ae6be2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/config/config.go @@ -30,7 +30,8 @@ func RunConnector[T field.Configurable]( ) { f := func(ctx context.Context, cfg T, runTimeOpts cli.RunTimeOpts) (types.ConnectorServer, error) { l := ctxzap.Extract(ctx) - connector, builderOpts, err := cf(ctx, cfg, &cli.ConnectorOpts{TokenSource: runTimeOpts.TokenSource}) + connector, builderOpts, err := cf(ctx, cfg, &cli.ConnectorOpts{TokenSource: runTimeOpts.TokenSource, + SelectedAuthMethod: runTimeOpts.SelectedAuthMethod}) if err != nil { return nil, err } @@ -240,6 +241,30 @@ func DefineConfigurationV2[T field.Configurable]( return nil, nil, err } + // Health check client command - doesn't need connector config validation + healthCheckCmd := &cobra.Command{ + Use: "health-check", + Short: "Check the health of a running connector", + Long: `Query the health check server of a running connector. + +This command is designed for use in container/Kubernetes health check scenarios. +It queries the specified endpoint and exits with code 0 if healthy, or non-zero otherwise. + +Examples: + # Check health using defaults (localhost:8081/health) + connector-name health-check + + # Check readiness endpoint + connector-name health-check --endpoint=ready + + # Check liveness with custom port + connector-name health-check --endpoint=live --health-check-port=9090`, + RunE: cli.MakeHealthCheckCommand(ctx, v), + } + healthCheckCmd.Flags().String("endpoint", "health", "Endpoint to check: health, ready, or live") + healthCheckCmd.Flags().Int("timeout", 5, "Request timeout in seconds") + mainCMD.AddCommand(healthCheckCmd) + return v, mainCMD, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go index 01c7f238..6f09907d 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_provisioner.go @@ -46,7 +46,7 @@ type GrantProvisioner interface { // This is the recommended interface for implementing provisioning operations in new connectors. // It differs from ResourceProvisioner by returning a list of grants from the Grant method. type ResourceProvisionerV2 interface { - ResourceSyncer + ResourceSyncerV2 ResourceProvisionerV2Limited } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go index fb5201ae..2690bcdb 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorrunner/runner.go @@ -12,6 +12,7 @@ import ( "github.com/conductorone/baton-sdk/pkg/bid" "github.com/conductorone/baton-sdk/pkg/connectorbuilder" + "github.com/conductorone/baton-sdk/pkg/healthcheck" "github.com/conductorone/baton-sdk/pkg/synccompactor" "golang.org/x/sync/semaphore" "google.golang.org/protobuf/types/known/structpb" @@ -38,10 +39,11 @@ const ( ) type connectorRunner struct { - cw types.ClientWrapper - oneShot bool - tasks tasks.Manager - debugFile *os.File + cw types.ClientWrapper + oneShot bool + tasks tasks.Manager + debugFile *os.File + healthServer *healthcheck.Server } var ErrSigTerm = errors.New("context cancelled by process shutdown") @@ -240,6 +242,14 @@ func (c *connectorRunner) run(ctx context.Context) error { func (c *connectorRunner) Close(ctx context.Context) error { var retErr error + // Stop health check server if running + if c.healthServer != nil { + if err := c.healthServer.Stop(ctx); err != nil { + retErr = errors.Join(retErr, err) + } + c.healthServer = nil + } + if err := c.cw.Close(); err != nil { retErr = errors.Join(retErr, err) } @@ -360,6 +370,9 @@ type runnerConfig struct { syncResourceTypeIDs []string defaultCapabilitiesConnectorBuilder connectorbuilder.ConnectorBuilder defaultCapabilitiesConnectorBuilderV2 connectorbuilder.ConnectorBuilderV2 + healthCheckEnabled bool + healthCheckPort int + healthCheckBindAddress string } func WithSessionStoreEnabled() Option { @@ -722,6 +735,16 @@ func WithDefaultCapabilitiesConnectorBuilderV2(t connectorbuilder.ConnectorBuild } } +// WithHealthCheck enables the HTTP health check server. +func WithHealthCheck(enabled bool, port int, bindAddress string) Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.healthCheckEnabled = enabled + cfg.healthCheckPort = port + cfg.healthCheckBindAddress = bindAddress + return nil + } +} + func ExtractDefaultConnector(ctx context.Context, options ...Option) (any, error) { cfg := &runnerConfig{} @@ -916,5 +939,20 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op } runner.tasks = tm + // Start health check server if enabled (only for daemon mode) + if cfg.healthCheckEnabled { + healthCfg := healthcheck.Config{ + Enabled: true, + Port: cfg.healthCheckPort, + BindAddress: cfg.healthCheckBindAddress, + } + healthServer := healthcheck.NewServer(healthCfg, cw.C) + if err := healthServer.Start(ctx); err != nil { + _ = cw.Close() // Clean up connector wrapper on failure + return nil, fmt.Errorf("failed to start health check server: %w", err) + } + runner.healthServer = healthServer + } + return runner, nil } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go index bc995d11..6136cc84 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/default_relationships.go @@ -39,6 +39,10 @@ var DefaultRelationships = []SchemaFieldRelationship{ []SchemaField{skipGrants}, []SchemaField{targetedSyncResourceIDs}, ), + FieldsDependentOn( + []SchemaField{healthCheckPortField, healthCheckBindAddressField}, + []SchemaField{healthCheckField}, + ), } func EnsureDefaultRelationships(original []SchemaFieldRelationship) []SchemaFieldRelationship { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go index 9259241e..d08a0c8b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/field/defaults.go @@ -290,6 +290,25 @@ var ( WithExportTarget(ExportTargetOps), WithHidden(true), WithPersistent(true)) + + healthCheckField = BoolField("health-check", + WithDescription("Enable the HTTP health check endpoint"), + WithDefaultValue(false), + WithPersistent(true), + WithExportTarget(ExportTargetOps)) + + healthCheckPortField = IntField("health-check-port", + WithDescription("Port for the HTTP health check endpoint"), + WithDefaultValue(8081), + WithPersistent(true), + WithExportTarget(ExportTargetOps)) + + healthCheckBindAddressField = StringField("health-check-bind-address", + WithDescription("Bind address for health check server (127.0.0.1 for localhost-only)"), + WithDefaultValue("127.0.0.1"), + WithPersistent(true), + WithHidden(true), + WithExportTarget(ExportTargetOps)) ) func LambdaServerFields() []SchemaField { @@ -373,6 +392,10 @@ var DefaultFields = []SchemaField{ otelLoggingDisabled, authMethod, + + healthCheckField, + healthCheckPortField, + healthCheckBindAddressField, } func IsFieldAmongDefaultList(f SchemaField) bool { diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go index f2d6acbd..b3cfeeac 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go @@ -1,3 +1,3 @@ package sdk -const Version = "v0.7.3" +const Version = "v0.7.9" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go index d2e8be55..532cc8e4 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sync/syncer.go @@ -2518,6 +2518,11 @@ func (s *syncer) listExternalEntitlementsForResource(ctx context.Context, resour break } } + for _, ent := range ents { + annos := annotations.Annotations(ent.GetAnnotations()) + annos.Update(&v2.EntitlementImmutable{}) + ent.SetAnnotations(annos) + } return ents, nil } @@ -2535,6 +2540,12 @@ func (s *syncer) listExternalGrantsForEntitlement(ctx context.Context, ent *v2.E } grants := grantsForEntitlementResp.GetList() if len(grants) > 0 { + // Add immutable annotation to external resource grants. + for _, grant := range grants { + annos := annotations.Annotations(grant.GetAnnotations()) + annos.Update(&v2.GrantImmutable{}) + grant.SetAnnotations(annos) + } if !yield(grants, err) { return } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/actions.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/actions.go index f6cdfaee..323b5665 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/actions.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/actions.go @@ -139,23 +139,6 @@ func (c *actionInvokeTaskHandler) HandleTask(ctx context.Context) error { return c.helpers.FinishTask(ctx, nil, nil, err) } - // Check if the action itself failed and propagate the error - if resp.GetStatus() == v2.BatonActionStatus_BATON_ACTION_STATUS_FAILED { - errMsg := "action failed" - if resp.GetResponse() != nil && resp.GetResponse().GetFields() != nil { - if errField, ok := resp.GetResponse().GetFields()["error"]; ok { - errMsg = errField.GetStringValue() - } - } - l.Error("ActionInvoke failed", - zap.String("error", errMsg), - zap.String("action_id", resp.GetId()), - zap.String("action_name", resp.GetName()), - zap.Stringer("status", resp.GetStatus()), - ) - return c.helpers.FinishTask(ctx, resp, nil, fmt.Errorf("%s", errMsg)) - } - l.Debug("ActionInvoke response", zap.Any("resp", resp)) // Check if the action itself failed and propagate the error diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go index 939bb8f2..4aec02f7 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/types/resource/security_insight_trait.go @@ -93,6 +93,18 @@ func WithInsightExternalResourceTarget(externalId string, appHint string) Securi } } +// WithInsightAppUserTarget sets the app user target for the insight. +// Use this when the insight should be resolved to an AppUser by email and external ID. +func WithInsightAppUserTarget(email string, externalId string) SecurityInsightTraitOption { + return func(t *v2.SecurityInsightTrait) error { + t.SetAppUser(v2.SecurityInsightTrait_AppUserTarget_builder{ + Email: email, + ExternalId: externalId, + }.Build()) + return nil + } +} + // NewSecurityInsightTrait creates a new SecurityInsightTrait with the given options. // You must provide either WithRiskScore or WithIssue to set the insight type. // @@ -291,6 +303,11 @@ func IsExternalResourceTarget(trait *v2.SecurityInsightTrait) bool { return trait.GetExternalResource() != nil } +// IsAppUserTarget returns true if the insight targets an app user. +func IsAppUserTarget(trait *v2.SecurityInsightTrait) bool { + return trait.GetAppUser() != nil +} + // --- Target data extractors --- // GetUserTargetEmail returns the user email from a SecurityInsightTrait, or empty string if not a user target. @@ -321,3 +338,19 @@ func GetExternalResourceTargetAppHint(trait *v2.SecurityInsightTrait) string { } return "" } + +// GetAppUserTargetEmail returns the email from a SecurityInsightTrait, or empty string if not an app user target. +func GetAppUserTargetEmail(trait *v2.SecurityInsightTrait) string { + if appUser := trait.GetAppUser(); appUser != nil { + return appUser.GetEmail() + } + return "" +} + +// GetAppUserTargetExternalId returns the external ID from a SecurityInsightTrait, or empty string if not an app user target. +func GetAppUserTargetExternalId(trait *v2.SecurityInsightTrait) string { + if appUser := trait.GetAppUser(); appUser != nil { + return appUser.GetExternalId() + } + return "" +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 3908fb9d..ba42c1d4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -159,7 +159,7 @@ github.com/benbjohnson/clock # github.com/cenkalti/backoff/v4 v4.3.0 ## explicit; go 1.18 github.com/cenkalti/backoff/v4 -# github.com/conductorone/baton-sdk v0.7.4 +# github.com/conductorone/baton-sdk v0.7.10 ## explicit; go 1.25.2 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 @@ -188,6 +188,7 @@ github.com/conductorone/baton-sdk/pkg/dotc1z/manager github.com/conductorone/baton-sdk/pkg/dotc1z/manager/local github.com/conductorone/baton-sdk/pkg/dotc1z/manager/s3 github.com/conductorone/baton-sdk/pkg/field +github.com/conductorone/baton-sdk/pkg/healthcheck github.com/conductorone/baton-sdk/pkg/lambda/grpc github.com/conductorone/baton-sdk/pkg/lambda/grpc/config github.com/conductorone/baton-sdk/pkg/lambda/grpc/middleware From 399f024318c281a9f2a053545d1ecfe0cac6a27e Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Fri, 30 Jan 2026 10:14:02 +0530 Subject: [PATCH 11/22] handle create of teams and repos only --- pkg/connector/repository.go | 410 ------------------------------------ pkg/connector/team.go | 300 -------------------------- 2 files changed, 710 deletions(-) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index 88d4ae64..d47267d8 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -443,12 +443,6 @@ func (o *repositoryResourceType) ResourceActions(ctx context.Context, registry a if err := o.registerCreateRepositoryAction(ctx, registry); err != nil { return err } - if err := o.registerUpdateRepositoryAction(ctx, registry); err != nil { - return err - } - if err := o.registerDeleteRepositoryAction(ctx, registry); err != nil { - return err - } return nil } @@ -625,173 +619,6 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont }, o.handleCreateRepositoryAction) } -func (o *repositoryResourceType) registerDeleteRepositoryAction(ctx context.Context, registry actions.ActionRegistry) error { - return registry.Register(ctx, &v2.BatonActionSchema{ - Name: "delete", - DisplayName: "Delete Repository", - Description: "Delete a repository from a GitHub organization", - ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_DELETE}, - Arguments: []*config.Field{ - { - Name: "resource", - DisplayName: "Repository Resource", - Description: "The repository resource to delete", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, - }, - { - Name: "parent", - DisplayName: "Parent Organization", - Description: "The organization the repository belongs to", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, - }, - }, - ReturnTypes: []*config.Field{ - {Name: "success", Field: &config.Field_BoolField{}}, - }, - }, o.handleDeleteRepositoryAction) -} - -func (o *repositoryResourceType) registerUpdateRepositoryAction(ctx context.Context, registry actions.ActionRegistry) error { - return registry.Register(ctx, &v2.BatonActionSchema{ - Name: "update", - DisplayName: "Update Repository", - Description: "Update an existing repository in a GitHub organization", - ActionType: []v2.ActionType{}, - Arguments: []*config.Field{ - { - Name: "resource", - DisplayName: "Repository Resource", - Description: "The repository resource to update", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, - }, - { - Name: "parent", - DisplayName: "Parent Organization", - Description: "The organization the repository belongs to", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, - }, - { - Name: "name", - DisplayName: "Repository Name", - Description: "The new name of the repository (leave empty to keep current)", - Field: &config.Field_StringField{}, - }, - { - Name: "description", - DisplayName: "Description", - Description: "A description of the repository", - Field: &config.Field_StringField{}, - }, - { - Name: "homepage", - DisplayName: "Homepage", - Description: "A URL with more information about the repository", - Field: &config.Field_StringField{}, - }, - { - Name: "private", - DisplayName: "Private", - Description: "Whether the repository should be private (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "visibility", - DisplayName: "Visibility", - Description: "The visibility level of the repository", - Field: &config.Field_StringField{ - StringField: &config.StringField{ - Options: []*config.StringFieldOption{ - {Value: "public", DisplayName: "Public"}, - {Value: "private", DisplayName: "Private"}, - {Value: "internal", DisplayName: "Internal (Enterprise only)"}, - }, - }, - }, - }, - { - Name: "has_issues", - DisplayName: "Has Issues", - Description: "Enable issues for this repository (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "has_projects", - DisplayName: "Has Projects", - Description: "Enable projects for this repository (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "has_wiki", - DisplayName: "Has Wiki", - Description: "Enable wiki for this repository (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "has_discussions", - DisplayName: "Has Discussions", - Description: "Enable discussions for this repository (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "default_branch", - DisplayName: "Default Branch", - Description: "The default branch of the repository", - Field: &config.Field_StringField{}, - }, - { - Name: "allow_squash_merge", - DisplayName: "Allow Squash Merge", - Description: "Allow squash-merging pull requests (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "allow_merge_commit", - DisplayName: "Allow Merge Commit", - Description: "Allow merging pull requests with a merge commit (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "allow_rebase_merge", - DisplayName: "Allow Rebase Merge", - Description: "Allow rebase-merging pull requests (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "allow_auto_merge", - DisplayName: "Allow Auto Merge", - Description: "Allow auto-merge on pull requests (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "delete_branch_on_merge", - DisplayName: "Delete Branch on Merge", - Description: "Automatically delete head branches after pull requests are merged (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "archived", - DisplayName: "Archived", - Description: "Archive the repository (true/false). Note: You cannot unarchive repositories through the API", - Field: &config.Field_BoolField{}, - }, - { - Name: "is_template", - DisplayName: "Is Template", - Description: "Make this repository available as a template (true/false)", - Field: &config.Field_BoolField{}, - }, - }, - ReturnTypes: []*config.Field{ - {Name: "success", Field: &config.Field_BoolField{}}, - {Name: "resource", Field: &config.Field_ResourceField{}}, - }, - }, o.handleUpdateRepositoryAction) -} - func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { l := ctxzap.Extract(ctx) @@ -925,240 +752,3 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex return actions.NewReturnValues(true, resourceRv), annos, nil } - -func (o *repositoryResourceType) handleDeleteRepositoryAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { - l := ctxzap.Extract(ctx) - - // Extract the repository resource ID using SDK helper - resourceID, err := actions.RequireResourceIDArg(args, "resource") - if err != nil { - return nil, nil, err - } - - // Extract the parent org resource ID using SDK helper - parentResourceID, err := actions.RequireResourceIDArg(args, "parent") - if err != nil { - return nil, nil, err - } - - // Parse the repo ID from the resource - repoID, err := strconv.ParseInt(resourceID.Resource, 10, 64) - if err != nil { - return nil, nil, fmt.Errorf("invalid repository ID %s: %w", resourceID.Resource, err) - } - - // Get the organization name from the parent resource ID - orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) - if err != nil { - return nil, nil, fmt.Errorf("failed to get organization name: %w", err) - } - - // First, get the repository to find its name (needed for deletion) - repo, resp, err := o.client.Repositories.GetByID(ctx, repoID) - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get repository %d", repoID)) - } - - repoName := repo.GetName() - - l.Info("github-connector: deleting repository via action", - zap.Int64("repo_id", repoID), - zap.String("repo_name", repoName), - zap.String("org_name", orgName), - ) - - // Delete the repository via GitHub API - resp, err = o.client.Repositories.Delete(ctx, orgName, repoName) - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to delete repository %s in org %s", repoName, orgName)) - } - - var annos annotations.Annotations - if rateLimitData, err := extractRateLimitData(resp); err == nil { - annos.WithRateLimiting(rateLimitData) - } - - l.Info("github-connector: repository deleted successfully via action", - zap.Int64("repo_id", repoID), - zap.String("repo_name", repoName), - zap.String("org_name", orgName), - ) - - return actions.NewReturnValues(true), annos, nil -} - -func (o *repositoryResourceType) handleUpdateRepositoryAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { - l := ctxzap.Extract(ctx) - - // Extract the repository resource ID using SDK helper - resourceID, err := actions.RequireResourceIDArg(args, "resource") - if err != nil { - return nil, nil, err - } - - // Extract the parent org resource ID using SDK helper - parentResourceID, err := actions.RequireResourceIDArg(args, "parent") - if err != nil { - return nil, nil, err - } - - // Parse the repo ID from the resource - repoID, err := strconv.ParseInt(resourceID.Resource, 10, 64) - if err != nil { - return nil, nil, fmt.Errorf("invalid repository ID %s: %w", resourceID.Resource, err) - } - - // Get the organization name from the parent resource ID - orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) - if err != nil { - return nil, nil, fmt.Errorf("failed to get organization name: %w", err) - } - - // First, get the current repository to find its name - repo, resp, err := o.client.Repositories.GetByID(ctx, repoID) - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get repository %d", repoID)) - } - - currentRepoName := repo.GetName() - - l.Info("github-connector: updating repository via action", - zap.Int64("repo_id", repoID), - zap.String("repo_name", currentRepoName), - zap.String("org_name", orgName), - ) - - // Build the Repository update request - updateRepo := &github.Repository{} - - // Track if any updates were provided - hasUpdates := false - - // Extract optional fields using SDK helpers - if name, ok := actions.GetStringArg(args, "name"); ok && name != "" { - updateRepo.Name = github.Ptr(name) - hasUpdates = true - } - - if description, ok := actions.GetStringArg(args, "description"); ok { - updateRepo.Description = github.Ptr(description) - hasUpdates = true - } - - if homepage, ok := actions.GetStringArg(args, "homepage"); ok { - updateRepo.Homepage = github.Ptr(homepage) - hasUpdates = true - } - - if private, ok := actions.GetBoolArg(args, "private"); ok { - updateRepo.Private = github.Ptr(private) - hasUpdates = true - } - - if visibility, ok := actions.GetStringArg(args, "visibility"); ok && visibility != "" { - if visibility == "public" || visibility == "private" || visibility == "internal" { - updateRepo.Visibility = github.Ptr(visibility) - hasUpdates = true - } else { - l.Warn("github-connector: invalid visibility value, ignoring", - zap.String("provided_visibility", visibility), - ) - } - } - - if hasIssues, ok := actions.GetBoolArg(args, "has_issues"); ok { - updateRepo.HasIssues = github.Ptr(hasIssues) - hasUpdates = true - } - - if hasProjects, ok := actions.GetBoolArg(args, "has_projects"); ok { - updateRepo.HasProjects = github.Ptr(hasProjects) - hasUpdates = true - } - - if hasWiki, ok := actions.GetBoolArg(args, "has_wiki"); ok { - updateRepo.HasWiki = github.Ptr(hasWiki) - hasUpdates = true - } - - if hasDiscussions, ok := actions.GetBoolArg(args, "has_discussions"); ok { - updateRepo.HasDiscussions = github.Ptr(hasDiscussions) - hasUpdates = true - } - - if defaultBranch, ok := actions.GetStringArg(args, "default_branch"); ok && defaultBranch != "" { - updateRepo.DefaultBranch = github.Ptr(defaultBranch) - hasUpdates = true - } - - if allowSquashMerge, ok := actions.GetBoolArg(args, "allow_squash_merge"); ok { - updateRepo.AllowSquashMerge = github.Ptr(allowSquashMerge) - hasUpdates = true - } - - if allowMergeCommit, ok := actions.GetBoolArg(args, "allow_merge_commit"); ok { - updateRepo.AllowMergeCommit = github.Ptr(allowMergeCommit) - hasUpdates = true - } - - if allowRebaseMerge, ok := actions.GetBoolArg(args, "allow_rebase_merge"); ok { - updateRepo.AllowRebaseMerge = github.Ptr(allowRebaseMerge) - hasUpdates = true - } - - if allowAutoMerge, ok := actions.GetBoolArg(args, "allow_auto_merge"); ok { - updateRepo.AllowAutoMerge = github.Ptr(allowAutoMerge) - hasUpdates = true - } - - if deleteBranchOnMerge, ok := actions.GetBoolArg(args, "delete_branch_on_merge"); ok { - updateRepo.DeleteBranchOnMerge = github.Ptr(deleteBranchOnMerge) - hasUpdates = true - } - - if archived, ok := actions.GetBoolArg(args, "archived"); ok { - updateRepo.Archived = github.Ptr(archived) - hasUpdates = true - } - - if isTemplate, ok := actions.GetBoolArg(args, "is_template"); ok { - updateRepo.IsTemplate = github.Ptr(isTemplate) - hasUpdates = true - } - - if !hasUpdates { - return nil, nil, fmt.Errorf("no update fields provided") - } - - // Update the repository via GitHub API - updatedRepo, resp, err := o.client.Repositories.Edit(ctx, orgName, currentRepoName, updateRepo) - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to update repository %s in org %s", currentRepoName, orgName)) - } - - // Extract rate limit data for annotations - var annos annotations.Annotations - if rateLimitData, err := extractRateLimitData(resp); err == nil { - annos.WithRateLimiting(rateLimitData) - } - - l.Info("github-connector: repository updated successfully via action", - zap.Int64("repo_id", updatedRepo.GetID()), - zap.String("repo_name", updatedRepo.GetName()), - zap.String("repo_full_name", updatedRepo.GetFullName()), - ) - - // Create the resource representation of the updated repository - repoResource, err := repositoryResource(ctx, updatedRepo, parentResourceID) - if err != nil { - return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) - } - - // Build return values using SDK helpers - resourceRv, err := actions.NewResourceReturnField("resource", repoResource) - if err != nil { - return nil, annos, err - } - - return actions.NewReturnValues(true, resourceRv), annos, nil -} diff --git a/pkg/connector/team.go b/pkg/connector/team.go index b1a5d6f1..2d54e9ba 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -375,12 +375,6 @@ func (o *teamResourceType) ResourceActions(ctx context.Context, registry actions if err := o.registerCreateTeamAction(ctx, registry); err != nil { return err } - if err := o.registerUpdateTeamAction(ctx, registry); err != nil { - return err - } - if err := o.registerDeleteTeamAction(ctx, registry); err != nil { - return err - } return nil } @@ -484,101 +478,6 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr }, o.handleCreateTeamAction) } -func (o *teamResourceType) registerDeleteTeamAction(ctx context.Context, registry actions.ActionRegistry) error { - return registry.Register(ctx, &v2.BatonActionSchema{ - Name: "delete", - DisplayName: "Delete Team", - Description: "Delete a team from a GitHub organization", - ActionType: []v2.ActionType{v2.ActionType_ACTION_TYPE_RESOURCE_DELETE}, - Arguments: []*config.Field{ - { - Name: "resource", - DisplayName: "Team Resource", - Description: "The team resource to delete", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, - }, - { - Name: "parent", - DisplayName: "Parent Organization", - Description: "The organization the team belongs to", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, - }, - }, - ReturnTypes: []*config.Field{ - {Name: "success", Field: &config.Field_BoolField{}}, - }, - }, o.handleDeleteTeamAction) -} - -func (o *teamResourceType) registerUpdateTeamAction(ctx context.Context, registry actions.ActionRegistry) error { - return registry.Register(ctx, &v2.BatonActionSchema{ - Name: "update", - DisplayName: "Update Team", - Description: "Update an existing team in a GitHub organization", - ActionType: []v2.ActionType{}, - Arguments: []*config.Field{ - { - Name: "resource", - DisplayName: "Team Resource", - Description: "The team resource to update", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, - }, - { - Name: "parent", - DisplayName: "Parent Organization", - Description: "The organization the team belongs to", - Field: &config.Field_ResourceIdField{}, - IsRequired: true, - }, - { - Name: "name", - DisplayName: "Team Name", - Description: "The new name of the team (leave empty to keep current)", - Field: &config.Field_StringField{}, - }, - { - Name: "description", - DisplayName: "Description", - Description: "A description of the team", - Field: &config.Field_StringField{}, - }, - { - Name: "privacy", - DisplayName: "Privacy", - Description: "The privacy level of the team", - Field: &config.Field_StringField{ - StringField: &config.StringField{ - Options: []*config.StringFieldOption{ - {Value: "secret", DisplayName: "Secret (only visible to org owners and team members)"}, - {Value: "closed", DisplayName: "Closed (visible to all org members)"}, - }, - }, - }, - }, - { - Name: "notification_setting", - DisplayName: "Notification Setting", - Description: "The notification setting for the team", - Field: &config.Field_StringField{ - StringField: &config.StringField{ - Options: []*config.StringFieldOption{ - {Value: "notifications_enabled", DisplayName: "Enabled"}, - {Value: "notifications_disabled", DisplayName: "Disabled"}, - }, - }, - }, - }, - }, - ReturnTypes: []*config.Field{ - {Name: "success", Field: &config.Field_BoolField{}}, - {Name: "resource", Field: &config.Field_ResourceField{}}, - }, - }, o.handleUpdateTeamAction) -} - func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { l := ctxzap.Extract(ctx) @@ -720,205 +619,6 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str return actions.NewReturnValues(true, resourceRv), annos, nil } -func (o *teamResourceType) handleDeleteTeamAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { - l := ctxzap.Extract(ctx) - - // Extract the team resource ID using SDK helper - resourceID, err := actions.RequireResourceIDArg(args, "resource") - if err != nil { - return nil, nil, err - } - - // Extract the parent org resource ID using SDK helper - parentResourceID, err := actions.RequireResourceIDArg(args, "parent") - if err != nil { - return nil, nil, err - } - - // Parse the team ID from the resource - teamID, err := strconv.ParseInt(resourceID.Resource, 10, 64) - if err != nil { - return nil, nil, fmt.Errorf("invalid team ID %s: %w", resourceID.Resource, err) - } - - // Parse the org ID from the parent resource - orgID, err := strconv.ParseInt(parentResourceID.Resource, 10, 64) - if err != nil { - return nil, nil, fmt.Errorf("invalid org ID %s: %w", parentResourceID.Resource, err) - } - - // Get the organization name from the cache - orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) - if err != nil { - return nil, nil, fmt.Errorf("failed to get organization name: %w", err) - } - - // Get the team to find its slug - team, resp, err := o.client.Teams.GetTeamByID(ctx, orgID, teamID) //nolint:staticcheck // TODO: migrate to GetTeamBySlug - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get team %d", teamID)) - } - - teamSlug := team.GetSlug() - - l.Info("github-connector: deleting team via action", - zap.Int64("team_id", teamID), - zap.String("team_slug", teamSlug), - zap.String("org_name", orgName), - ) - - // Delete the team using slug - resp, err = o.client.Teams.DeleteTeamBySlug(ctx, orgName, teamSlug) - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to delete team %s in org %s", teamSlug, orgName)) - } - - var annos annotations.Annotations - if rateLimitData, err := extractRateLimitData(resp); err == nil { - annos.WithRateLimiting(rateLimitData) - } - - l.Info("github-connector: team deleted successfully via action", - zap.Int64("team_id", teamID), - zap.String("team_slug", teamSlug), - zap.String("org_name", orgName), - ) - - return actions.NewReturnValues(true), annos, nil -} - -func (o *teamResourceType) handleUpdateTeamAction(ctx context.Context, args *structpb.Struct) (*structpb.Struct, annotations.Annotations, error) { - l := ctxzap.Extract(ctx) - - // Extract the team resource ID using SDK helper - resourceID, err := actions.RequireResourceIDArg(args, "resource") - if err != nil { - return nil, nil, err - } - - // Extract the parent org resource ID using SDK helper - parentResourceID, err := actions.RequireResourceIDArg(args, "parent") - if err != nil { - return nil, nil, err - } - - // Parse the team ID from the resource - teamID, err := strconv.ParseInt(resourceID.Resource, 10, 64) - if err != nil { - return nil, nil, fmt.Errorf("invalid team ID %s: %w", resourceID.Resource, err) - } - - // Parse the org ID from the parent resource - orgID, err := strconv.ParseInt(parentResourceID.Resource, 10, 64) - if err != nil { - return nil, nil, fmt.Errorf("invalid org ID %s: %w", parentResourceID.Resource, err) - } - - // Get the organization name from the cache - orgName, err := o.orgCache.GetOrgName(ctx, parentResourceID) - if err != nil { - return nil, nil, fmt.Errorf("failed to get organization name: %w", err) - } - - // Get the team to find its slug - team, resp, err := o.client.Teams.GetTeamByID(ctx, orgID, teamID) //nolint:staticcheck // TODO: migrate to GetTeamBySlug - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get team %d", teamID)) - } - - teamSlug := team.GetSlug() - - l.Info("github-connector: updating team via action", - zap.Int64("team_id", teamID), - zap.String("team_slug", teamSlug), - zap.String("org_name", orgName), - ) - - // Build the NewTeam update request - // Note: GitHub API uses NewTeam for both create and edit operations - updateTeam := github.NewTeam{} - - // Track if any updates were provided - hasUpdates := false - - // Extract optional fields using SDK helpers - if name, ok := actions.GetStringArg(args, "name"); ok && name != "" { - updateTeam.Name = name - hasUpdates = true - } - - if description, ok := actions.GetStringArg(args, "description"); ok { - updateTeam.Description = github.Ptr(description) - hasUpdates = true - } - - if privacy, ok := actions.GetStringArg(args, "privacy"); ok && privacy != "" { - if privacy == teamPrivacySecret || privacy == teamPrivacyClosed { - updateTeam.Privacy = github.Ptr(privacy) - hasUpdates = true - } else { - l.Warn("github-connector: invalid privacy value, ignoring", - zap.String("provided_privacy", privacy), - ) - } - } - - if notificationSetting, ok := actions.GetStringArg(args, "notification_setting"); ok && notificationSetting != "" { - if notificationSetting == "notifications_enabled" || notificationSetting == "notifications_disabled" { - updateTeam.NotificationSetting = github.Ptr(notificationSetting) - hasUpdates = true - } else { - l.Warn("github-connector: invalid notification_setting value, ignoring", - zap.String("provided_notification_setting", notificationSetting), - ) - } - } - - if parentTeamID, ok := actions.GetIntArg(args, "parent_team_id"); ok { - if parentTeamID > 0 { - updateTeam.ParentTeamID = github.Ptr(parentTeamID) - hasUpdates = true - } - // Note: Setting to 0 would remove the parent, but GitHub API requires omitting the field entirely - } - - if !hasUpdates { - return nil, nil, fmt.Errorf("no update fields provided") - } - - // Update the team via GitHub API using slug - updatedTeam, resp, err := o.client.Teams.EditTeamBySlug(ctx, orgName, teamSlug, updateTeam, false) - if err != nil { - return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to update team %s in org %s", teamSlug, orgName)) - } - - // Extract rate limit data for annotations - var annos annotations.Annotations - if rateLimitData, err := extractRateLimitData(resp); err == nil { - annos.WithRateLimiting(rateLimitData) - } - - l.Info("github-connector: team updated successfully via action", - zap.Int64("team_id", updatedTeam.GetID()), - zap.String("team_name", updatedTeam.GetName()), - zap.String("team_slug", updatedTeam.GetSlug()), - ) - - // Create the resource representation of the updated team - resource, err := teamResource(updatedTeam, parentResourceID) - if err != nil { - return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) - } - - // Build return values using SDK helpers - resourceRv, err := actions.NewResourceReturnField("resource", resource) - if err != nil { - return nil, annos, err - } - - return actions.NewReturnValues(true, resourceRv), annos, nil -} - func teamBuilder(client *github.Client, orgCache *orgNameCache) *teamResourceType { return &teamResourceType{ resourceType: resourceTypeTeam, From 8cfa12eb48fc4cc713a61d5f6bf8fa7155fff0d7 Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Fri, 30 Jan 2026 12:21:23 +0530 Subject: [PATCH 12/22] updates repo and team groups creation --- pkg/connector/repository.go | 237 ++++++++++++++++-------------------- pkg/connector/team.go | 83 ++++++++++--- 2 files changed, 172 insertions(+), 148 deletions(-) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index d47267d8..19c319d3 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -455,14 +455,20 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont Arguments: []*config.Field{ { Name: "name", - DisplayName: "Repository Name", + DisplayName: "Repository name", Description: "The name of the repository to create", Field: &config.Field_StringField{}, IsRequired: true, }, { - Name: "parent", - DisplayName: "Parent Organization", + Name: "description", + DisplayName: "Description", + Description: "A description of the repository", + Field: &config.Field_StringField{}, + }, + { + Name: "org", + DisplayName: "Organization", Description: "The organization to create the repository in", Field: &config.Field_ResourceIdField{ ResourceIdField: &config.ResourceIdField{ @@ -473,18 +479,6 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont }, IsRequired: true, }, - { - Name: "description", - DisplayName: "Description", - Description: "A description of the repository", - Field: &config.Field_StringField{}, - }, - { - Name: "private", - DisplayName: "Private", - Description: "Whether the repository should be private (true/false)", - Field: &config.Field_BoolField{}, - }, { Name: "visibility", DisplayName: "Visibility", @@ -492,42 +486,21 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont Field: &config.Field_StringField{ StringField: &config.StringField{ Options: []*config.StringFieldOption{ - {Value: "public", DisplayName: "Public"}, - {Value: "private", DisplayName: "Private"}, - {Value: "internal", DisplayName: "Internal (Enterprise only)"}, + {Value: "public", DisplayName: "Public", Name: "Anyone on the internet can view this repository"}, + {Value: "private", DisplayName: "Private", Name: "You can choose who can see this repository"}, }, }, }, }, { - Name: "has_issues", - DisplayName: "Has Issues", - Description: "Enable issues for this repository (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "has_projects", - DisplayName: "Has Projects", - Description: "Enable projects for this repository (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "has_wiki", - DisplayName: "Has Wiki", - Description: "Enable wiki for this repository (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "has_discussions", - DisplayName: "Has Discussions", - Description: "Enable discussions for this repository (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "auto_init", - DisplayName: "Auto Initialize", - Description: "Create an initial commit with empty README (true/false)", - Field: &config.Field_BoolField{}, + Name: "add_readme", + DisplayName: "Add README.md", + Description: "Add a README.md file to the repository", + Field: &config.Field_BoolField{ + BoolField: &config.BoolField{ + DefaultValue: true, + }, + }, }, { Name: "gitignore_template", @@ -536,7 +509,7 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont Field: &config.Field_StringField{ StringField: &config.StringField{ Options: []*config.StringFieldOption{ - {Value: "", DisplayName: "None"}, + {Value: "", DisplayName: "No .gitignore template"}, {Value: "Go", DisplayName: "Go"}, {Value: "Python", DisplayName: "Python"}, {Value: "Node", DisplayName: "Node"}, @@ -560,7 +533,7 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont Field: &config.Field_StringField{ StringField: &config.StringField{ Options: []*config.StringFieldOption{ - {Value: "", DisplayName: "None"}, + {Value: "", DisplayName: "No license"}, {Value: "mit", DisplayName: "MIT License"}, {Value: "apache-2.0", DisplayName: "Apache License 2.0"}, {Value: "gpl-3.0", DisplayName: "GNU GPLv3"}, @@ -575,42 +548,6 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont }, }, }, - { - Name: "allow_squash_merge", - DisplayName: "Allow Squash Merge", - Description: "Allow squash-merging pull requests (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "allow_merge_commit", - DisplayName: "Allow Merge Commit", - Description: "Allow merging pull requests with a merge commit (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "allow_rebase_merge", - DisplayName: "Allow Rebase Merge", - Description: "Allow rebase-merging pull requests (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "allow_auto_merge", - DisplayName: "Allow Auto Merge", - Description: "Allow auto-merge on pull requests (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "delete_branch_on_merge", - DisplayName: "Delete Branch on Merge", - Description: "Automatically delete head branches after pull requests are merged (true/false)", - Field: &config.Field_BoolField{}, - }, - { - Name: "is_template", - DisplayName: "Is Template", - Description: "Make this repository available as a template (true/false)", - Field: &config.Field_BoolField{}, - }, }, ReturnTypes: []*config.Field{ {Name: "success", Field: &config.Field_BoolField{}}, @@ -628,7 +565,7 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex return nil, nil, err } - parentResourceID, err := actions.RequireResourceIDArg(args, "parent") + parentResourceID, err := actions.RequireResourceIDArg(args, "org") if err != nil { return nil, nil, err } @@ -654,12 +591,8 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex newRepo.Description = github.Ptr(description) } - if private, ok := actions.GetBoolArg(args, "private"); ok { - newRepo.Private = github.Ptr(private) - } - if visibility, ok := actions.GetStringArg(args, "visibility"); ok && visibility != "" { - if visibility == "public" || visibility == "private" || visibility == "internal" { + if visibility == "public" || visibility == "private" { newRepo.Visibility = github.Ptr(visibility) } else { l.Warn("github-connector: invalid visibility value, using default", @@ -668,24 +601,9 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex } } - if hasIssues, ok := actions.GetBoolArg(args, "has_issues"); ok { - newRepo.HasIssues = github.Ptr(hasIssues) - } - - if hasProjects, ok := actions.GetBoolArg(args, "has_projects"); ok { - newRepo.HasProjects = github.Ptr(hasProjects) - } - - if hasWiki, ok := actions.GetBoolArg(args, "has_wiki"); ok { - newRepo.HasWiki = github.Ptr(hasWiki) - } - - if hasDiscussions, ok := actions.GetBoolArg(args, "has_discussions"); ok { - newRepo.HasDiscussions = github.Ptr(hasDiscussions) - } - - if autoInit, ok := actions.GetBoolArg(args, "auto_init"); ok { - newRepo.AutoInit = github.Ptr(autoInit) + // add_readme maps to AutoInit in GitHub API + if addReadme, ok := actions.GetBoolArg(args, "add_readme"); ok { + newRepo.AutoInit = github.Ptr(addReadme) } if gitignoreTemplate, ok := actions.GetStringArg(args, "gitignore_template"); ok && gitignoreTemplate != "" { @@ -696,30 +614,6 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex newRepo.LicenseTemplate = github.Ptr(licenseTemplate) } - if allowSquashMerge, ok := actions.GetBoolArg(args, "allow_squash_merge"); ok { - newRepo.AllowSquashMerge = github.Ptr(allowSquashMerge) - } - - if allowMergeCommit, ok := actions.GetBoolArg(args, "allow_merge_commit"); ok { - newRepo.AllowMergeCommit = github.Ptr(allowMergeCommit) - } - - if allowRebaseMerge, ok := actions.GetBoolArg(args, "allow_rebase_merge"); ok { - newRepo.AllowRebaseMerge = github.Ptr(allowRebaseMerge) - } - - if allowAutoMerge, ok := actions.GetBoolArg(args, "allow_auto_merge"); ok { - newRepo.AllowAutoMerge = github.Ptr(allowAutoMerge) - } - - if deleteBranchOnMerge, ok := actions.GetBoolArg(args, "delete_branch_on_merge"); ok { - newRepo.DeleteBranchOnMerge = github.Ptr(deleteBranchOnMerge) - } - - if isTemplate, ok := actions.GetBoolArg(args, "is_template"); ok { - newRepo.IsTemplate = github.Ptr(isTemplate) - } - // Create the repository via GitHub API createdRepo, resp, err := o.client.Repositories.Create(ctx, orgName, newRepo) if err != nil { @@ -744,11 +638,88 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) } + // Generate entitlements for the newly created repository + entitlements := make([]*v2.Entitlement, 0, len(repoAccessLevels)) + for _, level := range repoAccessLevels { + entitlements = append(entitlements, entitlement.NewPermissionEntitlement(repoResource, level, + entitlement.WithDisplayName(fmt.Sprintf("%s Repo %s", repoResource.DisplayName, titleCase(level))), + entitlement.WithDescription(fmt.Sprintf("Access to %s repository in GitHub", repoResource.DisplayName)), + entitlement.WithAnnotation(&v2.V1Identifier{ + Id: fmt.Sprintf("repo:%s:role:%s", repoResource.Id.Resource, level), + }), + entitlement.WithGrantableTo(resourceTypeUser, resourceTypeTeam), + )) + } + + // Fetch grants for the newly created repository by listing collaborators + var grants []*v2.Grant + + // List user collaborators + collabOpts := &github.ListCollaboratorsOptions{ + Affiliation: "all", + ListOptions: github.ListOptions{ + PerPage: maxPageSize, + }, + } + users, _, err := o.client.Repositories.ListCollaborators(ctx, orgName, createdRepo.GetName(), collabOpts) + if err != nil { + l.Warn("github-connector: failed to list collaborators for grants", zap.Error(err)) + } else { + for _, user := range users { + for permission, hasPermission := range user.Permissions { + if !hasPermission { + continue + } + ur, err := userResource(ctx, user, user.GetEmail(), nil) + if err != nil { + continue + } + g := grant.NewGrant(repoResource, permission, ur.Id, grant.WithAnnotation(&v2.V1Identifier{ + Id: fmt.Sprintf("repo-grant:%s:%d:%s", repoResource.Id.Resource, user.GetID(), permission), + })) + g.Principal = ur + grants = append(grants, g) + } + } + } + + // List team collaborators + teamOpts := &github.ListOptions{ + PerPage: maxPageSize, + } + teams, _, err := o.client.Repositories.ListTeams(ctx, orgName, createdRepo.GetName(), teamOpts) + if err != nil { + l.Warn("github-connector: failed to list teams for grants", zap.Error(err)) + } else { + for _, team := range teams { + permission := team.GetPermission() + tr, err := teamResource(team, parentResourceID) + if err != nil { + continue + } + g := grant.NewGrant(repoResource, permission, tr.Id, grant.WithAnnotation(&v2.V1Identifier{ + Id: fmt.Sprintf("repo-grant:%s:%d:%s", repoResource.Id.Resource, team.GetID(), permission), + })) + g.Principal = tr + grants = append(grants, g) + } + } + // Build return values using SDK helpers resourceRv, err := actions.NewResourceReturnField("resource", repoResource) if err != nil { return nil, annos, err } - return actions.NewReturnValues(true, resourceRv), annos, nil + entitlementsRv, err := actions.NewEntitlementListReturnField("entitlements", entitlements) + if err != nil { + return nil, annos, err + } + + grantsRv, err := actions.NewGrantListReturnField("grants", grants) + if err != nil { + return nil, annos, err + } + + return actions.NewReturnValues(true, resourceRv, entitlementsRv, grantsRv), annos, nil } diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 2d54e9ba..3c9e5130 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -387,21 +387,21 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr Arguments: []*config.Field{ { Name: "name", - DisplayName: "Team Name", - Description: "The name of the team.", + DisplayName: "Team name", + Description: "You’ll use this name to mention this team in conversations.", Field: &config.Field_StringField{}, IsRequired: true, }, { Name: "description", DisplayName: "Description", - Description: "The description of the team.", + Description: "What is this team all about?", Field: &config.Field_StringField{}, }, { Name: "org", DisplayName: "Organization", - Description: "The organization name. The name is not case sensitive.", + Description: "The organization name.", Field: &config.Field_ResourceIdField{ ResourceIdField: &config.ResourceIdField{ Rules: &config.ResourceIDRules{ @@ -413,8 +413,8 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr }, { Name: "parent", - DisplayName: "Parent Team ID", - Description: "The name of a team to set as the parent team.", + DisplayName: "Parent team", + Description: "The team to set as the parent team.", Field: &config.Field_ResourceIdField{ ResourceIdField: &config.ResourceIdField{ Rules: &config.ResourceIDRules{ @@ -426,20 +426,20 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr { Name: "privacy", DisplayName: "Privacy", - Description: "The privacy level of the team", + Description: "The level of privacy this team should have.", Field: &config.Field_StringField{ StringField: &config.StringField{ Options: []*config.StringFieldOption{ - {Value: "secret", DisplayName: "Secret (only visible to org owners and team members)"}, - {Value: "closed", DisplayName: "Closed (visible to all org members)"}, + {Value: "secret", Name: "Secret is only visible to org owners and team members", DisplayName: "Secret"}, + {Value: "closed", Name: "Closed is visible to all org members. When parent team is set, this is the only allowed privacy level.", DisplayName: "Closed"}, }, }, }, }, { Name: "notifications_enabled", - DisplayName: "Team Notifications", - Description: "Enable team notifications. When enabled, team members receive notifications when the team is @mentioned. Default: enabled", + DisplayName: "Team notifications", + Description: "When enabled, team members receive notifications when the team is @mentioned.", Field: &config.Field_BoolField{ BoolField: &config.BoolField{ DefaultValue: true, @@ -460,7 +460,7 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr }, { Name: "repo_names", - DisplayName: "Repository Names", + DisplayName: "Repository names", Description: "The full name (e.g., organization-name/repository-name) of repositories to add the team to.", Field: &config.Field_ResourceIdSliceField{ ResourceIdSliceField: &config.ResourceIdSliceField{ @@ -605,18 +605,71 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str ) // Create the resource representation of the newly created team - resource, err := teamResource(createdTeam, parentResourceID) + teamRes, err := teamResource(createdTeam, parentResourceID) if err != nil { return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) } + // Generate entitlements for the newly created team + entitlements := make([]*v2.Entitlement, 0, len(teamAccessLevels)) + for _, level := range teamAccessLevels { + entitlements = append(entitlements, entitlement.NewPermissionEntitlement(teamRes, level, + entitlement.WithAnnotation(&v2.V1Identifier{ + Id: fmt.Sprintf("team:%s:role:%s", teamRes.Id.Resource, level), + }), + entitlement.WithDisplayName(fmt.Sprintf("%s Team %s", teamRes.DisplayName, titleCase(level))), + entitlement.WithDescription(fmt.Sprintf("Access to %s team in GitHub", teamRes.DisplayName)), + entitlement.WithGrantableTo(resourceTypeUser), + )) + } + + // Fetch grants for the newly created team by listing members + var grants []*v2.Grant + for _, role := range teamAccessLevels { + opts := &github.TeamListTeamMembersOptions{ + Role: role, + ListOptions: github.ListOptions{ + PerPage: maxPageSize, + }, + } + members, _, err := o.client.Teams.ListTeamMembersByID(ctx, createdTeam.GetOrganization().GetID(), createdTeam.GetID(), opts) + if err != nil { + l.Warn("github-connector: failed to list team members for grants", + zap.Error(err), + zap.String("role", role), + ) + continue + } + for _, member := range members { + ur, err := userResource(ctx, member, member.GetEmail(), nil) + if err != nil { + continue + } + grants = append(grants, grant.NewGrant(teamRes, role, ur.Id, + grant.WithAnnotation(&v2.V1Identifier{ + Id: fmt.Sprintf("team-grant:%s:%d:%s", teamRes.Id.Resource, member.GetID(), role), + }), + )) + } + } + // Build return values using SDK helpers - resourceRv, err := actions.NewResourceReturnField("resource", resource) + resourceRv, err := actions.NewResourceReturnField("resource", teamRes) + if err != nil { + return nil, annos, err + } + + entitlementsRv, err := actions.NewEntitlementListReturnField("entitlements", entitlements) + if err != nil { + return nil, annos, err + } + + grantsRv, err := actions.NewGrantListReturnField("grants", grants) if err != nil { return nil, annos, err } - return actions.NewReturnValues(true, resourceRv), annos, nil + return actions.NewReturnValues(true, resourceRv, entitlementsRv, grantsRv), annos, nil } func teamBuilder(client *github.Client, orgCache *orgNameCache) *teamResourceType { From 148d7f6456f7636d6ff3ec6bdb4d06f0a611d715 Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Fri, 30 Jan 2026 12:29:11 +0530 Subject: [PATCH 13/22] lint fix --- pkg/connector/team.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 3c9e5130..1172e848 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -26,7 +26,6 @@ const ( teamRoleMember = "member" teamRoleMaintainer = "maintainer" - // Team privacy levels teamPrivacySecret = "secret" teamPrivacyClosed = "closed" ) From 000483178a40be6ad88242af5d7db10e27057344 Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Fri, 30 Jan 2026 13:52:09 +0530 Subject: [PATCH 14/22] improvements --- pkg/connector/repository.go | 36 +++++++++++++++++++++++++++--------- pkg/connector/team.go | 7 +++++++ 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index 19c319d3..55586443 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -489,6 +489,7 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont {Value: "public", DisplayName: "Public", Name: "Anyone on the internet can view this repository"}, {Value: "private", DisplayName: "Private", Name: "You can choose who can see this repository"}, }, + DefaultValue: "private", }, }, }, @@ -552,6 +553,12 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont ReturnTypes: []*config.Field{ {Name: "success", Field: &config.Field_BoolField{}}, {Name: "resource", Field: &config.Field_ResourceField{}}, + {Name: "entitlements", DisplayName: "Entitlements", Field: &config.Field_EntitlementSliceField{ + EntitlementSliceField: &config.EntitlementSliceField{}, + }}, + {Name: "grants", DisplayName: "Grants", Field: &config.Field_GrantSliceField{ + GrantSliceField: &config.GrantSliceField{}, + }}, }, }, o.handleCreateRepositoryAction) } @@ -692,16 +699,27 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex l.Warn("github-connector: failed to list teams for grants", zap.Error(err)) } else { for _, team := range teams { - permission := team.GetPermission() - tr, err := teamResource(team, parentResourceID) - if err != nil { - continue + for permission, hasPermission := range team.Permissions { + if !hasPermission { + continue + } + tr, err := teamResource(team, parentResourceID) + if err != nil { + continue + } + grants = append(grants, grant.NewGrant(repoResource, permission, tr.Id, grant.WithAnnotation( + &v2.V1Identifier{ + Id: fmt.Sprintf("repo-grant:%s:%d:%s", repoResource.Id.Resource, team.GetID(), permission), + }, + &v2.GrantExpandable{ + EntitlementIds: []string{ + entitlement.NewEntitlementID(tr, teamRoleMaintainer), + entitlement.NewEntitlementID(tr, teamRoleMember), + }, + Shallow: true, + }, + ))) } - g := grant.NewGrant(repoResource, permission, tr.Id, grant.WithAnnotation(&v2.V1Identifier{ - Id: fmt.Sprintf("repo-grant:%s:%d:%s", repoResource.Id.Resource, team.GetID(), permission), - })) - g.Principal = tr - grants = append(grants, g) } } diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 1172e848..caf5acb2 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -432,6 +432,7 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr {Value: "secret", Name: "Secret is only visible to org owners and team members", DisplayName: "Secret"}, {Value: "closed", Name: "Closed is visible to all org members. When parent team is set, this is the only allowed privacy level.", DisplayName: "Closed"}, }, + DefaultValue: "closed", }, }, }, @@ -473,6 +474,12 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr ReturnTypes: []*config.Field{ {Name: "success", Field: &config.Field_BoolField{}}, {Name: "resource", Field: &config.Field_ResourceField{}}, + {Name: "entitlements", DisplayName: "Entitlements", Field: &config.Field_EntitlementSliceField{ + EntitlementSliceField: &config.EntitlementSliceField{}, + }}, + {Name: "grants", DisplayName: "Grants", Field: &config.Field_GrantSliceField{ + GrantSliceField: &config.GrantSliceField{}, + }}, }, }, o.handleCreateTeamAction) } From cdc4acbab73e2a8d60c9fea7f5c67662ede24f33 Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Fri, 30 Jan 2026 14:15:47 +0530 Subject: [PATCH 15/22] refactor --- pkg/connector/repository.go | 15 ++++----------- pkg/connector/team.go | 15 ++++----------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index 55586443..807538d5 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -645,17 +645,10 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) } - // Generate entitlements for the newly created repository - entitlements := make([]*v2.Entitlement, 0, len(repoAccessLevels)) - for _, level := range repoAccessLevels { - entitlements = append(entitlements, entitlement.NewPermissionEntitlement(repoResource, level, - entitlement.WithDisplayName(fmt.Sprintf("%s Repo %s", repoResource.DisplayName, titleCase(level))), - entitlement.WithDescription(fmt.Sprintf("Access to %s repository in GitHub", repoResource.DisplayName)), - entitlement.WithAnnotation(&v2.V1Identifier{ - Id: fmt.Sprintf("repo:%s:role:%s", repoResource.Id.Resource, level), - }), - entitlement.WithGrantableTo(resourceTypeUser, resourceTypeTeam), - )) + // Generate entitlements for the newly created repository (reuse existing method) + entitlements, _, _, err := o.Entitlements(ctx, repoResource, nil) + if err != nil { + return nil, annos, fmt.Errorf("failed to generate entitlements: %w", err) } // Fetch grants for the newly created repository by listing collaborators diff --git a/pkg/connector/team.go b/pkg/connector/team.go index caf5acb2..02b01900 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -616,17 +616,10 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str return nil, annos, fmt.Errorf("failed to create resource representation: %w", err) } - // Generate entitlements for the newly created team - entitlements := make([]*v2.Entitlement, 0, len(teamAccessLevels)) - for _, level := range teamAccessLevels { - entitlements = append(entitlements, entitlement.NewPermissionEntitlement(teamRes, level, - entitlement.WithAnnotation(&v2.V1Identifier{ - Id: fmt.Sprintf("team:%s:role:%s", teamRes.Id.Resource, level), - }), - entitlement.WithDisplayName(fmt.Sprintf("%s Team %s", teamRes.DisplayName, titleCase(level))), - entitlement.WithDescription(fmt.Sprintf("Access to %s team in GitHub", teamRes.DisplayName)), - entitlement.WithGrantableTo(resourceTypeUser), - )) + // Generate entitlements for the newly created team (reuse existing method) + entitlements, _, _, err := o.Entitlements(ctx, teamRes, nil) + if err != nil { + return nil, annos, fmt.Errorf("failed to generate entitlements: %w", err) } // Fetch grants for the newly created team by listing members From 18b499b2f7f5277b27315e17194b24384d2e9028 Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Fri, 30 Jan 2026 15:07:45 +0530 Subject: [PATCH 16/22] grants refactor --- pkg/connector/repository.go | 76 +++++++------------------------------ pkg/connector/team.go | 35 ++++++----------- 2 files changed, 24 insertions(+), 87 deletions(-) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index 807538d5..a821a1a8 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -602,9 +602,7 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex if visibility == "public" || visibility == "private" { newRepo.Visibility = github.Ptr(visibility) } else { - l.Warn("github-connector: invalid visibility value, using default", - zap.String("provided_visibility", visibility), - ) + return nil, nil, fmt.Errorf("invalid visibility: %q (must be \"public\" or \"private\")", visibility) } } @@ -651,69 +649,21 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex return nil, annos, fmt.Errorf("failed to generate entitlements: %w", err) } - // Fetch grants for the newly created repository by listing collaborators + // Fetch grants for the newly created repository by reusing the existing Grants method var grants []*v2.Grant - - // List user collaborators - collabOpts := &github.ListCollaboratorsOptions{ - Affiliation: "all", - ListOptions: github.ListOptions{ - PerPage: maxPageSize, - }, - } - users, _, err := o.client.Repositories.ListCollaborators(ctx, orgName, createdRepo.GetName(), collabOpts) - if err != nil { - l.Warn("github-connector: failed to list collaborators for grants", zap.Error(err)) - } else { - for _, user := range users { - for permission, hasPermission := range user.Permissions { - if !hasPermission { - continue - } - ur, err := userResource(ctx, user, user.GetEmail(), nil) - if err != nil { - continue - } - g := grant.NewGrant(repoResource, permission, ur.Id, grant.WithAnnotation(&v2.V1Identifier{ - Id: fmt.Sprintf("repo-grant:%s:%d:%s", repoResource.Id.Resource, user.GetID(), permission), - })) - g.Principal = ur - grants = append(grants, g) - } + pageToken := "" + for { + pToken := &pagination.Token{Token: pageToken} + pageGrants, nextToken, _, err := o.Grants(ctx, repoResource, pToken) + if err != nil { + l.Warn("github-connector: failed to fetch grants for repository", zap.Error(err)) + break } - } - - // List team collaborators - teamOpts := &github.ListOptions{ - PerPage: maxPageSize, - } - teams, _, err := o.client.Repositories.ListTeams(ctx, orgName, createdRepo.GetName(), teamOpts) - if err != nil { - l.Warn("github-connector: failed to list teams for grants", zap.Error(err)) - } else { - for _, team := range teams { - for permission, hasPermission := range team.Permissions { - if !hasPermission { - continue - } - tr, err := teamResource(team, parentResourceID) - if err != nil { - continue - } - grants = append(grants, grant.NewGrant(repoResource, permission, tr.Id, grant.WithAnnotation( - &v2.V1Identifier{ - Id: fmt.Sprintf("repo-grant:%s:%d:%s", repoResource.Id.Resource, team.GetID(), permission), - }, - &v2.GrantExpandable{ - EntitlementIds: []string{ - entitlement.NewEntitlementID(tr, teamRoleMaintainer), - entitlement.NewEntitlementID(tr, teamRoleMember), - }, - Shallow: true, - }, - ))) - } + grants = append(grants, pageGrants...) + if nextToken == "" { + break } + pageToken = nextToken } // Build return values using SDK helpers diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 02b01900..9c1f213a 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -622,34 +622,21 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str return nil, annos, fmt.Errorf("failed to generate entitlements: %w", err) } - // Fetch grants for the newly created team by listing members + // Fetch grants for the newly created team by reusing the existing Grants method var grants []*v2.Grant - for _, role := range teamAccessLevels { - opts := &github.TeamListTeamMembersOptions{ - Role: role, - ListOptions: github.ListOptions{ - PerPage: maxPageSize, - }, - } - members, _, err := o.client.Teams.ListTeamMembersByID(ctx, createdTeam.GetOrganization().GetID(), createdTeam.GetID(), opts) + pageToken := "" + for { + pToken := &pagination.Token{Token: pageToken} + pageGrants, nextToken, _, err := o.Grants(ctx, teamRes, pToken) if err != nil { - l.Warn("github-connector: failed to list team members for grants", - zap.Error(err), - zap.String("role", role), - ) - continue + l.Warn("github-connector: failed to fetch grants for team", zap.Error(err)) + break } - for _, member := range members { - ur, err := userResource(ctx, member, member.GetEmail(), nil) - if err != nil { - continue - } - grants = append(grants, grant.NewGrant(teamRes, role, ur.Id, - grant.WithAnnotation(&v2.V1Identifier{ - Id: fmt.Sprintf("team-grant:%s:%d:%s", teamRes.Id.Resource, member.GetID(), role), - }), - )) + grants = append(grants, pageGrants...) + if nextToken == "" { + break } + pageToken = nextToken } // Build return values using SDK helpers From 8878f96f78987ee42854611c192b23f6f93765ba Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Tue, 3 Feb 2026 23:27:58 +0530 Subject: [PATCH 17/22] more improvements --- pkg/connector/repository.go | 21 +++++++++++++++++---- pkg/connector/team.go | 26 ++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/pkg/connector/repository.go b/pkg/connector/repository.go index a821a1a8..8f23b7be 100644 --- a/pkg/connector/repository.go +++ b/pkg/connector/repository.go @@ -488,6 +488,7 @@ func (o *repositoryResourceType) registerCreateRepositoryAction(ctx context.Cont Options: []*config.StringFieldOption{ {Value: "public", DisplayName: "Public", Name: "Anyone on the internet can view this repository"}, {Value: "private", DisplayName: "Private", Name: "You can choose who can see this repository"}, + {Value: "internal", DisplayName: "Internal", Name: "Members of the enterprise can view this repository (enterprise only)"}, }, DefaultValue: "private", }, @@ -599,23 +600,35 @@ func (o *repositoryResourceType) handleCreateRepositoryAction(ctx context.Contex } if visibility, ok := actions.GetStringArg(args, "visibility"); ok && visibility != "" { - if visibility == "public" || visibility == "private" { + if visibility == "public" || visibility == "private" || visibility == "internal" { newRepo.Visibility = github.Ptr(visibility) } else { - return nil, nil, fmt.Errorf("invalid visibility: %q (must be \"public\" or \"private\")", visibility) + return nil, nil, fmt.Errorf("invalid visibility: %q (must be \"public\", \"private\", or \"internal\")", visibility) } } + // Extract template options first to validate AutoInit requirements + gitignoreTemplate, hasGitignore := actions.GetStringArg(args, "gitignore_template") + licenseTemplate, hasLicense := actions.GetStringArg(args, "license_template") + hasTemplates := (hasGitignore && gitignoreTemplate != "") || (hasLicense && licenseTemplate != "") + // add_readme maps to AutoInit in GitHub API + // GitHub requires AutoInit=true when using gitignore_template or license_template if addReadme, ok := actions.GetBoolArg(args, "add_readme"); ok { + if !addReadme && hasTemplates { + return nil, nil, fmt.Errorf("add_readme must be true when gitignore_template or license_template is provided (GitHub requires auto_init=true for templates)") + } newRepo.AutoInit = github.Ptr(addReadme) + } else if hasTemplates { + // If templates are provided but add_readme wasn't explicitly set, enable AutoInit + newRepo.AutoInit = github.Ptr(true) } - if gitignoreTemplate, ok := actions.GetStringArg(args, "gitignore_template"); ok && gitignoreTemplate != "" { + if hasGitignore && gitignoreTemplate != "" { newRepo.GitignoreTemplate = github.Ptr(gitignoreTemplate) } - if licenseTemplate, ok := actions.GetStringArg(args, "license_template"); ok && licenseTemplate != "" { + if hasLicense && licenseTemplate != "" { newRepo.LicenseTemplate = github.Ptr(licenseTemplate) } diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 9c1f213a..7836aca2 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -448,8 +448,8 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr }, { Name: "maintainers", - DisplayName: "Maintainers", - Description: "List GitHub usernames for organization members who will become team maintainers.", + DisplayName: "Team Maintainers", + Description: "List of user resource IDs for organization members who will become team maintainers.", Field: &config.Field_ResourceIdSliceField{ ResourceIdSliceField: &config.ResourceIdSliceField{ Rules: &config.RepeatedResourceIdRules{ @@ -460,8 +460,8 @@ func (o *teamResourceType) registerCreateTeamAction(ctx context.Context, registr }, { Name: "repo_names", - DisplayName: "Repository names", - Description: "The full name (e.g., organization-name/repository-name) of repositories to add the team to.", + DisplayName: "Repositories", + Description: "List of repository resource IDs to add the team to.", Field: &config.Field_ResourceIdSliceField{ ResourceIdSliceField: &config.ResourceIdSliceField{ Rules: &config.RepeatedResourceIdRules{ @@ -526,6 +526,21 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str if err != nil { return nil, nil, fmt.Errorf("invalid parent team ID: %w", err) } + + // Fetch the parent team to validate it's not a secret team + // GitHub does not allow child teams under secret parent teams + org, resp, err := o.client.Organizations.Get(ctx, orgName) + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get organization %s", orgName)) + } + parentTeam, resp, err := o.client.Teams.GetTeamByID(ctx, org.GetID(), parentTeamID) //nolint:staticcheck // TODO: migrate to GetTeamBySlug + if err != nil { + return nil, nil, wrapGitHubError(err, resp, fmt.Sprintf("failed to get parent team %d", parentTeamID)) + } + if parentTeam.GetPrivacy() == teamPrivacySecret { + return nil, nil, fmt.Errorf("cannot create child team: parent team %q has privacy set to \"secret\"; GitHub does not allow child teams under secret parent teams", parentTeam.GetName()) + } + newTeam.ParentTeamID = github.Ptr(parentTeamID) isNestedTeam = true } @@ -545,6 +560,9 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str } else if privacy == teamPrivacySecret || privacy == teamPrivacyClosed { // Non-nested teams can be "secret" or "closed" newTeam.Privacy = github.Ptr(privacy) + } else { + // Invalid privacy value for non-nested team + return nil, nil, fmt.Errorf("invalid privacy value: %q (must be \"secret\" or \"closed\")", privacy) } } else if isNestedTeam { // Default for nested teams is "closed" From 8d28b8f60c5633b84b493de538e433de73a4fbc4 Mon Sep 17 00:00:00 2001 From: vipulgowda Date: Tue, 3 Feb 2026 23:32:10 +0530 Subject: [PATCH 18/22] lint fix --- pkg/connector/team.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/connector/team.go b/pkg/connector/team.go index 7836aca2..7d307c42 100644 --- a/pkg/connector/team.go +++ b/pkg/connector/team.go @@ -549,7 +549,8 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str // - For non-nested teams: "secret" (default) or "closed" // - For nested/child teams: only "closed" is allowed (default: closed) if privacy, ok := actions.GetStringArg(args, "privacy"); ok && privacy != "" { - if isNestedTeam { + switch { + case isNestedTeam: // Nested teams can only be "closed" if privacy == teamPrivacySecret { l.Warn("github-connector: secret privacy not allowed for nested teams, using closed", @@ -557,10 +558,10 @@ func (o *teamResourceType) handleCreateTeamAction(ctx context.Context, args *str ) } newTeam.Privacy = github.Ptr(teamPrivacyClosed) - } else if privacy == teamPrivacySecret || privacy == teamPrivacyClosed { + case privacy == teamPrivacySecret || privacy == teamPrivacyClosed: // Non-nested teams can be "secret" or "closed" newTeam.Privacy = github.Ptr(privacy) - } else { + default: // Invalid privacy value for non-nested team return nil, nil, fmt.Errorf("invalid privacy value: %q (must be \"secret\" or \"closed\")", privacy) } From e8d0246fef3759eaeb52f0b77ba16274f02ac9bd Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Tue, 3 Feb 2026 23:11:02 +0000 Subject: [PATCH 19/22] rebase: main branch and baton sdk --- go.mod | 65 +- go.sum | 156 ++-- .../pb/c1/connectorapi/baton/v1/baton.pb.go | 674 ++++++++++++----- .../baton/v1/baton_protoopaque.pb.go | 676 +++++++++++++----- .../pkg/connectorbuilder/resource_manager.go | 4 +- .../baton-sdk/pkg/dotc1z/sql_helpers.go | 13 + .../conductorone/baton-sdk/pkg/sdk/version.go | 2 +- .../conductorone/baton-sdk/pkg/tasks/tasks.go | 8 + vendor/golang.org/x/sys/cpu/cpu.go | 3 - vendor/golang.org/x/sys/cpu/cpu_arm64.go | 20 +- vendor/golang.org/x/sys/cpu/cpu_arm64.s | 7 - vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 1 - .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 1 - .../golang.org/x/sys/cpu/cpu_netbsd_arm64.go | 2 +- .../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 2 +- vendor/modules.txt | 147 ++-- 16 files changed, 1191 insertions(+), 590 deletions(-) diff --git a/go.mod b/go.mod index 60c37994..5957a2c4 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/conductorone/baton-github go 1.25.2 require ( - github.com/conductorone/baton-sdk v0.7.10 + github.com/conductorone/baton-sdk v0.7.12 github.com/deckarep/golang-set/v2 v2.8.0 github.com/ennyjfrick/ruleguard-logfatal v0.0.2 github.com/golang-jwt/jwt/v5 v5.2.2 @@ -13,11 +13,11 @@ require ( github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7 github.com/stretchr/testify v1.11.1 - go.uber.org/zap v1.27.0 - golang.org/x/oauth2 v0.29.0 - golang.org/x/text v0.24.0 - google.golang.org/grpc v1.71.1 - google.golang.org/protobuf v1.36.6 + go.uber.org/zap v1.27.1 + golang.org/x/oauth2 v0.32.0 + golang.org/x/text v0.31.0 + google.golang.org/grpc v1.78.0 + google.golang.org/protobuf v1.36.10 ) require ( @@ -25,7 +25,7 @@ require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/aws/aws-lambda-go v1.47.0 // indirect - github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect + github.com/aws/aws-sdk-go-v2 v1.41.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect github.com/aws/aws-sdk-go-v2/config v1.29.2 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.17.55 // indirect @@ -44,9 +44,10 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.24.12 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.11 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.33.10 // indirect - github.com/aws/smithy-go v1.22.2 // indirect + github.com/aws/smithy-go v1.24.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect - github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/conductorone/dpop v0.2.3 // indirect github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 // indirect github.com/conductorone/dpop/integrations/dpop_oauth2 v0.2.3 // indirect @@ -57,8 +58,8 @@ require ( github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/glebarez/go-sqlite v1.22.0 // indirect - github.com/go-jose/go-jose/v4 v4.0.5 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/go-jose/go-jose/v4 v4.1.3 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -66,7 +67,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jellydator/ttlcache/v3 v3.3.0 // indirect @@ -99,30 +100,30 @@ require ( github.com/tklauser/go-sysconf v0.3.16 // indirect github.com/tklauser/numcpus v0.11.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/contrib/bridges/otelzap v0.10.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect - go.opentelemetry.io/otel v1.35.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect - go.opentelemetry.io/otel/log v0.11.0 // indirect - go.opentelemetry.io/otel/metric v1.35.0 // indirect - go.opentelemetry.io/otel/sdk v1.35.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.11.0 // indirect - go.opentelemetry.io/otel/trace v1.35.0 // indirect - go.opentelemetry.io/proto/otlp v1.5.0 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/contrib/bridges/otelzap v0.14.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.15.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 // indirect + go.opentelemetry.io/otel/log v0.15.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk v1.39.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/ratelimit v0.3.1 // indirect - golang.org/x/crypto v0.34.0 // indirect + golang.org/x/crypto v0.44.0 // indirect golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect - golang.org/x/net v0.35.0 // indirect - golang.org/x/sync v0.13.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/term v0.33.0 // indirect + golang.org/x/net v0.47.0 // indirect + golang.org/x/sync v0.18.0 // indirect + golang.org/x/sys v0.39.0 // indirect + golang.org/x/term v0.37.0 // indirect golang.org/x/time v0.8.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 45850e97..9f27ec62 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1 github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI= github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A= -github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM= -github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg= +github.com/aws/aws-sdk-go-v2 v1.41.0 h1:tNvqh1s+v0vFYdA1xq0aOJH+Y5cRyZ5upu6roPgPKd4= +github.com/aws/aws-sdk-go-v2 v1.41.0/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 h1:zAybnyUQXIZ5mok5Jqwlf58/TFE7uvd3IAsa1aF9cXs= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10/go.mod h1:qqvMj6gHLR/EXWZw4ZbqlPbQUyenf4h82UQUlKc+l14= github.com/aws/aws-sdk-go-v2/config v1.29.2 h1:JuIxOEPcSKpMB0J+khMjznG9LIhIBdmqNiEcPclnwqc= @@ -50,18 +50,20 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.11 h1:mUwIpAvILeKFnRx4h1dEgGE github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.11/go.mod h1:JDJtD+b8HNVv71axz8+S5492KM8wTzHRFpMKQbPlYxw= github.com/aws/aws-sdk-go-v2/service/sts v1.33.10 h1:g9d+TOsu3ac7SgmY2dUf1qMgu/uJVTlQ4VCbH6hRxSw= github.com/aws/aws-sdk-go-v2/service/sts v1.33.10/go.mod h1:WZfNmntu92HO44MVZAubQaz3qCuIdeOdog2sADfU6hU= -github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ= -github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= +github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= -github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/conductorone/baton-sdk v0.7.10 h1:eK/RTU8CZyTosYSNYmDzfAahGnxqpOq6rheBcwTx7w0= -github.com/conductorone/baton-sdk v0.7.10/go.mod h1:9S5feBOuIJxlNdGmkv3ObkCNHbVyOHr6foNrIrk+d4Y= +github.com/conductorone/baton-sdk v0.7.12 h1:LU9MZaYoxVZyAWMtTJE/i74FKp5Xp1kX2s7p0iBbrog= +github.com/conductorone/baton-sdk v0.7.12/go.mod h1:agmFrml6APUw4ZlqMEBrnXYj3aAOGKOJ6gztiNj64h0= github.com/conductorone/dpop v0.2.3 h1:s91U3845GHQ6P6FWrdNr2SEOy1ES/jcFs1JtKSl2S+o= github.com/conductorone/dpop v0.2.3/go.mod h1:gyo8TtzB9SCFCsjsICH4IaLZ7y64CcrDXMOPBwfq/3s= github.com/conductorone/dpop/integrations/dpop_grpc v0.2.3 h1:kLMCNIh0Mo2vbvvkCmJ3ixsPbXEJ6HPcW53Ku9yje3s= @@ -96,13 +98,13 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/ github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ= github.com/glebarez/go-sqlite v1.22.0/go.mod h1:PlBIdHe0+aUEFn+r2/uthrWq4FxbzugL0L8Li6yQJbc= -github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE= -github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= +github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs= +github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -145,8 +147,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -210,8 +212,8 @@ github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4l github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= @@ -260,36 +262,40 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/bridges/otelzap v0.10.0 h1:ojdSRDvjrnm30beHOmwsSvLpoRF40MlwNCA+Oo93kXU= -go.opentelemetry.io/contrib/bridges/otelzap v0.10.0/go.mod h1:oTTm4g7NEtHSV2i/0FeVdPaPgUIZPfQkFbq0vbzqnv0= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 h1:rgMkmiGfix9vFJDcDi1PK8WEQP4FLQwLDfhp5ZLpFeE= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4= -go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= -go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 h1:HMUytBT3uGhPKYY/u/G5MR9itrlSO2SMOsSD3Tk3k7A= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0/go.mod h1:hdDXsiNLmdW/9BF2jQpnHHlhFajpWCEYfM6e5m2OAZg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 h1:/jlt1Y8gXWiHG9FBx6cJaIC5hYx5Fe64nC8w5Cylt/0= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0/go.mod h1:bmToOGOBZ4hA9ghphIc1PAf66VA8KOtsuy3+ScStG20= -go.opentelemetry.io/otel/log v0.11.0 h1:c24Hrlk5WJ8JWcwbQxdBqxZdOK7PcP/LFtOtwpDTe3Y= -go.opentelemetry.io/otel/log v0.11.0/go.mod h1:U/sxQ83FPmT29trrifhQg+Zj2lo1/IPN1PF6RTFqdwc= -go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= -go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= -go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= -go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= -go.opentelemetry.io/otel/sdk/log v0.11.0 h1:7bAOpjpGglWhdEzP8z0VXc4jObOiDEwr3IYbhBnjk2c= -go.opentelemetry.io/otel/sdk/log v0.11.0/go.mod h1:dndLTxZbwBstZoqsJB3kGsRPkpAgaJrWfQg3lhlHFFY= -go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= -go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= -go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= -go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= -go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/contrib/bridges/otelzap v0.14.0 h1:2nKw2ZXZOC0N8RBsBbYwGwfKR7kJWzzyCZ6QfUGW/es= +go.opentelemetry.io/contrib/bridges/otelzap v0.14.0/go.mod h1:kvyVt0WEI5BB6XaIStXPIkCSQ2nSkyd8IZnAHLEXge4= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.15.0 h1:W+m0g+/6v3pa5PgVf2xoFMi5YtNR06WtS7ve5pcvLtM= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.15.0/go.mod h1:JM31r0GGZ/GU94mX8hN4D8v6e40aFlUECSQ48HaLgHM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 h1:in9O8ESIOlwJAEGTkkf34DesGRAc/Pn8qJ7k3r/42LM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0/go.mod h1:Rp0EXBm5tfnv0WL+ARyO/PHBEaEAT8UUHQ6AGJcSq6c= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.39.0 h1:5gn2urDL/FBnK8OkCfD1j3/ER79rUuTYmCvlXBKeYL8= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.39.0/go.mod h1:0fBG6ZJxhqByfFZDwSwpZGzJU671HkwpWaNe2t4VUPI= +go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY= +go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4= +go.opentelemetry.io/otel/log/logtest v0.15.0 h1:porNFuxAjodl6LhePevOc3n7bo3Wi3JhGXNWe7KP8iU= +go.opentelemetry.io/otel/log/logtest v0.15.0/go.mod h1:c8epqBXGHgS1LiNgmD+LuNYK9lSS3mqvtMdxLsfJgLg= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= +go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE= +go.opentelemetry.io/otel/sdk/log v0.15.0/go.mod h1:qDC/FlKQCXfH5hokGsNg9aUBGMJQsrUyeOiW5u+dKBQ= +go.opentelemetry.io/otel/sdk/log/logtest v0.14.0 h1:Ijbtz+JKXl8T2MngiwqBlPaHqc4YCaP/i13Qrow6gAM= +go.opentelemetry.io/otel/sdk/log/logtest v0.14.0/go.mod h1:dCU8aEL6q+L9cYTqcVOk8rM9Tp8WdnHOPLiBgp0SGOA= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -302,15 +308,15 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/ratelimit v0.3.1 h1:K4qVE+byfv/B3tC+4nYWP7v/6SimcO7HzHekoMNBma0= go.uber.org/ratelimit v0.3.1/go.mod h1:6euWsTB6U/Nb3X++xEUXA8ciPJvr19Q/0h1+oDcJhRk= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= +go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.34.0 h1:+/C6tk6rf/+t5DhUketUbD1aNGqiSX3j15Z6xuIDlBA= -golang.org/x/crypto v0.34.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU= +golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= @@ -322,8 +328,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= -golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= +golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -332,18 +338,18 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= -golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= +golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98= -golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= +golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= +golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -354,14 +360,14 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= -golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= +golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -373,30 +379,32 @@ golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= -golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= +golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= +golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= -google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI= -google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= -google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= -google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go index 76d95c61..02f3090a 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton.pb.go @@ -106,6 +106,8 @@ type Task struct { // *Task_ActionStatus // *Task_CreateSyncDiff // *Task_CompactSyncs_ + // *Task_ListEventFeeds + // *Task_ListEvents TaskType isTask_TaskType `protobuf_oneof:"task_type"` Debug bool `protobuf:"varint,3,opt,name=debug,proto3" json:"debug,omitempty"` unknownFields protoimpl.UnknownFields @@ -347,6 +349,24 @@ func (x *Task) GetCompactSyncs() *Task_CompactSyncs { return nil } +func (x *Task) GetListEventFeeds() *Task_ListEventFeedsTask { + if x != nil { + if x, ok := x.TaskType.(*Task_ListEventFeeds); ok { + return x.ListEventFeeds + } + } + return nil +} + +func (x *Task) GetListEvents() *Task_ListEventsTask { + if x != nil { + if x, ok := x.TaskType.(*Task_ListEvents); ok { + return x.ListEvents + } + } + return nil +} + func (x *Task) GetDebug() bool { if x != nil { return x.Debug @@ -530,6 +550,22 @@ func (x *Task) SetCompactSyncs(v *Task_CompactSyncs) { x.TaskType = &Task_CompactSyncs_{v} } +func (x *Task) SetListEventFeeds(v *Task_ListEventFeedsTask) { + if v == nil { + x.TaskType = nil + return + } + x.TaskType = &Task_ListEventFeeds{v} +} + +func (x *Task) SetListEvents(v *Task_ListEventsTask) { + if v == nil { + x.TaskType = nil + return + } + x.TaskType = &Task_ListEvents{v} +} + func (x *Task) SetDebug(v bool) { x.Debug = v } @@ -709,6 +745,22 @@ func (x *Task) HasCompactSyncs() bool { return ok } +func (x *Task) HasListEventFeeds() bool { + if x == nil { + return false + } + _, ok := x.TaskType.(*Task_ListEventFeeds) + return ok +} + +func (x *Task) HasListEvents() bool { + if x == nil { + return false + } + _, ok := x.TaskType.(*Task_ListEvents) + return ok +} + func (x *Task) ClearTaskType() { x.TaskType = nil } @@ -839,6 +891,18 @@ func (x *Task) ClearCompactSyncs() { } } +func (x *Task) ClearListEventFeeds() { + if _, ok := x.TaskType.(*Task_ListEventFeeds); ok { + x.TaskType = nil + } +} + +func (x *Task) ClearListEvents() { + if _, ok := x.TaskType.(*Task_ListEvents); ok { + x.TaskType = nil + } +} + const Task_TaskType_not_set_case case_Task_TaskType = 0 const Task_None_case case_Task_TaskType = 100 const Task_Hello_case case_Task_TaskType = 101 @@ -861,6 +925,8 @@ const Task_ActionInvoke_case case_Task_TaskType = 117 const Task_ActionStatus_case case_Task_TaskType = 118 const Task_CreateSyncDiff_case case_Task_TaskType = 119 const Task_CompactSyncs_case case_Task_TaskType = 120 +const Task_ListEventFeeds_case case_Task_TaskType = 121 +const Task_ListEvents_case case_Task_TaskType = 122 func (x *Task) WhichTaskType() case_Task_TaskType { if x == nil { @@ -909,6 +975,10 @@ func (x *Task) WhichTaskType() case_Task_TaskType { return Task_CreateSyncDiff_case case *Task_CompactSyncs_: return Task_CompactSyncs_case + case *Task_ListEventFeeds: + return Task_ListEventFeeds_case + case *Task_ListEvents: + return Task_ListEvents_case default: return Task_TaskType_not_set_case } @@ -941,6 +1011,8 @@ type Task_builder struct { ActionStatus *Task_ActionStatusTask CreateSyncDiff *Task_CreateSyncDiffTask CompactSyncs *Task_CompactSyncs + ListEventFeeds *Task_ListEventFeedsTask + ListEvents *Task_ListEventsTask // -- end of TaskType Debug bool } @@ -1014,6 +1086,12 @@ func (b0 Task_builder) Build() *Task { if b.CompactSyncs != nil { x.TaskType = &Task_CompactSyncs_{b.CompactSyncs} } + if b.ListEventFeeds != nil { + x.TaskType = &Task_ListEventFeeds{b.ListEventFeeds} + } + if b.ListEvents != nil { + x.TaskType = &Task_ListEvents{b.ListEvents} + } x.Debug = b.Debug return m0 } @@ -1116,6 +1194,14 @@ type Task_CompactSyncs_ struct { CompactSyncs *Task_CompactSyncs `protobuf:"bytes,120,opt,name=compact_syncs,json=compactSyncs,proto3,oneof"` } +type Task_ListEventFeeds struct { + ListEventFeeds *Task_ListEventFeedsTask `protobuf:"bytes,121,opt,name=list_event_feeds,json=listEventFeeds,proto3,oneof"` +} + +type Task_ListEvents struct { + ListEvents *Task_ListEventsTask `protobuf:"bytes,122,opt,name=list_events,json=listEvents,proto3,oneof"` +} + func (*Task_None) isTask_TaskType() {} func (*Task_Hello) isTask_TaskType() {} @@ -1158,6 +1244,10 @@ func (*Task_CreateSyncDiff) isTask_TaskType() {} func (*Task_CompactSyncs_) isTask_TaskType() {} +func (*Task_ListEventFeeds) isTask_TaskType() {} + +func (*Task_ListEvents) isTask_TaskType() {} + type BatonServiceHelloRequest struct { state protoimpl.MessageState `protogen:"hybrid.v1"` HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3" json:"host_id,omitempty"` @@ -2717,6 +2807,187 @@ func (b0 Task_EventFeedTask_builder) Build() *Task_EventFeedTask { return m0 } +type Task_ListEventsTask struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` + Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` + StartAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start_at,json=startAt,proto3" json:"start_at,omitempty"` + EventFeedId string `protobuf:"bytes,4,opt,name=event_feed_id,json=eventFeedId,proto3" json:"event_feed_id,omitempty"` + PageSize uint32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_ListEventsTask) Reset() { + *x = Task_ListEventsTask{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_ListEventsTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_ListEventsTask) ProtoMessage() {} + +func (x *Task_ListEventsTask) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Task_ListEventsTask) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *Task_ListEventsTask) GetCursor() string { + if x != nil { + return x.Cursor + } + return "" +} + +func (x *Task_ListEventsTask) GetStartAt() *timestamppb.Timestamp { + if x != nil { + return x.StartAt + } + return nil +} + +func (x *Task_ListEventsTask) GetEventFeedId() string { + if x != nil { + return x.EventFeedId + } + return "" +} + +func (x *Task_ListEventsTask) GetPageSize() uint32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *Task_ListEventsTask) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *Task_ListEventsTask) SetCursor(v string) { + x.Cursor = v +} + +func (x *Task_ListEventsTask) SetStartAt(v *timestamppb.Timestamp) { + x.StartAt = v +} + +func (x *Task_ListEventsTask) SetEventFeedId(v string) { + x.EventFeedId = v +} + +func (x *Task_ListEventsTask) SetPageSize(v uint32) { + x.PageSize = v +} + +func (x *Task_ListEventsTask) HasStartAt() bool { + if x == nil { + return false + } + return x.StartAt != nil +} + +func (x *Task_ListEventsTask) ClearStartAt() { + x.StartAt = nil +} + +type Task_ListEventsTask_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Annotations []*anypb.Any + Cursor string + StartAt *timestamppb.Timestamp + EventFeedId string + PageSize uint32 +} + +func (b0 Task_ListEventsTask_builder) Build() *Task_ListEventsTask { + m0 := &Task_ListEventsTask{} + b, x := &b0, m0 + _, _ = b, x + x.Annotations = b.Annotations + x.Cursor = b.Cursor + x.StartAt = b.StartAt + x.EventFeedId = b.EventFeedId + x.PageSize = b.PageSize + return m0 +} + +type Task_ListEventFeedsTask struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_ListEventFeedsTask) Reset() { + *x = Task_ListEventFeedsTask{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_ListEventFeedsTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_ListEventFeedsTask) ProtoMessage() {} + +func (x *Task_ListEventFeedsTask) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Task_ListEventFeedsTask) GetAnnotations() []*anypb.Any { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *Task_ListEventFeedsTask) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +type Task_ListEventFeedsTask_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Annotations []*anypb.Any +} + +func (b0 Task_ListEventFeedsTask_builder) Build() *Task_ListEventFeedsTask { + m0 := &Task_ListEventFeedsTask{} + b, x := &b0, m0 + _, _ = b, x + x.Annotations = b.Annotations + return m0 +} + type Task_GrantTask struct { state protoimpl.MessageState `protogen:"hybrid.v1"` Entitlement *v2.Entitlement `protobuf:"bytes,1,opt,name=entitlement,proto3" json:"entitlement,omitempty"` @@ -2729,7 +3000,7 @@ type Task_GrantTask struct { func (x *Task_GrantTask) Reset() { *x = Task_GrantTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2741,7 +3012,7 @@ func (x *Task_GrantTask) String() string { func (*Task_GrantTask) ProtoMessage() {} func (x *Task_GrantTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2859,7 +3130,7 @@ type Task_RevokeTask struct { func (x *Task_RevokeTask) Reset() { *x = Task_RevokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2871,7 +3142,7 @@ func (x *Task_RevokeTask) String() string { func (*Task_RevokeTask) ProtoMessage() {} func (x *Task_RevokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2943,7 +3214,7 @@ type Task_CreateAccountTask struct { func (x *Task_CreateAccountTask) Reset() { *x = Task_CreateAccountTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2955,7 +3226,7 @@ func (x *Task_CreateAccountTask) String() string { func (*Task_CreateAccountTask) ProtoMessage() {} func (x *Task_CreateAccountTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3061,7 +3332,7 @@ type Task_CreateResourceTask struct { func (x *Task_CreateResourceTask) Reset() { *x = Task_CreateResourceTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3073,7 +3344,7 @@ func (x *Task_CreateResourceTask) String() string { func (*Task_CreateResourceTask) ProtoMessage() {} func (x *Task_CreateResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3130,7 +3401,7 @@ type Task_DeleteResourceTask struct { func (x *Task_DeleteResourceTask) Reset() { *x = Task_DeleteResourceTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3142,7 +3413,7 @@ func (x *Task_DeleteResourceTask) String() string { func (*Task_DeleteResourceTask) ProtoMessage() {} func (x *Task_DeleteResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3224,7 +3495,7 @@ type Task_RotateCredentialsTask struct { func (x *Task_RotateCredentialsTask) Reset() { *x = Task_RotateCredentialsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3236,7 +3507,7 @@ func (x *Task_RotateCredentialsTask) String() string { func (*Task_RotateCredentialsTask) ProtoMessage() {} func (x *Task_RotateCredentialsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3331,7 +3602,7 @@ type Task_CreateTicketTask struct { func (x *Task_CreateTicketTask) Reset() { *x = Task_CreateTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3343,7 +3614,7 @@ func (x *Task_CreateTicketTask) String() string { func (*Task_CreateTicketTask) ProtoMessage() {} func (x *Task_CreateTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3436,7 +3707,7 @@ type Task_BulkCreateTicketsTask struct { func (x *Task_BulkCreateTicketsTask) Reset() { *x = Task_BulkCreateTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3448,7 +3719,7 @@ func (x *Task_BulkCreateTicketsTask) String() string { func (*Task_BulkCreateTicketsTask) ProtoMessage() {} func (x *Task_BulkCreateTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3493,7 +3764,7 @@ type Task_BulkGetTicketsTask struct { func (x *Task_BulkGetTicketsTask) Reset() { *x = Task_BulkGetTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3505,7 +3776,7 @@ func (x *Task_BulkGetTicketsTask) String() string { func (*Task_BulkGetTicketsTask) ProtoMessage() {} func (x *Task_BulkGetTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3550,7 +3821,7 @@ type Task_ListTicketSchemasTask struct { func (x *Task_ListTicketSchemasTask) Reset() { *x = Task_ListTicketSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3562,7 +3833,7 @@ func (x *Task_ListTicketSchemasTask) String() string { func (*Task_ListTicketSchemasTask) ProtoMessage() {} func (x *Task_ListTicketSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3608,7 +3879,7 @@ type Task_GetTicketTask struct { func (x *Task_GetTicketTask) Reset() { *x = Task_GetTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3620,7 +3891,7 @@ func (x *Task_GetTicketTask) String() string { func (*Task_GetTicketTask) ProtoMessage() {} func (x *Task_GetTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3680,7 +3951,7 @@ type Task_ActionListSchemasTask struct { func (x *Task_ActionListSchemasTask) Reset() { *x = Task_ActionListSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3692,7 +3963,7 @@ func (x *Task_ActionListSchemasTask) String() string { func (*Task_ActionListSchemasTask) ProtoMessage() {} func (x *Task_ActionListSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3752,7 +4023,7 @@ type Task_ActionGetSchemaTask struct { func (x *Task_ActionGetSchemaTask) Reset() { *x = Task_ActionGetSchemaTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3764,7 +4035,7 @@ func (x *Task_ActionGetSchemaTask) String() string { func (*Task_ActionGetSchemaTask) ProtoMessage() {} func (x *Task_ActionGetSchemaTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3826,7 +4097,7 @@ type Task_ActionInvokeTask struct { func (x *Task_ActionInvokeTask) Reset() { *x = Task_ActionInvokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3838,7 +4109,7 @@ func (x *Task_ActionInvokeTask) String() string { func (*Task_ActionInvokeTask) ProtoMessage() {} func (x *Task_ActionInvokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3936,7 +4207,7 @@ type Task_ActionStatusTask struct { func (x *Task_ActionStatusTask) Reset() { *x = Task_ActionStatusTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3948,7 +4219,7 @@ func (x *Task_ActionStatusTask) String() string { func (*Task_ActionStatusTask) ProtoMessage() {} func (x *Task_ActionStatusTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4022,7 +4293,7 @@ type Task_CreateSyncDiffTask struct { func (x *Task_CreateSyncDiffTask) Reset() { *x = Task_CreateSyncDiffTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4034,7 +4305,7 @@ func (x *Task_CreateSyncDiffTask) String() string { func (*Task_CreateSyncDiffTask) ProtoMessage() {} func (x *Task_CreateSyncDiffTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4107,7 +4378,7 @@ type Task_CompactSyncs struct { func (x *Task_CompactSyncs) Reset() { *x = Task_CompactSyncs{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4119,7 +4390,7 @@ func (x *Task_CompactSyncs) String() string { func (*Task_CompactSyncs) ProtoMessage() {} func (x *Task_CompactSyncs) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4178,7 +4449,7 @@ type Task_CompactSyncs_CompactableSync struct { func (x *Task_CompactSyncs_CompactableSync) Reset() { *x = Task_CompactSyncs_CompactableSync{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4190,7 +4461,7 @@ func (x *Task_CompactSyncs_CompactableSync) String() string { func (*Task_CompactSyncs_CompactableSync) ProtoMessage() {} func (x *Task_CompactSyncs_CompactableSync) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4250,7 +4521,7 @@ type BatonServiceHelloRequest_BuildInfo struct { func (x *BatonServiceHelloRequest_BuildInfo) Reset() { *x = BatonServiceHelloRequest_BuildInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4262,7 +4533,7 @@ func (x *BatonServiceHelloRequest_BuildInfo) String() string { func (*BatonServiceHelloRequest_BuildInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_BuildInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4340,7 +4611,7 @@ type BatonServiceHelloRequest_OSInfo struct { func (x *BatonServiceHelloRequest_OSInfo) Reset() { *x = BatonServiceHelloRequest_OSInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4352,7 +4623,7 @@ func (x *BatonServiceHelloRequest_OSInfo) String() string { func (*BatonServiceHelloRequest_OSInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_OSInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4490,7 +4761,7 @@ type BatonServiceUploadAssetRequest_UploadMetadata struct { func (x *BatonServiceUploadAssetRequest_UploadMetadata) Reset() { *x = BatonServiceUploadAssetRequest_UploadMetadata{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4502,7 +4773,7 @@ func (x *BatonServiceUploadAssetRequest_UploadMetadata) String() string { func (*BatonServiceUploadAssetRequest_UploadMetadata) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadMetadata) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4574,7 +4845,7 @@ type BatonServiceUploadAssetRequest_UploadData struct { func (x *BatonServiceUploadAssetRequest_UploadData) Reset() { *x = BatonServiceUploadAssetRequest_UploadData{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4586,7 +4857,7 @@ func (x *BatonServiceUploadAssetRequest_UploadData) String() string { func (*BatonServiceUploadAssetRequest_UploadData) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4636,7 +4907,7 @@ type BatonServiceUploadAssetRequest_UploadEOF struct { func (x *BatonServiceUploadAssetRequest_UploadEOF) Reset() { *x = BatonServiceUploadAssetRequest_UploadEOF{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4648,7 +4919,7 @@ func (x *BatonServiceUploadAssetRequest_UploadEOF) String() string { func (*BatonServiceUploadAssetRequest_UploadEOF) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadEOF) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4712,7 +4983,7 @@ type BatonServiceFinishTaskRequest_Error struct { func (x *BatonServiceFinishTaskRequest_Error) Reset() { *x = BatonServiceFinishTaskRequest_Error{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4724,7 +4995,7 @@ func (x *BatonServiceFinishTaskRequest_Error) String() string { func (*BatonServiceFinishTaskRequest_Error) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Error) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4809,7 +5080,7 @@ type BatonServiceFinishTaskRequest_Success struct { func (x *BatonServiceFinishTaskRequest_Success) Reset() { *x = BatonServiceFinishTaskRequest_Success{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4821,7 +5092,7 @@ func (x *BatonServiceFinishTaskRequest_Success) String() string { func (*BatonServiceFinishTaskRequest_Success) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Success) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4886,7 +5157,7 @@ var File_c1_connectorapi_baton_v1_baton_proto protoreflect.FileDescriptor const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + - "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xb9)\n" + + "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xa2-\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12=\n" + "\x06status\x18\x02 \x01(\x0e2%.c1.connectorapi.baton.v1.Task.StatusR\x06status\x12=\n" + @@ -4912,7 +5183,10 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\raction_invoke\x18u \x01(\v2/.c1.connectorapi.baton.v1.Task.ActionInvokeTaskH\x00R\factionInvoke\x12V\n" + "\raction_status\x18v \x01(\v2/.c1.connectorapi.baton.v1.Task.ActionStatusTaskH\x00R\factionStatus\x12]\n" + "\x10create_sync_diff\x18w \x01(\v21.c1.connectorapi.baton.v1.Task.CreateSyncDiffTaskH\x00R\x0ecreateSyncDiff\x12R\n" + - "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12\x14\n" + + "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12]\n" + + "\x10list_event_feeds\x18y \x01(\v21.c1.connectorapi.baton.v1.Task.ListEventFeedsTaskH\x00R\x0elistEventFeeds\x12P\n" + + "\vlist_events\x18z \x01(\v2-.c1.connectorapi.baton.v1.Task.ListEventsTaskH\x00R\n" + + "listEvents\x12\x14\n" + "\x05debug\x18\x03 \x01(\bR\x05debug\x1aB\n" + "\bNoneTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1aC\n" + @@ -4925,7 +5199,16 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x17targeted_sync_resources\x18\x04 \x03(\v2\x19.c1.connector.v2.ResourceR\x15targetedSyncResources\x1a~\n" + "\rEventFeedTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x125\n" + - "\bstart_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x1a\xf3\x01\n" + + "\bstart_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x1a\xe7\x01\n" + + "\x0eListEventsTask\x126\n" + + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12%\n" + + "\x06cursor\x18\x02 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80 \xd0\x01\x01R\x06cursor\x125\n" + + "\bstart_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x12\"\n" + + "\revent_feed_id\x18\x04 \x01(\tR\veventFeedId\x12\x1b\n" + + "\tpage_size\x18\x05 \x01(\rR\bpageSize\x1aL\n" + + "\x12ListEventFeedsTask\x126\n" + + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xf3\x01\n" + "\tGrantTask\x12>\n" + "\ventitlement\x18\x01 \x01(\v2\x1c.c1.connector.v2.EntitlementR\ventitlement\x127\n" + "\tprincipal\x18\x02 \x01(\v2\x19.c1.connector.v2.ResourceR\tprincipal\x126\n" + @@ -5100,7 +5383,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x0eStartDebugging\x12/.c1.connectorapi.baton.v1.StartDebuggingRequest\x1a0.c1.connectorapi.baton.v1.StartDebuggingResponse\"\x00B7Z5gitlab.com/ductone/c1/pkg/pb/c1/connectorapi/baton/v1b\x06proto3" var file_c1_connectorapi_baton_v1_baton_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 42) +var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 44) var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (Task_Status)(0), // 0: c1.connectorapi.baton.v1.Task.Status (*Task)(nil), // 1: c1.connectorapi.baton.v1.Task @@ -5120,149 +5403,156 @@ var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (*Task_HelloTask)(nil), // 15: c1.connectorapi.baton.v1.Task.HelloTask (*Task_SyncFullTask)(nil), // 16: c1.connectorapi.baton.v1.Task.SyncFullTask (*Task_EventFeedTask)(nil), // 17: c1.connectorapi.baton.v1.Task.EventFeedTask - (*Task_GrantTask)(nil), // 18: c1.connectorapi.baton.v1.Task.GrantTask - (*Task_RevokeTask)(nil), // 19: c1.connectorapi.baton.v1.Task.RevokeTask - (*Task_CreateAccountTask)(nil), // 20: c1.connectorapi.baton.v1.Task.CreateAccountTask - (*Task_CreateResourceTask)(nil), // 21: c1.connectorapi.baton.v1.Task.CreateResourceTask - (*Task_DeleteResourceTask)(nil), // 22: c1.connectorapi.baton.v1.Task.DeleteResourceTask - (*Task_RotateCredentialsTask)(nil), // 23: c1.connectorapi.baton.v1.Task.RotateCredentialsTask - (*Task_CreateTicketTask)(nil), // 24: c1.connectorapi.baton.v1.Task.CreateTicketTask - (*Task_BulkCreateTicketsTask)(nil), // 25: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - (*Task_BulkGetTicketsTask)(nil), // 26: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - (*Task_ListTicketSchemasTask)(nil), // 27: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - (*Task_GetTicketTask)(nil), // 28: c1.connectorapi.baton.v1.Task.GetTicketTask - (*Task_ActionListSchemasTask)(nil), // 29: c1.connectorapi.baton.v1.Task.ActionListSchemasTask - (*Task_ActionGetSchemaTask)(nil), // 30: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - (*Task_ActionInvokeTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionInvokeTask - (*Task_ActionStatusTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionStatusTask - (*Task_CreateSyncDiffTask)(nil), // 33: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - (*Task_CompactSyncs)(nil), // 34: c1.connectorapi.baton.v1.Task.CompactSyncs - (*Task_CompactSyncs_CompactableSync)(nil), // 35: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - (*BatonServiceHelloRequest_BuildInfo)(nil), // 36: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - (*BatonServiceHelloRequest_OSInfo)(nil), // 37: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - (*BatonServiceUploadAssetRequest_UploadData)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - (*BatonServiceFinishTaskRequest_Error)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - (*BatonServiceFinishTaskRequest_Success)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - (*v2.ConnectorMetadata)(nil), // 43: c1.connector.v2.ConnectorMetadata - (*anypb.Any)(nil), // 44: google.protobuf.Any - (*durationpb.Duration)(nil), // 45: google.protobuf.Duration - (*status.Status)(nil), // 46: google.rpc.Status - (*v2.Resource)(nil), // 47: c1.connector.v2.Resource - (*timestamppb.Timestamp)(nil), // 48: google.protobuf.Timestamp - (*v2.Entitlement)(nil), // 49: c1.connector.v2.Entitlement - (*v2.Grant)(nil), // 50: c1.connector.v2.Grant - (*v2.AccountInfo)(nil), // 51: c1.connector.v2.AccountInfo - (*v2.CredentialOptions)(nil), // 52: c1.connector.v2.CredentialOptions - (*v2.EncryptionConfig)(nil), // 53: c1.connector.v2.EncryptionConfig - (*v2.ResourceId)(nil), // 54: c1.connector.v2.ResourceId - (*v2.TicketRequest)(nil), // 55: c1.connector.v2.TicketRequest - (*v2.TicketSchema)(nil), // 56: c1.connector.v2.TicketSchema - (*structpb.Struct)(nil), // 57: google.protobuf.Struct + (*Task_ListEventsTask)(nil), // 18: c1.connectorapi.baton.v1.Task.ListEventsTask + (*Task_ListEventFeedsTask)(nil), // 19: c1.connectorapi.baton.v1.Task.ListEventFeedsTask + (*Task_GrantTask)(nil), // 20: c1.connectorapi.baton.v1.Task.GrantTask + (*Task_RevokeTask)(nil), // 21: c1.connectorapi.baton.v1.Task.RevokeTask + (*Task_CreateAccountTask)(nil), // 22: c1.connectorapi.baton.v1.Task.CreateAccountTask + (*Task_CreateResourceTask)(nil), // 23: c1.connectorapi.baton.v1.Task.CreateResourceTask + (*Task_DeleteResourceTask)(nil), // 24: c1.connectorapi.baton.v1.Task.DeleteResourceTask + (*Task_RotateCredentialsTask)(nil), // 25: c1.connectorapi.baton.v1.Task.RotateCredentialsTask + (*Task_CreateTicketTask)(nil), // 26: c1.connectorapi.baton.v1.Task.CreateTicketTask + (*Task_BulkCreateTicketsTask)(nil), // 27: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + (*Task_BulkGetTicketsTask)(nil), // 28: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + (*Task_ListTicketSchemasTask)(nil), // 29: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + (*Task_GetTicketTask)(nil), // 30: c1.connectorapi.baton.v1.Task.GetTicketTask + (*Task_ActionListSchemasTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionListSchemasTask + (*Task_ActionGetSchemaTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + (*Task_ActionInvokeTask)(nil), // 33: c1.connectorapi.baton.v1.Task.ActionInvokeTask + (*Task_ActionStatusTask)(nil), // 34: c1.connectorapi.baton.v1.Task.ActionStatusTask + (*Task_CreateSyncDiffTask)(nil), // 35: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + (*Task_CompactSyncs)(nil), // 36: c1.connectorapi.baton.v1.Task.CompactSyncs + (*Task_CompactSyncs_CompactableSync)(nil), // 37: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + (*BatonServiceHelloRequest_BuildInfo)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + (*BatonServiceHelloRequest_OSInfo)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + (*BatonServiceUploadAssetRequest_UploadData)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + (*BatonServiceFinishTaskRequest_Error)(nil), // 43: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + (*BatonServiceFinishTaskRequest_Success)(nil), // 44: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + (*v2.ConnectorMetadata)(nil), // 45: c1.connector.v2.ConnectorMetadata + (*anypb.Any)(nil), // 46: google.protobuf.Any + (*durationpb.Duration)(nil), // 47: google.protobuf.Duration + (*status.Status)(nil), // 48: google.rpc.Status + (*v2.Resource)(nil), // 49: c1.connector.v2.Resource + (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp + (*v2.Entitlement)(nil), // 51: c1.connector.v2.Entitlement + (*v2.Grant)(nil), // 52: c1.connector.v2.Grant + (*v2.AccountInfo)(nil), // 53: c1.connector.v2.AccountInfo + (*v2.CredentialOptions)(nil), // 54: c1.connector.v2.CredentialOptions + (*v2.EncryptionConfig)(nil), // 55: c1.connector.v2.EncryptionConfig + (*v2.ResourceId)(nil), // 56: c1.connector.v2.ResourceId + (*v2.TicketRequest)(nil), // 57: c1.connector.v2.TicketRequest + (*v2.TicketSchema)(nil), // 58: c1.connector.v2.TicketSchema + (*structpb.Struct)(nil), // 59: google.protobuf.Struct } var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 0, // 0: c1.connectorapi.baton.v1.Task.status:type_name -> c1.connectorapi.baton.v1.Task.Status 14, // 1: c1.connectorapi.baton.v1.Task.none:type_name -> c1.connectorapi.baton.v1.Task.NoneTask 15, // 2: c1.connectorapi.baton.v1.Task.hello:type_name -> c1.connectorapi.baton.v1.Task.HelloTask 16, // 3: c1.connectorapi.baton.v1.Task.sync_full:type_name -> c1.connectorapi.baton.v1.Task.SyncFullTask - 18, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask - 19, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask - 20, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask - 21, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask - 22, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask - 23, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask + 20, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask + 21, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask + 22, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask + 23, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask + 24, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask + 25, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask 17, // 10: c1.connectorapi.baton.v1.Task.event_feed:type_name -> c1.connectorapi.baton.v1.Task.EventFeedTask - 24, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 27, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - 28, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 25, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - 26, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - 29, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask - 30, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - 31, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask - 32, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask - 33, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - 34, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs - 36, // 22: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - 37, // 23: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - 43, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata - 44, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any - 44, // 26: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any - 1, // 27: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task - 45, // 28: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration - 45, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration - 44, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any - 44, // 31: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any - 45, // 32: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration - 44, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any - 38, // 34: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - 39, // 35: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - 44, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any - 46, // 38: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status - 41, // 39: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - 42, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - 44, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any - 44, // 42: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any - 44, // 43: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any - 44, // 44: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any - 47, // 45: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource - 44, // 46: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any - 48, // 47: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp - 49, // 48: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement - 47, // 49: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource - 44, // 50: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any - 45, // 51: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration - 50, // 52: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant - 44, // 53: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any - 51, // 54: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo - 52, // 55: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 53, // 56: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 47, // 57: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource - 54, // 58: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 54, // 59: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 54, // 60: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 52, // 61: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 53, // 62: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 55, // 63: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 56, // 64: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 44, // 65: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 24, // 66: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 28, // 67: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 44, // 68: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 44, // 69: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 44, // 70: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any - 44, // 71: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any - 57, // 72: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct - 44, // 73: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any - 44, // 74: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any - 44, // 75: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any - 35, // 76: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - 44, // 77: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any - 44, // 78: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 44, // 79: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 44, // 80: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 44, // 81: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 44, // 82: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 44, // 83: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any - 2, // 84: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest - 4, // 85: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest - 6, // 86: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest - 10, // 87: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest - 8, // 88: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 12, // 89: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest - 3, // 90: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 5, // 91: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 7, // 92: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 11, // 93: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 9, // 94: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 13, // 95: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse - 90, // [90:96] is the sub-list for method output_type - 84, // [84:90] is the sub-list for method input_type - 84, // [84:84] is the sub-list for extension type_name - 84, // [84:84] is the sub-list for extension extendee - 0, // [0:84] is the sub-list for field type_name + 26, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 29, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + 30, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 27, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + 28, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + 31, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask + 32, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + 33, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask + 34, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask + 35, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + 36, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs + 19, // 22: c1.connectorapi.baton.v1.Task.list_event_feeds:type_name -> c1.connectorapi.baton.v1.Task.ListEventFeedsTask + 18, // 23: c1.connectorapi.baton.v1.Task.list_events:type_name -> c1.connectorapi.baton.v1.Task.ListEventsTask + 38, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + 39, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + 45, // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata + 46, // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any + 46, // 28: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any + 1, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task + 47, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration + 47, // 31: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration + 46, // 32: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any + 46, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any + 47, // 34: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration + 46, // 35: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any + 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + 41, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + 42, // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + 46, // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any + 48, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status + 43, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + 44, // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + 46, // 43: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any + 46, // 44: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any + 46, // 45: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any + 46, // 46: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any + 49, // 47: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource + 46, // 48: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any + 50, // 49: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp + 46, // 50: c1.connectorapi.baton.v1.Task.ListEventsTask.annotations:type_name -> google.protobuf.Any + 50, // 51: c1.connectorapi.baton.v1.Task.ListEventsTask.start_at:type_name -> google.protobuf.Timestamp + 46, // 52: c1.connectorapi.baton.v1.Task.ListEventFeedsTask.annotations:type_name -> google.protobuf.Any + 51, // 53: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement + 49, // 54: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource + 46, // 55: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any + 47, // 56: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration + 52, // 57: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant + 46, // 58: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any + 53, // 59: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo + 54, // 60: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 55, // 61: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 49, // 62: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource + 56, // 63: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId + 56, // 64: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 56, // 65: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId + 54, // 66: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 55, // 67: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 57, // 68: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest + 58, // 69: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema + 46, // 70: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any + 26, // 71: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 30, // 72: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 46, // 73: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any + 46, // 74: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any + 46, // 75: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any + 46, // 76: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any + 59, // 77: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct + 46, // 78: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any + 46, // 79: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any + 46, // 80: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any + 37, // 81: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + 46, // 82: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any + 46, // 83: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any + 46, // 84: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any + 46, // 85: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any + 46, // 86: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any + 46, // 87: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any + 46, // 88: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any + 2, // 89: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest + 4, // 90: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest + 6, // 91: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest + 10, // 92: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest + 8, // 93: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest + 12, // 94: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest + 3, // 95: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse + 5, // 96: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse + 7, // 97: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse + 11, // 98: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse + 9, // 99: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse + 13, // 100: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse + 95, // [95:101] is the sub-list for method output_type + 89, // [89:95] is the sub-list for method input_type + 89, // [89:89] is the sub-list for extension type_name + 89, // [89:89] is the sub-list for extension extendee + 0, // [0:89] is the sub-list for field type_name } func init() { file_c1_connectorapi_baton_v1_baton_proto_init() } @@ -5292,6 +5582,8 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { (*Task_ActionStatus)(nil), (*Task_CreateSyncDiff)(nil), (*Task_CompactSyncs_)(nil), + (*Task_ListEventFeeds)(nil), + (*Task_ListEvents)(nil), } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[7].OneofWrappers = []any{ (*BatonServiceUploadAssetRequest_Metadata)(nil), @@ -5308,7 +5600,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connectorapi_baton_v1_baton_proto_rawDesc), len(file_c1_connectorapi_baton_v1_baton_proto_rawDesc)), NumEnums: 1, - NumMessages: 42, + NumMessages: 44, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go index 65db2f42..df8c1b94 100644 --- a/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go +++ b/vendor/github.com/conductorone/baton-sdk/pb/c1/connectorapi/baton/v1/baton_protoopaque.pb.go @@ -317,6 +317,24 @@ func (x *Task) GetCompactSyncs() *Task_CompactSyncs { return nil } +func (x *Task) GetListEventFeeds() *Task_ListEventFeedsTask { + if x != nil { + if x, ok := x.xxx_hidden_TaskType.(*task_ListEventFeeds); ok { + return x.ListEventFeeds + } + } + return nil +} + +func (x *Task) GetListEvents() *Task_ListEventsTask { + if x != nil { + if x, ok := x.xxx_hidden_TaskType.(*task_ListEvents); ok { + return x.ListEvents + } + } + return nil +} + func (x *Task) GetDebug() bool { if x != nil { return x.xxx_hidden_Debug @@ -500,6 +518,22 @@ func (x *Task) SetCompactSyncs(v *Task_CompactSyncs) { x.xxx_hidden_TaskType = &task_CompactSyncs_{v} } +func (x *Task) SetListEventFeeds(v *Task_ListEventFeedsTask) { + if v == nil { + x.xxx_hidden_TaskType = nil + return + } + x.xxx_hidden_TaskType = &task_ListEventFeeds{v} +} + +func (x *Task) SetListEvents(v *Task_ListEventsTask) { + if v == nil { + x.xxx_hidden_TaskType = nil + return + } + x.xxx_hidden_TaskType = &task_ListEvents{v} +} + func (x *Task) SetDebug(v bool) { x.xxx_hidden_Debug = v } @@ -679,6 +713,22 @@ func (x *Task) HasCompactSyncs() bool { return ok } +func (x *Task) HasListEventFeeds() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_TaskType.(*task_ListEventFeeds) + return ok +} + +func (x *Task) HasListEvents() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_TaskType.(*task_ListEvents) + return ok +} + func (x *Task) ClearTaskType() { x.xxx_hidden_TaskType = nil } @@ -809,6 +859,18 @@ func (x *Task) ClearCompactSyncs() { } } +func (x *Task) ClearListEventFeeds() { + if _, ok := x.xxx_hidden_TaskType.(*task_ListEventFeeds); ok { + x.xxx_hidden_TaskType = nil + } +} + +func (x *Task) ClearListEvents() { + if _, ok := x.xxx_hidden_TaskType.(*task_ListEvents); ok { + x.xxx_hidden_TaskType = nil + } +} + const Task_TaskType_not_set_case case_Task_TaskType = 0 const Task_None_case case_Task_TaskType = 100 const Task_Hello_case case_Task_TaskType = 101 @@ -831,6 +893,8 @@ const Task_ActionInvoke_case case_Task_TaskType = 117 const Task_ActionStatus_case case_Task_TaskType = 118 const Task_CreateSyncDiff_case case_Task_TaskType = 119 const Task_CompactSyncs_case case_Task_TaskType = 120 +const Task_ListEventFeeds_case case_Task_TaskType = 121 +const Task_ListEvents_case case_Task_TaskType = 122 func (x *Task) WhichTaskType() case_Task_TaskType { if x == nil { @@ -879,6 +943,10 @@ func (x *Task) WhichTaskType() case_Task_TaskType { return Task_CreateSyncDiff_case case *task_CompactSyncs_: return Task_CompactSyncs_case + case *task_ListEventFeeds: + return Task_ListEventFeeds_case + case *task_ListEvents: + return Task_ListEvents_case default: return Task_TaskType_not_set_case } @@ -911,6 +979,8 @@ type Task_builder struct { ActionStatus *Task_ActionStatusTask CreateSyncDiff *Task_CreateSyncDiffTask CompactSyncs *Task_CompactSyncs + ListEventFeeds *Task_ListEventFeedsTask + ListEvents *Task_ListEventsTask // -- end of xxx_hidden_TaskType Debug bool } @@ -984,6 +1054,12 @@ func (b0 Task_builder) Build() *Task { if b.CompactSyncs != nil { x.xxx_hidden_TaskType = &task_CompactSyncs_{b.CompactSyncs} } + if b.ListEventFeeds != nil { + x.xxx_hidden_TaskType = &task_ListEventFeeds{b.ListEventFeeds} + } + if b.ListEvents != nil { + x.xxx_hidden_TaskType = &task_ListEvents{b.ListEvents} + } x.xxx_hidden_Debug = b.Debug return m0 } @@ -1086,6 +1162,14 @@ type task_CompactSyncs_ struct { CompactSyncs *Task_CompactSyncs `protobuf:"bytes,120,opt,name=compact_syncs,json=compactSyncs,proto3,oneof"` } +type task_ListEventFeeds struct { + ListEventFeeds *Task_ListEventFeedsTask `protobuf:"bytes,121,opt,name=list_event_feeds,json=listEventFeeds,proto3,oneof"` +} + +type task_ListEvents struct { + ListEvents *Task_ListEventsTask `protobuf:"bytes,122,opt,name=list_events,json=listEvents,proto3,oneof"` +} + func (*task_None) isTask_TaskType() {} func (*task_Hello) isTask_TaskType() {} @@ -1128,6 +1212,10 @@ func (*task_CreateSyncDiff) isTask_TaskType() {} func (*task_CompactSyncs_) isTask_TaskType() {} +func (*task_ListEventFeeds) isTask_TaskType() {} + +func (*task_ListEvents) isTask_TaskType() {} + type BatonServiceHelloRequest struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_HostId string `protobuf:"bytes,1,opt,name=host_id,json=hostId,proto3"` @@ -2688,6 +2776,191 @@ func (b0 Task_EventFeedTask_builder) Build() *Task_EventFeedTask { return m0 } +type Task_ListEventsTask struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Annotations *[]*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3"` + xxx_hidden_Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3"` + xxx_hidden_StartAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start_at,json=startAt,proto3"` + xxx_hidden_EventFeedId string `protobuf:"bytes,4,opt,name=event_feed_id,json=eventFeedId,proto3"` + xxx_hidden_PageSize uint32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_ListEventsTask) Reset() { + *x = Task_ListEventsTask{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_ListEventsTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_ListEventsTask) ProtoMessage() {} + +func (x *Task_ListEventsTask) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Task_ListEventsTask) GetAnnotations() []*anypb.Any { + if x != nil { + if x.xxx_hidden_Annotations != nil { + return *x.xxx_hidden_Annotations + } + } + return nil +} + +func (x *Task_ListEventsTask) GetCursor() string { + if x != nil { + return x.xxx_hidden_Cursor + } + return "" +} + +func (x *Task_ListEventsTask) GetStartAt() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_StartAt + } + return nil +} + +func (x *Task_ListEventsTask) GetEventFeedId() string { + if x != nil { + return x.xxx_hidden_EventFeedId + } + return "" +} + +func (x *Task_ListEventsTask) GetPageSize() uint32 { + if x != nil { + return x.xxx_hidden_PageSize + } + return 0 +} + +func (x *Task_ListEventsTask) SetAnnotations(v []*anypb.Any) { + x.xxx_hidden_Annotations = &v +} + +func (x *Task_ListEventsTask) SetCursor(v string) { + x.xxx_hidden_Cursor = v +} + +func (x *Task_ListEventsTask) SetStartAt(v *timestamppb.Timestamp) { + x.xxx_hidden_StartAt = v +} + +func (x *Task_ListEventsTask) SetEventFeedId(v string) { + x.xxx_hidden_EventFeedId = v +} + +func (x *Task_ListEventsTask) SetPageSize(v uint32) { + x.xxx_hidden_PageSize = v +} + +func (x *Task_ListEventsTask) HasStartAt() bool { + if x == nil { + return false + } + return x.xxx_hidden_StartAt != nil +} + +func (x *Task_ListEventsTask) ClearStartAt() { + x.xxx_hidden_StartAt = nil +} + +type Task_ListEventsTask_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Annotations []*anypb.Any + Cursor string + StartAt *timestamppb.Timestamp + EventFeedId string + PageSize uint32 +} + +func (b0 Task_ListEventsTask_builder) Build() *Task_ListEventsTask { + m0 := &Task_ListEventsTask{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Annotations = &b.Annotations + x.xxx_hidden_Cursor = b.Cursor + x.xxx_hidden_StartAt = b.StartAt + x.xxx_hidden_EventFeedId = b.EventFeedId + x.xxx_hidden_PageSize = b.PageSize + return m0 +} + +type Task_ListEventFeedsTask struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Annotations *[]*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task_ListEventFeedsTask) Reset() { + *x = Task_ListEventFeedsTask{} + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task_ListEventFeedsTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task_ListEventFeedsTask) ProtoMessage() {} + +func (x *Task_ListEventFeedsTask) ProtoReflect() protoreflect.Message { + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Task_ListEventFeedsTask) GetAnnotations() []*anypb.Any { + if x != nil { + if x.xxx_hidden_Annotations != nil { + return *x.xxx_hidden_Annotations + } + } + return nil +} + +func (x *Task_ListEventFeedsTask) SetAnnotations(v []*anypb.Any) { + x.xxx_hidden_Annotations = &v +} + +type Task_ListEventFeedsTask_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Annotations []*anypb.Any +} + +func (b0 Task_ListEventFeedsTask_builder) Build() *Task_ListEventFeedsTask { + m0 := &Task_ListEventFeedsTask{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Annotations = &b.Annotations + return m0 +} + type Task_GrantTask struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_Entitlement *v2.Entitlement `protobuf:"bytes,1,opt,name=entitlement,proto3"` @@ -2700,7 +2973,7 @@ type Task_GrantTask struct { func (x *Task_GrantTask) Reset() { *x = Task_GrantTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2712,7 +2985,7 @@ func (x *Task_GrantTask) String() string { func (*Task_GrantTask) ProtoMessage() {} func (x *Task_GrantTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[17] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2832,7 +3105,7 @@ type Task_RevokeTask struct { func (x *Task_RevokeTask) Reset() { *x = Task_RevokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2844,7 +3117,7 @@ func (x *Task_RevokeTask) String() string { func (*Task_RevokeTask) ProtoMessage() {} func (x *Task_RevokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[18] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2918,7 +3191,7 @@ type Task_CreateAccountTask struct { func (x *Task_CreateAccountTask) Reset() { *x = Task_CreateAccountTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2930,7 +3203,7 @@ func (x *Task_CreateAccountTask) String() string { func (*Task_CreateAccountTask) ProtoMessage() {} func (x *Task_CreateAccountTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[19] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3038,7 +3311,7 @@ type Task_CreateResourceTask struct { func (x *Task_CreateResourceTask) Reset() { *x = Task_CreateResourceTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3050,7 +3323,7 @@ func (x *Task_CreateResourceTask) String() string { func (*Task_CreateResourceTask) ProtoMessage() {} func (x *Task_CreateResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[20] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3107,7 +3380,7 @@ type Task_DeleteResourceTask struct { func (x *Task_DeleteResourceTask) Reset() { *x = Task_DeleteResourceTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3119,7 +3392,7 @@ func (x *Task_DeleteResourceTask) String() string { func (*Task_DeleteResourceTask) ProtoMessage() {} func (x *Task_DeleteResourceTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[21] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3201,7 +3474,7 @@ type Task_RotateCredentialsTask struct { func (x *Task_RotateCredentialsTask) Reset() { *x = Task_RotateCredentialsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3213,7 +3486,7 @@ func (x *Task_RotateCredentialsTask) String() string { func (*Task_RotateCredentialsTask) ProtoMessage() {} func (x *Task_RotateCredentialsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[22] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3310,7 +3583,7 @@ type Task_CreateTicketTask struct { func (x *Task_CreateTicketTask) Reset() { *x = Task_CreateTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3322,7 +3595,7 @@ func (x *Task_CreateTicketTask) String() string { func (*Task_CreateTicketTask) ProtoMessage() {} func (x *Task_CreateTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[23] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3417,7 +3690,7 @@ type Task_BulkCreateTicketsTask struct { func (x *Task_BulkCreateTicketsTask) Reset() { *x = Task_BulkCreateTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3429,7 +3702,7 @@ func (x *Task_BulkCreateTicketsTask) String() string { func (*Task_BulkCreateTicketsTask) ProtoMessage() {} func (x *Task_BulkCreateTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[24] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3476,7 +3749,7 @@ type Task_BulkGetTicketsTask struct { func (x *Task_BulkGetTicketsTask) Reset() { *x = Task_BulkGetTicketsTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3488,7 +3761,7 @@ func (x *Task_BulkGetTicketsTask) String() string { func (*Task_BulkGetTicketsTask) ProtoMessage() {} func (x *Task_BulkGetTicketsTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[25] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3535,7 +3808,7 @@ type Task_ListTicketSchemasTask struct { func (x *Task_ListTicketSchemasTask) Reset() { *x = Task_ListTicketSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3547,7 +3820,7 @@ func (x *Task_ListTicketSchemasTask) String() string { func (*Task_ListTicketSchemasTask) ProtoMessage() {} func (x *Task_ListTicketSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[26] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3595,7 +3868,7 @@ type Task_GetTicketTask struct { func (x *Task_GetTicketTask) Reset() { *x = Task_GetTicketTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3607,7 +3880,7 @@ func (x *Task_GetTicketTask) String() string { func (*Task_GetTicketTask) ProtoMessage() {} func (x *Task_GetTicketTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[27] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3668,7 +3941,7 @@ type Task_ActionListSchemasTask struct { func (x *Task_ActionListSchemasTask) Reset() { *x = Task_ActionListSchemasTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3680,7 +3953,7 @@ func (x *Task_ActionListSchemasTask) String() string { func (*Task_ActionListSchemasTask) ProtoMessage() {} func (x *Task_ActionListSchemasTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[28] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3742,7 +4015,7 @@ type Task_ActionGetSchemaTask struct { func (x *Task_ActionGetSchemaTask) Reset() { *x = Task_ActionGetSchemaTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3754,7 +4027,7 @@ func (x *Task_ActionGetSchemaTask) String() string { func (*Task_ActionGetSchemaTask) ProtoMessage() {} func (x *Task_ActionGetSchemaTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[29] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3817,7 +4090,7 @@ type Task_ActionInvokeTask struct { func (x *Task_ActionInvokeTask) Reset() { *x = Task_ActionInvokeTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3829,7 +4102,7 @@ func (x *Task_ActionInvokeTask) String() string { func (*Task_ActionInvokeTask) ProtoMessage() {} func (x *Task_ActionInvokeTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[30] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3929,7 +4202,7 @@ type Task_ActionStatusTask struct { func (x *Task_ActionStatusTask) Reset() { *x = Task_ActionStatusTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3941,7 +4214,7 @@ func (x *Task_ActionStatusTask) String() string { func (*Task_ActionStatusTask) ProtoMessage() {} func (x *Task_ActionStatusTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[31] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4016,7 +4289,7 @@ type Task_CreateSyncDiffTask struct { func (x *Task_CreateSyncDiffTask) Reset() { *x = Task_CreateSyncDiffTask{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4028,7 +4301,7 @@ func (x *Task_CreateSyncDiffTask) String() string { func (*Task_CreateSyncDiffTask) ProtoMessage() {} func (x *Task_CreateSyncDiffTask) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[32] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4103,7 +4376,7 @@ type Task_CompactSyncs struct { func (x *Task_CompactSyncs) Reset() { *x = Task_CompactSyncs{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4115,7 +4388,7 @@ func (x *Task_CompactSyncs) String() string { func (*Task_CompactSyncs) ProtoMessage() {} func (x *Task_CompactSyncs) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[33] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4178,7 +4451,7 @@ type Task_CompactSyncs_CompactableSync struct { func (x *Task_CompactSyncs_CompactableSync) Reset() { *x = Task_CompactSyncs_CompactableSync{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4190,7 +4463,7 @@ func (x *Task_CompactSyncs_CompactableSync) String() string { func (*Task_CompactSyncs_CompactableSync) ProtoMessage() {} func (x *Task_CompactSyncs_CompactableSync) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[34] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4250,7 +4523,7 @@ type BatonServiceHelloRequest_BuildInfo struct { func (x *BatonServiceHelloRequest_BuildInfo) Reset() { *x = BatonServiceHelloRequest_BuildInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4262,7 +4535,7 @@ func (x *BatonServiceHelloRequest_BuildInfo) String() string { func (*BatonServiceHelloRequest_BuildInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_BuildInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[35] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4340,7 +4613,7 @@ type BatonServiceHelloRequest_OSInfo struct { func (x *BatonServiceHelloRequest_OSInfo) Reset() { *x = BatonServiceHelloRequest_OSInfo{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4352,7 +4625,7 @@ func (x *BatonServiceHelloRequest_OSInfo) String() string { func (*BatonServiceHelloRequest_OSInfo) ProtoMessage() {} func (x *BatonServiceHelloRequest_OSInfo) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[36] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4490,7 +4763,7 @@ type BatonServiceUploadAssetRequest_UploadMetadata struct { func (x *BatonServiceUploadAssetRequest_UploadMetadata) Reset() { *x = BatonServiceUploadAssetRequest_UploadMetadata{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4502,7 +4775,7 @@ func (x *BatonServiceUploadAssetRequest_UploadMetadata) String() string { func (*BatonServiceUploadAssetRequest_UploadMetadata) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadMetadata) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[37] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4575,7 +4848,7 @@ type BatonServiceUploadAssetRequest_UploadData struct { func (x *BatonServiceUploadAssetRequest_UploadData) Reset() { *x = BatonServiceUploadAssetRequest_UploadData{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4587,7 +4860,7 @@ func (x *BatonServiceUploadAssetRequest_UploadData) String() string { func (*BatonServiceUploadAssetRequest_UploadData) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadData) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[38] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4637,7 +4910,7 @@ type BatonServiceUploadAssetRequest_UploadEOF struct { func (x *BatonServiceUploadAssetRequest_UploadEOF) Reset() { *x = BatonServiceUploadAssetRequest_UploadEOF{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4649,7 +4922,7 @@ func (x *BatonServiceUploadAssetRequest_UploadEOF) String() string { func (*BatonServiceUploadAssetRequest_UploadEOF) ProtoMessage() {} func (x *BatonServiceUploadAssetRequest_UploadEOF) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[39] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4714,7 +4987,7 @@ type BatonServiceFinishTaskRequest_Error struct { func (x *BatonServiceFinishTaskRequest_Error) Reset() { *x = BatonServiceFinishTaskRequest_Error{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4726,7 +4999,7 @@ func (x *BatonServiceFinishTaskRequest_Error) String() string { func (*BatonServiceFinishTaskRequest_Error) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Error) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[40] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4812,7 +5085,7 @@ type BatonServiceFinishTaskRequest_Success struct { func (x *BatonServiceFinishTaskRequest_Success) Reset() { *x = BatonServiceFinishTaskRequest_Success{} - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4824,7 +5097,7 @@ func (x *BatonServiceFinishTaskRequest_Success) String() string { func (*BatonServiceFinishTaskRequest_Success) ProtoMessage() {} func (x *BatonServiceFinishTaskRequest_Success) ProtoReflect() protoreflect.Message { - mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[41] + mi := &file_c1_connectorapi_baton_v1_baton_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4891,7 +5164,7 @@ var File_c1_connectorapi_baton_v1_baton_proto protoreflect.FileDescriptor const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\n" + - "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xb9)\n" + + "$c1/connectorapi/baton/v1/baton.proto\x12\x18c1.connectorapi.baton.v1\x1a\x1fc1/connector/v2/connector.proto\x1a!c1/connector/v2/entitlement.proto\x1a\x1bc1/connector/v2/grant.proto\x1a\x1ec1/connector/v2/resource.proto\x1a\x1cc1/connector/v2/ticket.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17validate/validate.proto\"\xa2-\n" + "\x04Task\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12=\n" + "\x06status\x18\x02 \x01(\x0e2%.c1.connectorapi.baton.v1.Task.StatusR\x06status\x12=\n" + @@ -4917,7 +5190,10 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\raction_invoke\x18u \x01(\v2/.c1.connectorapi.baton.v1.Task.ActionInvokeTaskH\x00R\factionInvoke\x12V\n" + "\raction_status\x18v \x01(\v2/.c1.connectorapi.baton.v1.Task.ActionStatusTaskH\x00R\factionStatus\x12]\n" + "\x10create_sync_diff\x18w \x01(\v21.c1.connectorapi.baton.v1.Task.CreateSyncDiffTaskH\x00R\x0ecreateSyncDiff\x12R\n" + - "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12\x14\n" + + "\rcompact_syncs\x18x \x01(\v2+.c1.connectorapi.baton.v1.Task.CompactSyncsH\x00R\fcompactSyncs\x12]\n" + + "\x10list_event_feeds\x18y \x01(\v21.c1.connectorapi.baton.v1.Task.ListEventFeedsTaskH\x00R\x0elistEventFeeds\x12P\n" + + "\vlist_events\x18z \x01(\v2-.c1.connectorapi.baton.v1.Task.ListEventsTaskH\x00R\n" + + "listEvents\x12\x14\n" + "\x05debug\x18\x03 \x01(\bR\x05debug\x1aB\n" + "\bNoneTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1aC\n" + @@ -4930,7 +5206,16 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x17targeted_sync_resources\x18\x04 \x03(\v2\x19.c1.connector.v2.ResourceR\x15targetedSyncResources\x1a~\n" + "\rEventFeedTask\x126\n" + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x125\n" + - "\bstart_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x1a\xf3\x01\n" + + "\bstart_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x1a\xe7\x01\n" + + "\x0eListEventsTask\x126\n" + + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12%\n" + + "\x06cursor\x18\x02 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80 \xd0\x01\x01R\x06cursor\x125\n" + + "\bstart_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\astartAt\x12\"\n" + + "\revent_feed_id\x18\x04 \x01(\tR\veventFeedId\x12\x1b\n" + + "\tpage_size\x18\x05 \x01(\rR\bpageSize\x1aL\n" + + "\x12ListEventFeedsTask\x126\n" + + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\xf3\x01\n" + "\tGrantTask\x12>\n" + "\ventitlement\x18\x01 \x01(\v2\x1c.c1.connector.v2.EntitlementR\ventitlement\x127\n" + "\tprincipal\x18\x02 \x01(\v2\x19.c1.connector.v2.ResourceR\tprincipal\x126\n" + @@ -5105,7 +5390,7 @@ const file_c1_connectorapi_baton_v1_baton_proto_rawDesc = "" + "\x0eStartDebugging\x12/.c1.connectorapi.baton.v1.StartDebuggingRequest\x1a0.c1.connectorapi.baton.v1.StartDebuggingResponse\"\x00B7Z5gitlab.com/ductone/c1/pkg/pb/c1/connectorapi/baton/v1b\x06proto3" var file_c1_connectorapi_baton_v1_baton_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 42) +var file_c1_connectorapi_baton_v1_baton_proto_msgTypes = make([]protoimpl.MessageInfo, 44) var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (Task_Status)(0), // 0: c1.connectorapi.baton.v1.Task.Status (*Task)(nil), // 1: c1.connectorapi.baton.v1.Task @@ -5125,149 +5410,156 @@ var file_c1_connectorapi_baton_v1_baton_proto_goTypes = []any{ (*Task_HelloTask)(nil), // 15: c1.connectorapi.baton.v1.Task.HelloTask (*Task_SyncFullTask)(nil), // 16: c1.connectorapi.baton.v1.Task.SyncFullTask (*Task_EventFeedTask)(nil), // 17: c1.connectorapi.baton.v1.Task.EventFeedTask - (*Task_GrantTask)(nil), // 18: c1.connectorapi.baton.v1.Task.GrantTask - (*Task_RevokeTask)(nil), // 19: c1.connectorapi.baton.v1.Task.RevokeTask - (*Task_CreateAccountTask)(nil), // 20: c1.connectorapi.baton.v1.Task.CreateAccountTask - (*Task_CreateResourceTask)(nil), // 21: c1.connectorapi.baton.v1.Task.CreateResourceTask - (*Task_DeleteResourceTask)(nil), // 22: c1.connectorapi.baton.v1.Task.DeleteResourceTask - (*Task_RotateCredentialsTask)(nil), // 23: c1.connectorapi.baton.v1.Task.RotateCredentialsTask - (*Task_CreateTicketTask)(nil), // 24: c1.connectorapi.baton.v1.Task.CreateTicketTask - (*Task_BulkCreateTicketsTask)(nil), // 25: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - (*Task_BulkGetTicketsTask)(nil), // 26: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - (*Task_ListTicketSchemasTask)(nil), // 27: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - (*Task_GetTicketTask)(nil), // 28: c1.connectorapi.baton.v1.Task.GetTicketTask - (*Task_ActionListSchemasTask)(nil), // 29: c1.connectorapi.baton.v1.Task.ActionListSchemasTask - (*Task_ActionGetSchemaTask)(nil), // 30: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - (*Task_ActionInvokeTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionInvokeTask - (*Task_ActionStatusTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionStatusTask - (*Task_CreateSyncDiffTask)(nil), // 33: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - (*Task_CompactSyncs)(nil), // 34: c1.connectorapi.baton.v1.Task.CompactSyncs - (*Task_CompactSyncs_CompactableSync)(nil), // 35: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - (*BatonServiceHelloRequest_BuildInfo)(nil), // 36: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - (*BatonServiceHelloRequest_OSInfo)(nil), // 37: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - (*BatonServiceUploadAssetRequest_UploadData)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - (*BatonServiceFinishTaskRequest_Error)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - (*BatonServiceFinishTaskRequest_Success)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - (*v2.ConnectorMetadata)(nil), // 43: c1.connector.v2.ConnectorMetadata - (*anypb.Any)(nil), // 44: google.protobuf.Any - (*durationpb.Duration)(nil), // 45: google.protobuf.Duration - (*status.Status)(nil), // 46: google.rpc.Status - (*v2.Resource)(nil), // 47: c1.connector.v2.Resource - (*timestamppb.Timestamp)(nil), // 48: google.protobuf.Timestamp - (*v2.Entitlement)(nil), // 49: c1.connector.v2.Entitlement - (*v2.Grant)(nil), // 50: c1.connector.v2.Grant - (*v2.AccountInfo)(nil), // 51: c1.connector.v2.AccountInfo - (*v2.CredentialOptions)(nil), // 52: c1.connector.v2.CredentialOptions - (*v2.EncryptionConfig)(nil), // 53: c1.connector.v2.EncryptionConfig - (*v2.ResourceId)(nil), // 54: c1.connector.v2.ResourceId - (*v2.TicketRequest)(nil), // 55: c1.connector.v2.TicketRequest - (*v2.TicketSchema)(nil), // 56: c1.connector.v2.TicketSchema - (*structpb.Struct)(nil), // 57: google.protobuf.Struct + (*Task_ListEventsTask)(nil), // 18: c1.connectorapi.baton.v1.Task.ListEventsTask + (*Task_ListEventFeedsTask)(nil), // 19: c1.connectorapi.baton.v1.Task.ListEventFeedsTask + (*Task_GrantTask)(nil), // 20: c1.connectorapi.baton.v1.Task.GrantTask + (*Task_RevokeTask)(nil), // 21: c1.connectorapi.baton.v1.Task.RevokeTask + (*Task_CreateAccountTask)(nil), // 22: c1.connectorapi.baton.v1.Task.CreateAccountTask + (*Task_CreateResourceTask)(nil), // 23: c1.connectorapi.baton.v1.Task.CreateResourceTask + (*Task_DeleteResourceTask)(nil), // 24: c1.connectorapi.baton.v1.Task.DeleteResourceTask + (*Task_RotateCredentialsTask)(nil), // 25: c1.connectorapi.baton.v1.Task.RotateCredentialsTask + (*Task_CreateTicketTask)(nil), // 26: c1.connectorapi.baton.v1.Task.CreateTicketTask + (*Task_BulkCreateTicketsTask)(nil), // 27: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + (*Task_BulkGetTicketsTask)(nil), // 28: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + (*Task_ListTicketSchemasTask)(nil), // 29: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + (*Task_GetTicketTask)(nil), // 30: c1.connectorapi.baton.v1.Task.GetTicketTask + (*Task_ActionListSchemasTask)(nil), // 31: c1.connectorapi.baton.v1.Task.ActionListSchemasTask + (*Task_ActionGetSchemaTask)(nil), // 32: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + (*Task_ActionInvokeTask)(nil), // 33: c1.connectorapi.baton.v1.Task.ActionInvokeTask + (*Task_ActionStatusTask)(nil), // 34: c1.connectorapi.baton.v1.Task.ActionStatusTask + (*Task_CreateSyncDiffTask)(nil), // 35: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + (*Task_CompactSyncs)(nil), // 36: c1.connectorapi.baton.v1.Task.CompactSyncs + (*Task_CompactSyncs_CompactableSync)(nil), // 37: c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + (*BatonServiceHelloRequest_BuildInfo)(nil), // 38: c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + (*BatonServiceHelloRequest_OSInfo)(nil), // 39: c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + (*BatonServiceUploadAssetRequest_UploadMetadata)(nil), // 40: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + (*BatonServiceUploadAssetRequest_UploadData)(nil), // 41: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + (*BatonServiceUploadAssetRequest_UploadEOF)(nil), // 42: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + (*BatonServiceFinishTaskRequest_Error)(nil), // 43: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + (*BatonServiceFinishTaskRequest_Success)(nil), // 44: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + (*v2.ConnectorMetadata)(nil), // 45: c1.connector.v2.ConnectorMetadata + (*anypb.Any)(nil), // 46: google.protobuf.Any + (*durationpb.Duration)(nil), // 47: google.protobuf.Duration + (*status.Status)(nil), // 48: google.rpc.Status + (*v2.Resource)(nil), // 49: c1.connector.v2.Resource + (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp + (*v2.Entitlement)(nil), // 51: c1.connector.v2.Entitlement + (*v2.Grant)(nil), // 52: c1.connector.v2.Grant + (*v2.AccountInfo)(nil), // 53: c1.connector.v2.AccountInfo + (*v2.CredentialOptions)(nil), // 54: c1.connector.v2.CredentialOptions + (*v2.EncryptionConfig)(nil), // 55: c1.connector.v2.EncryptionConfig + (*v2.ResourceId)(nil), // 56: c1.connector.v2.ResourceId + (*v2.TicketRequest)(nil), // 57: c1.connector.v2.TicketRequest + (*v2.TicketSchema)(nil), // 58: c1.connector.v2.TicketSchema + (*structpb.Struct)(nil), // 59: google.protobuf.Struct } var file_c1_connectorapi_baton_v1_baton_proto_depIdxs = []int32{ 0, // 0: c1.connectorapi.baton.v1.Task.status:type_name -> c1.connectorapi.baton.v1.Task.Status 14, // 1: c1.connectorapi.baton.v1.Task.none:type_name -> c1.connectorapi.baton.v1.Task.NoneTask 15, // 2: c1.connectorapi.baton.v1.Task.hello:type_name -> c1.connectorapi.baton.v1.Task.HelloTask 16, // 3: c1.connectorapi.baton.v1.Task.sync_full:type_name -> c1.connectorapi.baton.v1.Task.SyncFullTask - 18, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask - 19, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask - 20, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask - 21, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask - 22, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask - 23, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask + 20, // 4: c1.connectorapi.baton.v1.Task.grant:type_name -> c1.connectorapi.baton.v1.Task.GrantTask + 21, // 5: c1.connectorapi.baton.v1.Task.revoke:type_name -> c1.connectorapi.baton.v1.Task.RevokeTask + 22, // 6: c1.connectorapi.baton.v1.Task.create_account:type_name -> c1.connectorapi.baton.v1.Task.CreateAccountTask + 23, // 7: c1.connectorapi.baton.v1.Task.create_resource:type_name -> c1.connectorapi.baton.v1.Task.CreateResourceTask + 24, // 8: c1.connectorapi.baton.v1.Task.delete_resource:type_name -> c1.connectorapi.baton.v1.Task.DeleteResourceTask + 25, // 9: c1.connectorapi.baton.v1.Task.rotate_credentials:type_name -> c1.connectorapi.baton.v1.Task.RotateCredentialsTask 17, // 10: c1.connectorapi.baton.v1.Task.event_feed:type_name -> c1.connectorapi.baton.v1.Task.EventFeedTask - 24, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 27, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask - 28, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 25, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask - 26, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask - 29, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask - 30, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask - 31, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask - 32, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask - 33, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask - 34, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs - 36, // 22: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo - 37, // 23: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo - 43, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata - 44, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any - 44, // 26: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any - 1, // 27: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task - 45, // 28: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration - 45, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration - 44, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any - 44, // 31: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any - 45, // 32: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration - 44, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any - 38, // 34: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata - 39, // 35: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData - 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF - 44, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any - 46, // 38: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status - 41, // 39: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error - 42, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success - 44, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any - 44, // 42: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any - 44, // 43: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any - 44, // 44: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any - 47, // 45: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource - 44, // 46: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any - 48, // 47: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp - 49, // 48: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement - 47, // 49: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource - 44, // 50: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any - 45, // 51: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration - 50, // 52: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant - 44, // 53: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any - 51, // 54: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo - 52, // 55: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 53, // 56: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 47, // 57: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource - 54, // 58: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId - 54, // 59: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId - 54, // 60: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId - 52, // 61: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions - 53, // 62: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig - 55, // 63: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest - 56, // 64: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema - 44, // 65: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any - 24, // 66: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask - 28, // 67: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask - 44, // 68: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any - 44, // 69: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any - 44, // 70: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any - 44, // 71: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any - 57, // 72: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct - 44, // 73: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any - 44, // 74: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any - 44, // 75: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any - 35, // 76: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync - 44, // 77: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any - 44, // 78: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any - 44, // 79: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any - 44, // 80: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any - 44, // 81: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any - 44, // 82: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any - 44, // 83: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any - 2, // 84: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest - 4, // 85: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest - 6, // 86: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest - 10, // 87: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest - 8, // 88: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest - 12, // 89: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest - 3, // 90: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse - 5, // 91: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse - 7, // 92: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse - 11, // 93: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse - 9, // 94: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse - 13, // 95: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse - 90, // [90:96] is the sub-list for method output_type - 84, // [84:90] is the sub-list for method input_type - 84, // [84:84] is the sub-list for extension type_name - 84, // [84:84] is the sub-list for extension extendee - 0, // [0:84] is the sub-list for field type_name + 26, // 11: c1.connectorapi.baton.v1.Task.create_ticket_task:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 29, // 12: c1.connectorapi.baton.v1.Task.list_ticket_schemas:type_name -> c1.connectorapi.baton.v1.Task.ListTicketSchemasTask + 30, // 13: c1.connectorapi.baton.v1.Task.get_ticket:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 27, // 14: c1.connectorapi.baton.v1.Task.bulk_create_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask + 28, // 15: c1.connectorapi.baton.v1.Task.bulk_get_tickets:type_name -> c1.connectorapi.baton.v1.Task.BulkGetTicketsTask + 31, // 16: c1.connectorapi.baton.v1.Task.action_list_schemas:type_name -> c1.connectorapi.baton.v1.Task.ActionListSchemasTask + 32, // 17: c1.connectorapi.baton.v1.Task.action_get_schema:type_name -> c1.connectorapi.baton.v1.Task.ActionGetSchemaTask + 33, // 18: c1.connectorapi.baton.v1.Task.action_invoke:type_name -> c1.connectorapi.baton.v1.Task.ActionInvokeTask + 34, // 19: c1.connectorapi.baton.v1.Task.action_status:type_name -> c1.connectorapi.baton.v1.Task.ActionStatusTask + 35, // 20: c1.connectorapi.baton.v1.Task.create_sync_diff:type_name -> c1.connectorapi.baton.v1.Task.CreateSyncDiffTask + 36, // 21: c1.connectorapi.baton.v1.Task.compact_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs + 19, // 22: c1.connectorapi.baton.v1.Task.list_event_feeds:type_name -> c1.connectorapi.baton.v1.Task.ListEventFeedsTask + 18, // 23: c1.connectorapi.baton.v1.Task.list_events:type_name -> c1.connectorapi.baton.v1.Task.ListEventsTask + 38, // 24: c1.connectorapi.baton.v1.BatonServiceHelloRequest.build_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.BuildInfo + 39, // 25: c1.connectorapi.baton.v1.BatonServiceHelloRequest.os_info:type_name -> c1.connectorapi.baton.v1.BatonServiceHelloRequest.OSInfo + 45, // 26: c1.connectorapi.baton.v1.BatonServiceHelloRequest.connector_metadata:type_name -> c1.connector.v2.ConnectorMetadata + 46, // 27: c1.connectorapi.baton.v1.BatonServiceHelloRequest.annotations:type_name -> google.protobuf.Any + 46, // 28: c1.connectorapi.baton.v1.BatonServiceHelloResponse.annotations:type_name -> google.protobuf.Any + 1, // 29: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.task:type_name -> c1.connectorapi.baton.v1.Task + 47, // 30: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_poll:type_name -> google.protobuf.Duration + 47, // 31: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.next_heartbeat:type_name -> google.protobuf.Duration + 46, // 32: c1.connectorapi.baton.v1.BatonServiceGetTaskResponse.annotations:type_name -> google.protobuf.Any + 46, // 33: c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest.annotations:type_name -> google.protobuf.Any + 47, // 34: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.next_heartbeat:type_name -> google.protobuf.Duration + 46, // 35: c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse.annotations:type_name -> google.protobuf.Any + 40, // 36: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.metadata:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata + 41, // 37: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.data:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadData + 42, // 38: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.eof:type_name -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF + 46, // 39: c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse.annotations:type_name -> google.protobuf.Any + 48, // 40: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.status:type_name -> google.rpc.Status + 43, // 41: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.error:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error + 44, // 42: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.success:type_name -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success + 46, // 43: c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse.annotations:type_name -> google.protobuf.Any + 46, // 44: c1.connectorapi.baton.v1.Task.NoneTask.annotations:type_name -> google.protobuf.Any + 46, // 45: c1.connectorapi.baton.v1.Task.HelloTask.annotations:type_name -> google.protobuf.Any + 46, // 46: c1.connectorapi.baton.v1.Task.SyncFullTask.annotations:type_name -> google.protobuf.Any + 49, // 47: c1.connectorapi.baton.v1.Task.SyncFullTask.targeted_sync_resources:type_name -> c1.connector.v2.Resource + 46, // 48: c1.connectorapi.baton.v1.Task.EventFeedTask.annotations:type_name -> google.protobuf.Any + 50, // 49: c1.connectorapi.baton.v1.Task.EventFeedTask.start_at:type_name -> google.protobuf.Timestamp + 46, // 50: c1.connectorapi.baton.v1.Task.ListEventsTask.annotations:type_name -> google.protobuf.Any + 50, // 51: c1.connectorapi.baton.v1.Task.ListEventsTask.start_at:type_name -> google.protobuf.Timestamp + 46, // 52: c1.connectorapi.baton.v1.Task.ListEventFeedsTask.annotations:type_name -> google.protobuf.Any + 51, // 53: c1.connectorapi.baton.v1.Task.GrantTask.entitlement:type_name -> c1.connector.v2.Entitlement + 49, // 54: c1.connectorapi.baton.v1.Task.GrantTask.principal:type_name -> c1.connector.v2.Resource + 46, // 55: c1.connectorapi.baton.v1.Task.GrantTask.annotations:type_name -> google.protobuf.Any + 47, // 56: c1.connectorapi.baton.v1.Task.GrantTask.duration:type_name -> google.protobuf.Duration + 52, // 57: c1.connectorapi.baton.v1.Task.RevokeTask.grant:type_name -> c1.connector.v2.Grant + 46, // 58: c1.connectorapi.baton.v1.Task.RevokeTask.annotations:type_name -> google.protobuf.Any + 53, // 59: c1.connectorapi.baton.v1.Task.CreateAccountTask.account_info:type_name -> c1.connector.v2.AccountInfo + 54, // 60: c1.connectorapi.baton.v1.Task.CreateAccountTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 55, // 61: c1.connectorapi.baton.v1.Task.CreateAccountTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 49, // 62: c1.connectorapi.baton.v1.Task.CreateResourceTask.resource:type_name -> c1.connector.v2.Resource + 56, // 63: c1.connectorapi.baton.v1.Task.DeleteResourceTask.resource_id:type_name -> c1.connector.v2.ResourceId + 56, // 64: c1.connectorapi.baton.v1.Task.DeleteResourceTask.parent_resource_id:type_name -> c1.connector.v2.ResourceId + 56, // 65: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.resource_id:type_name -> c1.connector.v2.ResourceId + 54, // 66: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.credential_options:type_name -> c1.connector.v2.CredentialOptions + 55, // 67: c1.connectorapi.baton.v1.Task.RotateCredentialsTask.encryption_configs:type_name -> c1.connector.v2.EncryptionConfig + 57, // 68: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_request:type_name -> c1.connector.v2.TicketRequest + 58, // 69: c1.connectorapi.baton.v1.Task.CreateTicketTask.ticket_schema:type_name -> c1.connector.v2.TicketSchema + 46, // 70: c1.connectorapi.baton.v1.Task.CreateTicketTask.annotations:type_name -> google.protobuf.Any + 26, // 71: c1.connectorapi.baton.v1.Task.BulkCreateTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.CreateTicketTask + 30, // 72: c1.connectorapi.baton.v1.Task.BulkGetTicketsTask.ticket_requests:type_name -> c1.connectorapi.baton.v1.Task.GetTicketTask + 46, // 73: c1.connectorapi.baton.v1.Task.ListTicketSchemasTask.annotations:type_name -> google.protobuf.Any + 46, // 74: c1.connectorapi.baton.v1.Task.GetTicketTask.annotations:type_name -> google.protobuf.Any + 46, // 75: c1.connectorapi.baton.v1.Task.ActionListSchemasTask.annotations:type_name -> google.protobuf.Any + 46, // 76: c1.connectorapi.baton.v1.Task.ActionGetSchemaTask.annotations:type_name -> google.protobuf.Any + 59, // 77: c1.connectorapi.baton.v1.Task.ActionInvokeTask.args:type_name -> google.protobuf.Struct + 46, // 78: c1.connectorapi.baton.v1.Task.ActionInvokeTask.annotations:type_name -> google.protobuf.Any + 46, // 79: c1.connectorapi.baton.v1.Task.ActionStatusTask.annotations:type_name -> google.protobuf.Any + 46, // 80: c1.connectorapi.baton.v1.Task.CreateSyncDiffTask.annotations:type_name -> google.protobuf.Any + 37, // 81: c1.connectorapi.baton.v1.Task.CompactSyncs.compactable_syncs:type_name -> c1.connectorapi.baton.v1.Task.CompactSyncs.CompactableSync + 46, // 82: c1.connectorapi.baton.v1.Task.CompactSyncs.annotations:type_name -> google.protobuf.Any + 46, // 83: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadMetadata.annotations:type_name -> google.protobuf.Any + 46, // 84: c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest.UploadEOF.annotations:type_name -> google.protobuf.Any + 46, // 85: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.annotations:type_name -> google.protobuf.Any + 46, // 86: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Error.response:type_name -> google.protobuf.Any + 46, // 87: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.annotations:type_name -> google.protobuf.Any + 46, // 88: c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest.Success.response:type_name -> google.protobuf.Any + 2, // 89: c1.connectorapi.baton.v1.BatonService.Hello:input_type -> c1.connectorapi.baton.v1.BatonServiceHelloRequest + 4, // 90: c1.connectorapi.baton.v1.BatonService.GetTask:input_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskRequest + 6, // 91: c1.connectorapi.baton.v1.BatonService.Heartbeat:input_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatRequest + 10, // 92: c1.connectorapi.baton.v1.BatonService.FinishTask:input_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskRequest + 8, // 93: c1.connectorapi.baton.v1.BatonService.UploadAsset:input_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetRequest + 12, // 94: c1.connectorapi.baton.v1.BatonService.StartDebugging:input_type -> c1.connectorapi.baton.v1.StartDebuggingRequest + 3, // 95: c1.connectorapi.baton.v1.BatonService.Hello:output_type -> c1.connectorapi.baton.v1.BatonServiceHelloResponse + 5, // 96: c1.connectorapi.baton.v1.BatonService.GetTask:output_type -> c1.connectorapi.baton.v1.BatonServiceGetTaskResponse + 7, // 97: c1.connectorapi.baton.v1.BatonService.Heartbeat:output_type -> c1.connectorapi.baton.v1.BatonServiceHeartbeatResponse + 11, // 98: c1.connectorapi.baton.v1.BatonService.FinishTask:output_type -> c1.connectorapi.baton.v1.BatonServiceFinishTaskResponse + 9, // 99: c1.connectorapi.baton.v1.BatonService.UploadAsset:output_type -> c1.connectorapi.baton.v1.BatonServiceUploadAssetResponse + 13, // 100: c1.connectorapi.baton.v1.BatonService.StartDebugging:output_type -> c1.connectorapi.baton.v1.StartDebuggingResponse + 95, // [95:101] is the sub-list for method output_type + 89, // [89:95] is the sub-list for method input_type + 89, // [89:89] is the sub-list for extension type_name + 89, // [89:89] is the sub-list for extension extendee + 0, // [0:89] is the sub-list for field type_name } func init() { file_c1_connectorapi_baton_v1_baton_proto_init() } @@ -5297,6 +5589,8 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { (*task_ActionStatus)(nil), (*task_CreateSyncDiff)(nil), (*task_CompactSyncs_)(nil), + (*task_ListEventFeeds)(nil), + (*task_ListEvents)(nil), } file_c1_connectorapi_baton_v1_baton_proto_msgTypes[7].OneofWrappers = []any{ (*batonServiceUploadAssetRequest_Metadata)(nil), @@ -5313,7 +5607,7 @@ func file_c1_connectorapi_baton_v1_baton_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_c1_connectorapi_baton_v1_baton_proto_rawDesc), len(file_c1_connectorapi_baton_v1_baton_proto_rawDesc)), NumEnums: 1, - NumMessages: 42, + NumMessages: 44, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go index e9ebbb7f..2f28d591 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/connectorbuilder/resource_manager.go @@ -37,7 +37,7 @@ type ResourceManagerV2Limited interface { // // This is the recommended interface for implementing resource creation operations in new connectors. type ResourceManagerV2 interface { - ResourceSyncer + ResourceSyncerV2 ResourceManagerV2Limited } @@ -62,7 +62,7 @@ type ResourceDeleterLimited interface { // This is the recommended interface for implementing resource deletion operations in new connectors. // It differs from ResourceDeleter by having the resource, not just the id. type ResourceDeleterV2 interface { - ResourceSyncer + ResourceSyncerV2 ResourceDeleterV2Limited } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go index 296da43f..8528537b 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/dotc1z/sql_helpers.go @@ -83,6 +83,11 @@ type hasPrincipalResourceTypeIDsListRequest interface { GetPrincipalResourceTypeIds() []string } +type hasParentResourceIdListRequest interface { + listRequest + GetParentResourceId() *v2.ResourceId +} + type protoHasID interface { proto.Message GetId() string @@ -189,6 +194,14 @@ func listConnectorObjects[T proto.Message](ctx context.Context, c *C1File, table } } + if parentResourceIdReq, ok := req.(hasParentResourceIdListRequest); ok { + p := parentResourceIdReq.GetParentResourceId() + if p != nil && p.GetResource() != "" { + q = q.Where(goqu.C("parent_resource_id").Eq(p.GetResource())) + q = q.Where(goqu.C("parent_resource_type_id").Eq(p.GetResourceType())) + } + } + // If a sync is running, be sure we only select from the current values switch { case reqSyncID != "": diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go index b3cfeeac..b75ca3bf 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/sdk/version.go @@ -1,3 +1,3 @@ package sdk -const Version = "v0.7.9" +const Version = "v0.7.10" diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go index db0e64d4..b5590414 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/tasks.go @@ -68,6 +68,10 @@ func Is(task *v1.Task, target taskTypes.TaskType) bool { return actualType == v1.Task_ActionStatus_case case taskTypes.CreateSyncDiff: return actualType == v1.Task_CreateSyncDiff_case + case taskTypes.ListEventFeedsType: + return actualType == v1.Task_ListEventFeeds_case + case taskTypes.ListEventsType: + return actualType == v1.Task_ListEvents_case default: return false } @@ -119,6 +123,10 @@ func GetType(task *v1.Task) taskTypes.TaskType { return taskTypes.ActionStatusType case v1.Task_CreateSyncDiff_case: return taskTypes.CreateSyncDiff + case v1.Task_ListEventFeeds_case: + return taskTypes.ListEventFeedsType + case v1.Task_ListEvents_case: + return taskTypes.ListEventsType default: return taskTypes.UnknownType } diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index 34c9ae76..63541994 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -92,9 +92,6 @@ var ARM64 struct { HasSHA2 bool // SHA2 hardware implementation HasCRC32 bool // CRC32 hardware implementation HasATOMICS bool // Atomic memory operation instruction set - HasHPDS bool // Hierarchical permission disables in translations tables - HasLOR bool // Limited ordering regions - HasPAN bool // Privileged access never HasFPHP bool // Half precision floating-point instruction set HasASIMDHP bool // Advanced SIMD half precision instruction set HasCPUID bool // CPUID identification scheme registers diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go index f449c679..af2aa99f 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -65,10 +65,10 @@ func setMinimalFeatures() { func readARM64Registers() { Initialized = true - parseARM64SystemRegisters(getisar0(), getisar1(), getmmfr1(), getpfr0()) + parseARM64SystemRegisters(getisar0(), getisar1(), getpfr0()) } -func parseARM64SystemRegisters(isar0, isar1, mmfr1, pfr0 uint64) { +func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { // ID_AA64ISAR0_EL1 switch extractBits(isar0, 4, 7) { case 1: @@ -152,22 +152,6 @@ func parseARM64SystemRegisters(isar0, isar1, mmfr1, pfr0 uint64) { ARM64.HasI8MM = true } - // ID_AA64MMFR1_EL1 - switch extractBits(mmfr1, 12, 15) { - case 1, 2: - ARM64.HasHPDS = true - } - - switch extractBits(mmfr1, 16, 19) { - case 1: - ARM64.HasLOR = true - } - - switch extractBits(mmfr1, 20, 23) { - case 1, 2, 3: - ARM64.HasPAN = true - } - // ID_AA64PFR0_EL1 switch extractBits(pfr0, 16, 19) { case 0: diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s index a4f24b3b..3b0450a0 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -20,13 +20,6 @@ TEXT ·getisar1(SB),NOSPLIT,$0-8 MOVD R0, ret+0(FP) RET -// func getmmfr1() uint64 -TEXT ·getmmfr1(SB),NOSPLIT,$0-8 - // get Memory Model Feature Register 1 into x0 - MRS ID_AA64MMFR1_EL1, R0 - MOVD R0, ret+0(FP) - RET - // func getpfr0() uint64 TEXT ·getpfr0(SB),NOSPLIT,$0-8 // get Processor Feature Register 0 into x0 diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go index e3fc5a8d..6ac6e1ef 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -8,6 +8,5 @@ package cpu func getisar0() uint64 func getisar1() uint64 -func getmmfr1() uint64 func getpfr0() uint64 func getzfr0() uint64 diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go index 8df2079e..7f194678 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go @@ -8,5 +8,4 @@ package cpu func getisar0() uint64 { return 0 } func getisar1() uint64 { return 0 } -func getmmfr1() uint64 { return 0 } func getpfr0() uint64 { return 0 } diff --git a/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go index 19aea063..ebfb3fc8 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go @@ -167,7 +167,7 @@ func doinit() { setMinimalFeatures() return } - parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64mmfr1, cpuid.aa64pfr0) + parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64pfr0) Initialized = true } diff --git a/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go index 87fd3a77..85b64d5c 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go @@ -59,7 +59,7 @@ func doinit() { if !ok { return } - parseARM64SystemRegisters(isar0, isar1, 0, 0) + parseARM64SystemRegisters(isar0, isar1, 0) Initialized = true } diff --git a/vendor/modules.txt b/vendor/modules.txt index ba42c1d4..b3aeee38 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -18,8 +18,8 @@ github.com/aws/aws-lambda-go/lambda github.com/aws/aws-lambda-go/lambda/handlertrace github.com/aws/aws-lambda-go/lambda/messages github.com/aws/aws-lambda-go/lambdacontext -# github.com/aws/aws-sdk-go-v2 v1.36.3 -## explicit; go 1.22 +# github.com/aws/aws-sdk-go-v2 v1.41.0 +## explicit; go 1.23 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/arn github.com/aws/aws-sdk-go-v2/aws/defaults @@ -124,8 +124,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc/types github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.22.2 -## explicit; go 1.21 +# github.com/aws/smithy-go v1.24.0 +## explicit; go 1.23 github.com/aws/smithy-go github.com/aws/smithy-go/auth github.com/aws/smithy-go/auth/bearer @@ -156,10 +156,13 @@ github.com/aws/smithy-go/waiter # github.com/benbjohnson/clock v1.3.5 ## explicit; go 1.15 github.com/benbjohnson/clock -# github.com/cenkalti/backoff/v4 v4.3.0 -## explicit; go 1.18 -github.com/cenkalti/backoff/v4 -# github.com/conductorone/baton-sdk v0.7.10 +# github.com/cenkalti/backoff/v5 v5.0.3 +## explicit; go 1.23 +github.com/cenkalti/backoff/v5 +# github.com/cespare/xxhash/v2 v2.3.0 +## explicit; go 1.11 +github.com/cespare/xxhash/v2 +# github.com/conductorone/baton-sdk v0.7.12 ## explicit; go 1.25.2 github.com/conductorone/baton-sdk/internal/connector github.com/conductorone/baton-sdk/pb/c1/c1z/v1 @@ -269,13 +272,13 @@ github.com/fsnotify/fsnotify/internal # github.com/glebarez/go-sqlite v1.22.0 ## explicit; go 1.17 github.com/glebarez/go-sqlite -# github.com/go-jose/go-jose/v4 v4.0.5 -## explicit; go 1.21 +# github.com/go-jose/go-jose/v4 v4.1.3 +## explicit; go 1.24.0 github.com/go-jose/go-jose/v4 github.com/go-jose/go-jose/v4/cipher github.com/go-jose/go-jose/v4/json github.com/go-jose/go-jose/v4/jwt -# github.com/go-logr/logr v1.4.2 +# github.com/go-logr/logr v1.4.3 ## explicit; go 1.18 github.com/go-logr/logr github.com/go-logr/logr/funcr @@ -318,8 +321,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap github.com/grpc-ecosystem/go-grpc-middleware/recovery github.com/grpc-ecosystem/go-grpc-middleware/tags github.com/grpc-ecosystem/go-grpc-middleware/validator -# github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 -## explicit; go 1.22 +# github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 +## explicit; go 1.24.0 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/runtime github.com/grpc-ecosystem/grpc-gateway/v2/utilities @@ -488,78 +491,88 @@ github.com/tklauser/numcpus # github.com/yusufpapurcu/wmi v1.2.4 ## explicit; go 1.16 github.com/yusufpapurcu/wmi -# go.opentelemetry.io/auto/sdk v1.1.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/auto/sdk v1.2.1 +## explicit; go 1.24.0 go.opentelemetry.io/auto/sdk go.opentelemetry.io/auto/sdk/internal/telemetry -# go.opentelemetry.io/contrib/bridges/otelzap v0.10.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/contrib/bridges/otelzap v0.14.0 +## explicit; go 1.24.0 go.opentelemetry.io/contrib/bridges/otelzap -# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 +## explicit; go 1.23.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal -# go.opentelemetry.io/otel v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel v1.39.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute +go.opentelemetry.io/otel/attribute/internal +go.opentelemetry.io/otel/attribute/internal/xxhash go.opentelemetry.io/otel/baggage go.opentelemetry.io/otel/codes -go.opentelemetry.io/otel/internal -go.opentelemetry.io/otel/internal/attribute go.opentelemetry.io/otel/internal/baggage go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation -go.opentelemetry.io/otel/semconv/v1.17.0 -go.opentelemetry.io/otel/semconv/v1.26.0 go.opentelemetry.io/otel/semconv/v1.27.0 -# go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 -## explicit; go 1.22.0 +go.opentelemetry.io/otel/semconv/v1.37.0 +go.opentelemetry.io/otel/semconv/v1.37.0/otelconv +go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv +# go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.15.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/observ go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/retry go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/transform -# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 -## explicit; go 1.22.0 +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/internal/x +# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform -# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry -# go.opentelemetry.io/otel/log v0.11.0 -## explicit; go 1.22.0 +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x +# go.opentelemetry.io/otel/log v0.15.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel/log go.opentelemetry.io/otel/log/embedded go.opentelemetry.io/otel/log/global go.opentelemetry.io/otel/log/internal/global go.opentelemetry.io/otel/log/noop -# go.opentelemetry.io/otel/metric v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/metric v1.39.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded go.opentelemetry.io/otel/metric/noop -# go.opentelemetry.io/otel/sdk v1.35.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/otel/sdk v1.39.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/sdk/instrumentation -go.opentelemetry.io/otel/sdk/internal/env go.opentelemetry.io/otel/sdk/internal/x go.opentelemetry.io/otel/sdk/resource go.opentelemetry.io/otel/sdk/trace -# go.opentelemetry.io/otel/sdk/log v0.11.0 -## explicit; go 1.22.0 +go.opentelemetry.io/otel/sdk/trace/internal/env +go.opentelemetry.io/otel/sdk/trace/internal/observ +# go.opentelemetry.io/otel/sdk/log v0.15.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel/sdk/log -# go.opentelemetry.io/otel/trace v1.35.0 -## explicit; go 1.22.0 +go.opentelemetry.io/otel/sdk/log/internal/observ +go.opentelemetry.io/otel/sdk/log/internal/x +# go.opentelemetry.io/otel/trace v1.39.0 +## explicit; go 1.24.0 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded go.opentelemetry.io/otel/trace/internal/telemetry go.opentelemetry.io/otel/trace/noop -# go.opentelemetry.io/proto/otlp v1.5.0 -## explicit; go 1.22.0 +# go.opentelemetry.io/proto/otlp v1.9.0 +## explicit; go 1.23.0 go.opentelemetry.io/proto/otlp/collector/logs/v1 go.opentelemetry.io/proto/otlp/collector/trace/v1 go.opentelemetry.io/proto/otlp/common/v1 @@ -572,7 +585,7 @@ go.uber.org/multierr # go.uber.org/ratelimit v0.3.1 ## explicit; go 1.20 go.uber.org/ratelimit -# go.uber.org/zap v1.27.0 +# go.uber.org/zap v1.27.1 ## explicit; go 1.19 go.uber.org/zap go.uber.org/zap/buffer @@ -583,8 +596,8 @@ go.uber.org/zap/internal/exit go.uber.org/zap/internal/pool go.uber.org/zap/internal/stacktrace go.uber.org/zap/zapcore -# golang.org/x/crypto v0.34.0 -## explicit; go 1.23.0 +# golang.org/x/crypto v0.44.0 +## explicit; go 1.24.0 golang.org/x/crypto/blowfish golang.org/x/crypto/chacha20 golang.org/x/crypto/chacha20poly1305 @@ -603,8 +616,8 @@ golang.org/x/exp/slices golang.org/x/exp/slog golang.org/x/exp/slog/internal golang.org/x/exp/slog/internal/buffer -# golang.org/x/net v0.35.0 -## explicit; go 1.18 +# golang.org/x/net v0.47.0 +## explicit; go 1.24.0 golang.org/x/net/context/ctxhttp golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -613,18 +626,18 @@ golang.org/x/net/idna golang.org/x/net/internal/httpcommon golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/oauth2 v0.29.0 -## explicit; go 1.23.0 +# golang.org/x/oauth2 v0.32.0 +## explicit; go 1.24.0 golang.org/x/oauth2 golang.org/x/oauth2/clientcredentials golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.13.0 -## explicit; go 1.23.0 +# golang.org/x/sync v0.18.0 +## explicit; go 1.24.0 golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.38.0 +# golang.org/x/sys v0.39.0 ## explicit; go 1.24.0 golang.org/x/sys/cpu golang.org/x/sys/plan9 @@ -635,11 +648,11 @@ golang.org/x/sys/windows/svc golang.org/x/sys/windows/svc/debug golang.org/x/sys/windows/svc/eventlog golang.org/x/sys/windows/svc/mgr -# golang.org/x/term v0.33.0 -## explicit; go 1.23.0 +# golang.org/x/term v0.37.0 +## explicit; go 1.24.0 golang.org/x/term -# golang.org/x/text v0.24.0 -## explicit; go 1.23.0 +# golang.org/x/text v0.31.0 +## explicit; go 1.24.0 golang.org/x/text/cases golang.org/x/text/encoding golang.org/x/text/encoding/internal @@ -659,15 +672,15 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.8.0 ## explicit; go 1.18 golang.org/x/time/rate -# google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a -## explicit; go 1.22 +# google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 +## explicit; go 1.24.0 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 -## explicit; go 1.23.0 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 +## explicit; go 1.24.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.71.1 -## explicit; go 1.22.0 +# google.golang.org/grpc v1.78.0 +## explicit; go 1.24.0 google.golang.org/grpc google.golang.org/grpc/attributes google.golang.org/grpc/backoff @@ -677,7 +690,6 @@ google.golang.org/grpc/balancer/endpointsharding google.golang.org/grpc/balancer/grpclb/state google.golang.org/grpc/balancer/pickfirst google.golang.org/grpc/balancer/pickfirst/internal -google.golang.org/grpc/balancer/pickfirst/pickfirstleaf google.golang.org/grpc/balancer/roundrobin google.golang.org/grpc/binarylog/grpc_binarylog_v1 google.golang.org/grpc/channelz @@ -687,6 +699,7 @@ google.golang.org/grpc/credentials google.golang.org/grpc/credentials/insecure google.golang.org/grpc/encoding google.golang.org/grpc/encoding/gzip +google.golang.org/grpc/encoding/internal google.golang.org/grpc/encoding/proto google.golang.org/grpc/experimental/stats google.golang.org/grpc/grpclog @@ -730,8 +743,8 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -# google.golang.org/protobuf v1.36.6 -## explicit; go 1.22 +# google.golang.org/protobuf v1.36.10 +## explicit; go 1.23 google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire From 998ec3823bde934215e71255723669d4e444a618 Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Wed, 4 Feb 2026 22:32:05 +0000 Subject: [PATCH 20/22] test: unit test repository and teams --- pkg/connector/repository_test.go | 169 +++++++++++++++++++++++++ pkg/connector/team_test.go | 211 +++++++++++++++++++++++++++++++ test/mocks/endpointpattern.go | 18 +++ test/mocks/github.go | 178 ++++++++++++++++++++++++++ 4 files changed, 576 insertions(+) diff --git a/pkg/connector/repository_test.go b/pkg/connector/repository_test.go index 5c6ab7bc..09ed9b32 100644 --- a/pkg/connector/repository_test.go +++ b/pkg/connector/repository_test.go @@ -9,6 +9,7 @@ import ( entitlement2 "github.com/conductorone/baton-sdk/pkg/types/entitlement" "github.com/google/go-github/v69/github" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/structpb" "github.com/conductorone/baton-github/test" "github.com/conductorone/baton-github/test/mocks" @@ -76,3 +77,171 @@ func TestRepository(t *testing.T) { require.Empty(t, revokeAnnotations) }) } + +func TestRepositoryActions(t *testing.T) { + ctx := context.Background() + + t.Run("should create a basic repository with name, description and optional fields", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + githubOrganization, _, _, _, _, _ := mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := repositoryBuilder(githubClient, cache, false) + + // Create args for the action + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-repo-basic", + "description": "A test repository for unit testing", + "visibility": "private", + "add_readme": true, + "gitignore_template": "Node", + "license_template": "apache-2.0", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", // Matches the seeded org ID + }, + }) + require.NoError(t, err) + + result, annos, err := client.handleCreateRepositoryAction(ctx, args) + require.NoError(t, err) + require.NotNil(t, result) + require.NotNil(t, annos) + + // Verify success field + successVal := result.Fields["success"] + require.NotNil(t, successVal) + require.True(t, successVal.GetBoolValue()) + + // Verify resource was returned + resourceVal := result.Fields["resource"] + require.NotNil(t, resourceVal) + + _ = githubOrganization // Used in seed + }) + + t.Run("should create a public repository", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := repositoryBuilder(githubClient, cache, false) + + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-repo-public", + "description": "A public test repository", + "visibility": "public", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateRepositoryAction(ctx, args) + require.NoError(t, err) + require.NotNil(t, result) + require.True(t, result.Fields["success"].GetBoolValue()) + }) + + t.Run("should fail when templates are used but add_readme is false", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := repositoryBuilder(githubClient, cache, false) + + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-repo-template-no-readme", + "description": "This should fail", + "visibility": "private", + "add_readme": false, // Explicitly false with templates + "gitignore_template": "Python", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateRepositoryAction(ctx, args) + require.Error(t, err) + require.Nil(t, result) + require.Contains(t, err.Error(), "add_readme must be true") + }) + + t.Run("should fail with missing required name field", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := repositoryBuilder(githubClient, cache, false) + + // Missing name field + args, err := structpb.NewStruct(map[string]interface{}{ + "description": "A repo without a name", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateRepositoryAction(ctx, args) + require.Error(t, err) + require.Nil(t, result) + }) + + t.Run("should fail with invalid visibility value", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := repositoryBuilder(githubClient, cache, false) + + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-repo-invalid-visibility", + "visibility": "invalid_visibility_value", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateRepositoryAction(ctx, args) + require.Error(t, err) + require.Nil(t, result) + require.Contains(t, err.Error(), "invalid visibility") + }) + + t.Run("should create internal repository (enterprise feature)", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := repositoryBuilder(githubClient, cache, false) + + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-repo-internal", + "description": "An internal repository", + "visibility": "internal", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateRepositoryAction(ctx, args) + require.NoError(t, err) + require.NotNil(t, result) + require.True(t, result.Fields["success"].GetBoolValue()) + }) +} diff --git a/pkg/connector/team_test.go b/pkg/connector/team_test.go index d739b529..d1a8eede 100644 --- a/pkg/connector/team_test.go +++ b/pkg/connector/team_test.go @@ -9,6 +9,7 @@ import ( entitlement2 "github.com/conductorone/baton-sdk/pkg/types/entitlement" "github.com/google/go-github/v69/github" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/structpb" "github.com/conductorone/baton-github/test" "github.com/conductorone/baton-github/test/mocks" @@ -54,3 +55,213 @@ func TestTeam(t *testing.T) { require.Empty(t, revokeAnnotations) }) } + +func TestTeamActions(t *testing.T) { + ctx := context.Background() + + t.Run("should create a basic team with name, description, notifications, and privacy", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + githubOrganization, _, _, _, _, _ := mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := teamBuilder(githubClient, cache) + + // Create args for the action + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-team-basic", + "description": "A test team for unit testing", + "privacy": "secret", + "notifications_enabled": true, + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", // Matches the seeded org ID + }, + }) + require.NoError(t, err) + + result, annos, err := client.handleCreateTeamAction(ctx, args) + require.NoError(t, err) + require.NotNil(t, result) + require.NotNil(t, annos) + + // Verify success field + successVal := result.Fields["success"] + require.NotNil(t, successVal) + require.True(t, successVal.GetBoolValue()) + + // Verify resource was returned + resourceVal := result.Fields["resource"] + require.NotNil(t, resourceVal) + + _ = githubOrganization // Used in seed + }) + + t.Run("should create a team with multiple maintainers", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + _, _, _, existingUser, _, _ := mgh.Seed() + + // Add a second user + secondUserID := int64(100) + secondUserLogin := "100" + secondUserEmail := "seconduser@example.com" + mgh.AddUser(github.User{ + ID: github.Ptr(secondUserID), + Login: github.Ptr(secondUserLogin), + Email: github.Ptr(secondUserEmail), + }) + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := teamBuilder(githubClient, cache) + + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-team-maintainers", + "description": "Team with multiple maintainers", + "privacy": "secret", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + "maintainers": []interface{}{ + map[string]interface{}{ + "resource_type": "user", + "resource": "56", // existingUser.ID + }, + map[string]interface{}{ + "resource_type": "user", + "resource": "100", // secondUserID + }, + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateTeamAction(ctx, args) + require.NoError(t, err) + require.NotNil(t, result) + require.True(t, result.Fields["success"].GetBoolValue()) + + _ = existingUser // Used in seed + }) + + t.Run("should fail to create nested team when parent team is secret", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + githubOrganization, _, _, _, _, _ := mgh.Seed() + + // Add a secret parent team + secretParentTeamID := int64(200) + mgh.AddTeam(github.Team{ + ID: github.Ptr(secretParentTeamID), + Name: github.Ptr("secret-parent-team"), + Slug: github.Ptr("secret-parent-team"), + Organization: githubOrganization, + Privacy: github.Ptr("secret"), + }) + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := teamBuilder(githubClient, cache) + + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "nested-team-under-secret", + "description": "This should fail because parent is secret", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + "parent": map[string]interface{}{ + "resource_type": "team", + "resource": "200", // Secret parent team ID + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateTeamAction(ctx, args) + require.Error(t, err) + require.Nil(t, result) + require.Contains(t, err.Error(), "cannot create child team") + require.Contains(t, err.Error(), "secret") + }) + + t.Run("should successfully create nested team when parent team is closed", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + githubOrganization, _, _, _, _, _ := mgh.Seed() + + // Add a closed parent team + closedParentTeamID := int64(201) + mgh.AddTeam(github.Team{ + ID: github.Ptr(closedParentTeamID), + Name: github.Ptr("closed-parent-team"), + Slug: github.Ptr("closed-parent-team"), + Organization: githubOrganization, + Privacy: github.Ptr("closed"), + }) + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := teamBuilder(githubClient, cache) + + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "nested-team-under-closed", + "description": "Nested team under closed parent", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + "parent": map[string]interface{}{ + "resource_type": "team", + "resource": "201", // Closed parent team ID + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateTeamAction(ctx, args) + require.NoError(t, err) + require.NotNil(t, result) + require.True(t, result.Fields["success"].GetBoolValue()) + }) + + t.Run("should fail with missing required org field", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := teamBuilder(githubClient, cache) + + // Missing org field + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-team", + "description": "A team without org", + }) + require.NoError(t, err) + + result, _, err := client.handleCreateTeamAction(ctx, args) + require.Error(t, err) + require.Nil(t, result) + }) + + t.Run("should fail with invalid privacy value", func(t *testing.T) { + mgh := mocks.NewMockGitHub() + mgh.Seed() + + githubClient := github.NewClient(mgh.Server()) + cache := newOrgNameCache(githubClient) + client := teamBuilder(githubClient, cache) + + args, err := structpb.NewStruct(map[string]interface{}{ + "name": "test-team-invalid-privacy", + "privacy": "invalid_privacy_value", + "org": map[string]interface{}{ + "resource_type": "org", + "resource": "12", + }, + }) + require.NoError(t, err) + + result, _, err := client.handleCreateTeamAction(ctx, args) + require.Error(t, err) + require.Nil(t, result) + require.Contains(t, err.Error(), "invalid privacy value") + }) +} diff --git a/test/mocks/endpointpattern.go b/test/mocks/endpointpattern.go index c57cefff..2ac131a1 100644 --- a/test/mocks/endpointpattern.go +++ b/test/mocks/endpointpattern.go @@ -67,3 +67,21 @@ var DeleteOrgsRolesUsersByOrgByRoleIdByUsername = mock.EndpointPattern{ Pattern: "/orgs/{org}/organization-roles/users/{username}/{role_id}", Method: "DELETE", } + +// Team creation endpoint. +var PostOrgsTeamsByOrg = mock.EndpointPattern{ + Pattern: "/orgs/{org}/teams", + Method: "POST", +} + +// Repository creation endpoint. +var PostOrgsReposByOrg = mock.EndpointPattern{ + Pattern: "/orgs/{org}/repos", + Method: "POST", +} + +// Get organization by slug/login (not numeric ID). +var GetOrgsByName = mock.EndpointPattern{ + Pattern: "/orgs/{org}", + Method: "GET", +} diff --git a/test/mocks/github.go b/test/mocks/github.go index 45f5445a..6b455e81 100644 --- a/test/mocks/github.go +++ b/test/mocks/github.go @@ -753,6 +753,10 @@ func (mgh MockGitHub) Server() *http.Client { }: mgh.getOrgRoleByID, PutOrgsRolesUsersByOrgByRoleIdByUsername: mgh.addOrgRoleUser, DeleteOrgsRolesUsersByOrgByRoleIdByUsername: mgh.removeOrgRoleUser, + // Team and repository creation + PostOrgsTeamsByOrg: mgh.createTeam, + PostOrgsReposByOrg: mgh.createRepository, + GetOrgsByName: mgh.getOrganizationBySlug, } options := make([]mock.MockBackendOption, 0) @@ -782,3 +786,177 @@ func (mgh *MockGitHub) AddMembership(teamID int64, userID int64) { } mgh.teamMemberships[teamID].Add(userID) } + +// AddUser adds a user to the mock server for testing purposes. +func (mgh *MockGitHub) AddUser(user github.User) { + mgh.users[*user.ID] = user +} + +// AddRepository adds a repository to the mock server for testing purposes. +func (mgh *MockGitHub) AddRepository(repo github.Repository) { + mgh.repositories[*repo.ID] = repo +} + +// AddOrganization adds an organization to the mock server for testing purposes. +func (mgh *MockGitHub) AddOrganization(org github.Organization) { + mgh.organizations[*org.ID] = org +} + +// nextTeamID tracks the next team ID to assign for created teams. +var nextTeamID int64 = 1000 + +// nextRepoID tracks the next repo ID to assign for created repos. +var nextRepoID int64 = 1000 + +// createTeam creates a new team in the mock server. +func (mgh *MockGitHub) createTeam( + w http.ResponseWriter, + variables map[string]string, +) { + orgSlug, ok := variables["org"] + if !ok { + w.WriteHeader(http.StatusBadRequest) + return + } + + // Find org by slug + var foundOrg *github.Organization + for _, org := range mgh.organizations { + if org.GetLogin() == orgSlug { + foundOrg = &org + break + } + } + if foundOrg == nil { + w.WriteHeader(http.StatusNotFound) + return + } + + teamName := variables["name"] + if teamName == "" { + w.WriteHeader(http.StatusBadRequest) + return + } + + // Get privacy setting + privacy := variables["privacy"] + if privacy == "" { + privacy = "secret" // Default for non-nested teams + } + + // Check if parent team is specified + parentTeamIDStr := variables["parent_team_id"] + var parentTeam *github.Team + if parentTeamIDStr != "" { + parentTeamID, err := strconv.ParseInt(parentTeamIDStr, 10, 64) + if err != nil { + w.WriteHeader(http.StatusBadRequest) + return + } + pt, ok := mgh.teams[parentTeamID] + if !ok { + w.WriteHeader(http.StatusNotFound) + return + } + parentTeam = &pt + // Nested teams must be closed + privacy = "closed" + } + + teamID := nextTeamID + nextTeamID++ + + newTeam := github.Team{ + ID: github.Ptr(teamID), + Name: github.Ptr(teamName), + Slug: github.Ptr(strings.ToLower(strings.ReplaceAll(teamName, " ", "-"))), + Organization: foundOrg, + Privacy: github.Ptr(privacy), + } + if parentTeam != nil { + newTeam.Parent = parentTeam + } + + mgh.teams[teamID] = newTeam + mgh.teamMemberships[teamID] = mapset.NewSet[int64]() + + _, _ = w.Write(mock.MustMarshal(newTeam)) +} + +// createRepository creates a new repository in the mock server. +func (mgh *MockGitHub) createRepository( + w http.ResponseWriter, + variables map[string]string, +) { + orgSlug, ok := variables["org"] + if !ok { + w.WriteHeader(http.StatusBadRequest) + return + } + + // Find org by slug + var foundOrg *github.Organization + for _, org := range mgh.organizations { + if org.GetLogin() == orgSlug { + foundOrg = &org + break + } + } + if foundOrg == nil { + w.WriteHeader(http.StatusNotFound) + return + } + + repoName := variables["name"] + if repoName == "" { + w.WriteHeader(http.StatusBadRequest) + return + } + + visibility := variables["visibility"] + if visibility == "" { + visibility = "private" + } + + description := variables["description"] + + repoID := nextRepoID + nextRepoID++ + + fullName := fmt.Sprintf("%s/%s", foundOrg.GetLogin(), repoName) + newRepo := github.Repository{ + ID: github.Ptr(repoID), + Name: github.Ptr(repoName), + FullName: github.Ptr(fullName), + Description: github.Ptr(description), + Organization: foundOrg, + Visibility: github.Ptr(visibility), + Private: github.Ptr(visibility == "private"), + } + + mgh.repositories[repoID] = newRepo + mgh.repositoryMemberships[repoID] = mapset.NewSet[int64]() + + _, _ = w.Write(mock.MustMarshal(newRepo)) +} + +// getOrganizationBySlug gets an organization by its slug/login. +func (mgh *MockGitHub) getOrganizationBySlug( + w http.ResponseWriter, + variables map[string]string, +) { + orgSlug, ok := variables["org"] + if !ok { + w.WriteHeader(http.StatusNotFound) + return + } + + // Find org by slug + for _, org := range mgh.organizations { + if org.GetLogin() == orgSlug { + _, _ = w.Write(mock.MustMarshal(org)) + return + } + } + w.WriteHeader(http.StatusNotFound) +} From 669099dc9e79af3fece3c3075409c667281a181d Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Wed, 4 Feb 2026 23:15:23 +0000 Subject: [PATCH 21/22] rebase: main --- .../baton-sdk/pkg/tasks/c1api/full_sync.go | 28 ++++++------------- .../pkg/tasks/c1api/service_client.go | 2 -- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go index 3e236adc..4171ecc2 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/full_sync.go @@ -145,7 +145,6 @@ func (c *fullSyncTaskHandler) HandleTask(ctx context.Context) error { c1zPath := assetFile.Name() err = assetFile.Close() if err != nil { - l.Error("failed to close asset file", zap.Error(err)) return c.helpers.FinishTask(ctx, nil, nil, err) } @@ -184,9 +183,8 @@ func (c *fullSyncTaskHandler) HandleTask(ctx context.Context) error { return c.helpers.FinishTask(ctx, nil, nil, err) } - err = uploadDebugLogs(ctx, c.helpers, c.task.GetDebug()) + err = uploadDebugLogs(ctx, c.helpers) if err != nil { - l.Error("failed to upload debug Task logs", zap.Error(err)) return c.helpers.FinishTask(ctx, nil, nil, err) } @@ -213,9 +211,7 @@ func newFullSyncTaskHandler( } } -// Check if Debug logs should be uploaded to C1 and if so do so, -// otherwise silently return success. -func uploadDebugLogs(ctx context.Context, helper fullSyncHelpers, deleteDebugLogs bool) error { +func uploadDebugLogs(ctx context.Context, helper fullSyncHelpers) error { ctx, span := tracer.Start(ctx, "uploadDebugLogs") defer span.End() @@ -252,27 +248,19 @@ func uploadDebugLogs(ctx context.Context, helper fullSyncHelpers, deleteDebugLog debugfile, err := os.Open(debugPath) if err != nil { - l.Error("failed to open debug log file path", zap.Error(err)) return err } - if deleteDebugLogs { - // We only delete the debug log when asked to, - // as Manager-required log files are not automatically rotated. - defer func() { - err := os.Remove(debugPath) - if err != nil { - l.Error("failed to delete file with debug logs", zap.Error(err), zap.String("file", debugPath)) - } else { - l.Info("deleted debug path") - } - }() - } + defer func() { + err := os.Remove(debugPath) + if err != nil { + l.Error("failed to delete file with debug logs", zap.Error(err), zap.String("file", debugPath)) + } + }() defer debugfile.Close() l.Info("uploading debug logs", zap.String("file", debugPath)) err = helper.Upload(ctx, debugfile) if err != nil { - l.Error("failed to upload debug logs", zap.Error(err)) return err } diff --git a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go index 5fe8a32f..f7ef2c82 100644 --- a/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go +++ b/vendor/github.com/conductorone/baton-sdk/pkg/tasks/c1api/service_client.go @@ -183,14 +183,12 @@ func (c *c1ServiceClient) upload(ctx context.Context, task *v1.Task, r io.ReadSe client, done, err := c.getClientConn(ctx) if err != nil { - l.Error("failed to get client connection", zap.Error(err)) return err } defer done() uc, err := client.UploadAsset(ctx) if err != nil { - l.Error("UploadAsset returned error", zap.Error(err)) return err } From 886da7eb0cc1e77f3086c3d1b5e67c80b4502c9c Mon Sep 17 00:00:00 2001 From: Muhammad Kumail Date: Wed, 4 Feb 2026 23:21:32 +0000 Subject: [PATCH 22/22] fix: lint --- pkg/connector/repository_test.go | 10 +++++----- pkg/connector/team_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/connector/repository_test.go b/pkg/connector/repository_test.go index 09ed9b32..9e955009 100644 --- a/pkg/connector/repository_test.go +++ b/pkg/connector/repository_test.go @@ -123,7 +123,7 @@ func TestRepositoryActions(t *testing.T) { t.Run("should create a public repository", func(t *testing.T) { mgh := mocks.NewMockGitHub() - mgh.Seed() + _, _, _, _, _, _ = mgh.Seed() githubClient := github.NewClient(mgh.Server()) cache := newOrgNameCache(githubClient) @@ -148,7 +148,7 @@ func TestRepositoryActions(t *testing.T) { t.Run("should fail when templates are used but add_readme is false", func(t *testing.T) { mgh := mocks.NewMockGitHub() - mgh.Seed() + _, _, _, _, _, _ = mgh.Seed() githubClient := github.NewClient(mgh.Server()) cache := newOrgNameCache(githubClient) @@ -175,7 +175,7 @@ func TestRepositoryActions(t *testing.T) { t.Run("should fail with missing required name field", func(t *testing.T) { mgh := mocks.NewMockGitHub() - mgh.Seed() + _, _, _, _, _, _ = mgh.Seed() githubClient := github.NewClient(mgh.Server()) cache := newOrgNameCache(githubClient) @@ -198,7 +198,7 @@ func TestRepositoryActions(t *testing.T) { t.Run("should fail with invalid visibility value", func(t *testing.T) { mgh := mocks.NewMockGitHub() - mgh.Seed() + _, _, _, _, _, _ = mgh.Seed() githubClient := github.NewClient(mgh.Server()) cache := newOrgNameCache(githubClient) @@ -222,7 +222,7 @@ func TestRepositoryActions(t *testing.T) { t.Run("should create internal repository (enterprise feature)", func(t *testing.T) { mgh := mocks.NewMockGitHub() - mgh.Seed() + _, _, _, _, _, _ = mgh.Seed() githubClient := github.NewClient(mgh.Server()) cache := newOrgNameCache(githubClient) diff --git a/pkg/connector/team_test.go b/pkg/connector/team_test.go index d1a8eede..03ad5579 100644 --- a/pkg/connector/team_test.go +++ b/pkg/connector/team_test.go @@ -223,7 +223,7 @@ func TestTeamActions(t *testing.T) { t.Run("should fail with missing required org field", func(t *testing.T) { mgh := mocks.NewMockGitHub() - mgh.Seed() + _, _, _, _, _, _ = mgh.Seed() githubClient := github.NewClient(mgh.Server()) cache := newOrgNameCache(githubClient) @@ -243,7 +243,7 @@ func TestTeamActions(t *testing.T) { t.Run("should fail with invalid privacy value", func(t *testing.T) { mgh := mocks.NewMockGitHub() - mgh.Seed() + _, _, _, _, _, _ = mgh.Seed() githubClient := github.NewClient(mgh.Server()) cache := newOrgNameCache(githubClient)