-
Notifications
You must be signed in to change notification settings - Fork 84
Connector template retrieval endpoints #6868
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
Adds two new read-only endpoints to retrieve SaaS connector template configurations (config and dataset YAML files) by connector key. The implementation properly delegates to the existing ConnectorRegistry service layer and includes comprehensive test coverage.
- Added
GET /api/v1/connector_template/{key}/configendpoint to retrieve SaaS config YAML - Added
GET /api/v1/connector_template/{key}/datasetendpoint to retrieve dataset YAML - Both endpoints return raw YAML with proper content-type headers (
text/yaml) - New
CONNECTOR_TEMPLATE_READscope protects both endpoints - Works with both file-based (standard) and custom connector templates
- Test coverage includes authentication, authorization, error handling, and success scenarios
Confidence Score: 5/5
- Safe to merge - straightforward read-only endpoints with proper authorization and comprehensive tests
- Clean implementation following established patterns: endpoints delegate to service layer per custom instructions, proper scope-based authorization, comprehensive test coverage including edge cases, no complex logic or risky changes
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| src/fides/api/api/v1/endpoints/saas_config_endpoints.py | 5/5 | Adds two new GET endpoints to retrieve config and dataset YAML for connector templates, properly delegating to service layer |
| tests/ops/api/v1/endpoints/test_saas_config_endpoints.py | 5/5 | Comprehensive test coverage for both endpoints including auth, scope validation, error cases, and success scenarios for both file-based and custom templates |
4 files reviewed, no comments
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (97.36%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6868 +/- ##
==========================================
+ Coverage 87.25% 87.27% +0.01%
==========================================
Files 529 530 +1
Lines 34801 34857 +56
Branches 4032 4035 +3
==========================================
+ Hits 30367 30422 +55
- Misses 3552 3553 +1
Partials 882 882 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/two-factor-authentication |
| CONNECTOR_TEMPLATE_CONFIG = "/connector_template/{key}/config" | ||
| CONNECTOR_TEMPLATE_DATASET = "/connector_template/{key}/dataset" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer connector-template with a dash, but we're already using underscore for the register endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You beat me to it I was just about to ask about this. Do we have a style guide for which we prefer?
tvandort
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change the string template for the route for Swagger purposes, otherwise this all looks good to me.
| CONNECTOR_TEMPLATE_CONFIG = "/connector_template/{key}/config" | ||
| CONNECTOR_TEMPLATE_DATASET = "/connector_template/{key}/dataset" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| CONNECTOR_TEMPLATE_CONFIG = "/connector_template/{key}/config" | |
| CONNECTOR_TEMPLATE_DATASET = "/connector_template/{key}/dataset" | |
| CONNECTOR_TEMPLATE_CONFIG = "/connector_template/{connector_template_identifier}/config" | |
| CONNECTOR_TEMPLATE_DATASET = "/connector_template/{connector_template_identifier}/dataset" |
I think we should change these to reflect where a caller can find the ID. Key is mysterious to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reused saas_connector_type from the /system/{fides_key}/connection/instantiate/{saas_connector_type} endpoint
|
Oh, and one question, we added scopes for this endpoint, what roles does that scope apply to? |
tests/ops/api/v1/endpoints/test_connection_template_endpoints.py
Outdated
Show resolved
Hide resolved
c111fc4 to
9f722de
Compare
895082e to
65675a5
Compare
Co-authored-by: Thomas Van Dort <tom@ethyca.com>
ENG-2132
Description Of Changes
Adds endpoints to retrieve the SaaS config and dataset yaml files for any registered SaaS connector (standard or custom)
Steps to Confirm
GET /api/v1/connector-templates/{connector_template_type}/configusing a connector type such asstripeGET /api/v1/connector-templates/{connector_template_type}/datasetusing a connector type such asstripePre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works