Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Form, Flow, and Flow Vault Connection Managers #444

Merged
merged 18 commits into from
Sep 23, 2024

Conversation

kushalshit27
Copy link
Contributor

@kushalshit27 kushalshit27 commented Sep 13, 2024

🔧 Changes

This PR adds support for the following required endpoints:

Form Manager:

  • POST /api/v2/forms
  • GET /api/v2/forms
  • GET /api/v2/forms/:form_id
  • PATCH /api/v2/forms/:form_id
  • DELETE /api/v2/forms/:form_id

Flow Manager:

  • POST /api/v2/flows
  • GET /api/v2/flows
  • GET /api/v2/flows/:flow_id
  • PATCH /api/v2/flows/:flow_id
  • DELETE /api/v2/flows/:flow_id

Flow Vault Connection Manager:

  • POST /api/v2/flows/vault/connections
  • GET /api/v2/flows/vault/connections
  • GET /api/v2/flows/vault/connections/:connection_id
  • PATCH /api/v2/flows/vault/connections/:connection_id
  • DELETE /api/v2/flows/vault/connections/:connection_id

📚 References

For further information, refer to the following documentation:

🔍 Example

// Example code snippets for interacting with the Form, Flow, and Flow Vault Connection APIs

// Form Manager
form := &management.Form{
	Name: auth0.String("Custom policies"),
	// Other fields...
}

// Creating a form
err := auth0API.Form.Create(context.TODO(), form)

// Getting a form
err := auth0API.Form.Read(context.TODO(), form.GetID())

// Updating a form
err = auth0API.Form.Update(context.TODO(), form.GetID(), updatedForm)

// Deleting a form
err = auth0API.Form.Delete(context.TODO(), form.GetID())

// Listing forms
formList, err := auth0API.Form.List(context.TODO())


// Flow Manager
flow := &management.Flow{
	Name: auth0.String("user_metadata_flow"),
	// Other fields...
}

// Creating a flow
err := auth0API.Flow.Create(context.TODO(), flow)

// Getting a flow
err := auth0API.Flow.Read(context.TODO(), flow.GetID())

// Updating a flow
err = auth0API.Flow.Update(context.TODO(), flow.GetID(), updatedFlow)

// Deleting a flow
err = auth0API.Flow.Delete(context.TODO(), flow.GetID())

// Listing flows
flowList, err := auth0API.Flow.List(context.TODO())


// Flow Vault Connection Manager
flowVaultConnection := &management.FlowVaultConnection{
	AppID: auth0.String("HTTP"),
	Name:  auth0.String("HTTP Connection"),
	// Other fields...
}

// Creating a Flow Vault Connection
err := auth0API.Flow.Vault.CreateConnection(context.TODO(), flowVaultConnection)

// Getting a Flow Vault Connection
err := auth0API.Flow.Vault.GetConnection(context.TODO(), flowVaultConnection.GetID())

// Updating a Flow Vault Connection
err := auth0API.Flow.Vault.UpdateConnection(context.TODO(), flowVaultConnection.GetID(), updateFlowVaultConnection)

// Deleting a Flow Vault Connection
err := auth0API.Flow.Vault.DeleteConnection(context.TODO(), flowVaultConnection.GetID())

// Listing Flow Vault Connections
flowVaultConnectionList, err := auth0API.Flow.Vault.GetConnectionList(context.TODO())

🔬 Testing

  • Added test cases for all the newly supported endpoints to ensure they work as expected.
  • All created resources are cleaned up after assertions.

📝 Checklist

  • All new/changed functionality is covered by tests (or N/A)
  • Documentation has been updated to reflect all changes (or N/A)

SDK-4929 form api dsk support fix typo

SDK-4929 form create unit test

SDK-4929 form added unit test

SDK-4929 form comment updated
SDK-4929 flow api test recordings added
SDK-4929 flows, vault connection sdk support.

SDK-4929 flows and vault connection recordings added.

SDK-4929 flow struct updated
@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.81%. Comparing base (cf30fcd) to head (8d4e619).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #444      +/-   ##
==========================================
+ Coverage   95.70%   95.81%   +0.11%     
==========================================
  Files          49       51       +2     
  Lines        8234     8456     +222     
==========================================
+ Hits         7880     8102     +222     
  Misses        236      236              
  Partials      118      118              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kushalshit27 kushalshit27 changed the title Add Support for support for forms, flow, flow vault connection Add Support for support for forms, flow, vault connection Sep 13, 2024
@kushalshit27 kushalshit27 changed the title Add Support for support for forms, flow, vault connection Support for forms, flow, vault connection Sep 13, 2024
@kushalshit27 kushalshit27 changed the title Support for forms, flow, vault connection Support for form, flow, vault connection Sep 13, 2024
@kushalshit27 kushalshit27 marked this pull request as ready for review September 16, 2024 04:54
@kushalshit27 kushalshit27 requested a review from a team as a code owner September 16, 2024 04:54
Copy link
Contributor

@developerkunal developerkunal left a comment

Choose a reason for hiding this comment

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

Added my review

management/flow.go Outdated Show resolved Hide resolved
management/flow.go Show resolved Hide resolved
management/flow_test.go Outdated Show resolved Hide resolved
management/flow_test.go Outdated Show resolved Hide resolved
management/flow_test.go Show resolved Hide resolved
management/form.go Outdated Show resolved Hide resolved
management/form.go Show resolved Hide resolved
management/form.go Show resolved Hide resolved
management/form_test.go Outdated Show resolved Hide resolved
management/form_test.go Outdated Show resolved Hide resolved
@kushalshit27 kushalshit27 merged commit 1771d46 into main Sep 23, 2024
9 checks passed
@kushalshit27 kushalshit27 deleted the SDK-4929-support-for-forms branch September 23, 2024 15:04
@developerkunal developerkunal changed the title Support for form, flow, vault connection Add support for Form, Flow, and Flow Vault Connection Managers Sep 27, 2024
@developerkunal developerkunal mentioned this pull request Sep 27, 2024
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.

4 participants