Skip to content

Conversation

@omris94
Copy link
Contributor

@omris94 omris94 commented Feb 26, 2025

Description

This pull request introduces a SaaS-based approval workflow for ClientIntents within the Otterize intents-operator. By default, there are no changes to the user API unless explicitly configured by the user.

Key Changes

  • ApprovedClientIntents CRD:
    A new Custom Resource Definition (CRD) named ApprovedClientIntents has been added. This CRD represents ClientIntents resources that have been approved, facilitating a controlled and auditable access management process.

  • Refactoring of Intents Reconciliation:
    The existing IntentsReconciler logic has been refactored into ApprovedIntentsReconciler. All operations previously triggered by the reconciliation of intents now utilize the new ApprovedClientIntents CRD, ensuring that only approved intents are enforced.

  • Introduction of Approval Flow Reconciler:
    A new reconciler has been implemented to handle the approval flow. By default, the operator auto-approves any ClientIntents. If configured to integrate with the cloud, it reports the ClientIntents as access requests to the cloud and awaits approval status. Once a request is approved, it triggers the creation of an ApprovedClientIntents resource.

Testing

Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

Please include any manual steps for testing end-to-end or functionality not covered by unit/integration tests.

Also include details of the environment this PR was developed in (language/platform/browser version).

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR and in github.com/otterize/docs

evyatarmeged and others added 30 commits January 26, 2025 11:37
…raphQL mutations and queries for applied intents requests
omris94 added 9 commits March 13, 2025 14:08
…lientIntents for every clientIntents while the operator will wait for the migration to end.
1. When first reconciled - add finalizer
2. When deleted - trigger approvedClientIntent deletion
   a. If does not exist - remove finalizer
   b. If exists - delete approvedClientIntent and return
3. When approvedClientIntents is deleted - remove finalizer from clientIntents before removing its own
@omris94 omris94 changed the title Support SaaS based approval flow for clientIntents Implement SaaS-Based Approval Workflow for ClientIntents Mar 17, 2025
@omris94 omris94 marked this pull request as ready for review March 17, 2025 17:51
ExternallyManagedPolicyWorkloadsKey = "externallyManagedPolicyWorkloads"

EnableIntentsCloudApproval = "enable-intents-cloud-approval"
EnableIntentsCloudApprovalDefault = true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change before merge

ObservedGeneration int64 `json:"observedGeneration"`
// ResolvedIPs stores resolved IPs for a domain name - the network mapper populates it when DNS internetTarget is used
// +optional
ResolvedIPs []ResolvedIPs `json:"resolvedIPs,omitempty" yaml:"resolvedIPs,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to open a PR to update the mapper with this change + release them together

Comment on lines 82 to 83
//+kubebuilder:rbac:groups=k8s.otterize.com,resources=postgresqlserverconfigs,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=k8s.otterize.com,resources=mysqlserverconfigs,verbs=get;list;watch;create;update;patch;delete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup required RBAC permissions here

// Will be handled elsewhere
return nil
}
if intents.Status.ReviewStatus == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this already be handled by the main flow? I'd expect the main flow to ensure the status is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants