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

test: test permutations of auth strategies & operations #2166

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

palpatim
Copy link
Member

@palpatim palpatim commented Dec 29, 2023

Description of changes

Adds tests for iterating over single combinations of of auth strategies & operations, to cover some cases I couldn't find elsewhere. Also adds field-level auth rule combination tests. Adds support for generating snapshots as a developer tool for validating changes that impact resolver or stack resource generation.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@palpatim palpatim requested a review from a team as a code owner December 29, 2023 22:38
@palpatim palpatim force-pushed the palpatim.test.port-v1-auth-operations branch from 1ffc1b7 to 748a274 Compare December 29, 2023 23:00
transformers,
resolverConfig,
dataSourceStrategies: constructDataSourceStrategies(schema, strategy),
});
Copy link
Contributor

Choose a reason for hiding this comment

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

sync and search are not supported for SQL datasource strategies. But the fact that the transformation succeeds here probably means we're missing those validations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, thanks for the callout

rules: AuthRule[],
configuredAuthProviders: ConfiguredAuthProviders,
typeName: string,
context: TransformerSchemaVisitStepContextProvider,
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a bit uncomfortable plumbing the transformer DataSourceProvider/transformer context through to this level, since we've avoided coupling up until now. But the validation needs to be able to tell if these are SQL strategies, and it's cleaner to centralize validations in a single file rather than spreading them through the transformer code, so this seemed like a compromise I could live with.

phani-srikar
phani-srikar previously approved these changes Jan 3, 2024
phani-srikar
phani-srikar previously approved these changes Jan 3, 2024
phani-srikar
phani-srikar previously approved these changes Jan 4, 2024
@palpatim palpatim merged commit 1d9cea8 into main Jan 17, 2024
6 checks passed
@palpatim palpatim deleted the palpatim.test.port-v1-auth-operations branch January 17, 2024 00:12
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.

None yet

4 participants