-
Notifications
You must be signed in to change notification settings - Fork 218
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 validator for services with no auth trait #1929
Add validator for services with no auth trait #1929
Conversation
edcc172
to
f450453
Compare
...java/software/amazon/smithy/model/validation/validators/ServiceWithNoAuthTraitValidator.java
Outdated
Show resolved
Hide resolved
f450453
to
6b5489b
Compare
* Validates that services with multiple @authDefinition traits applied also | ||
* have an @auth trait applied. | ||
*/ | ||
public class ServiceWithNoAuthTraitValidator extends AbstractValidator { |
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.
Instead of being so specific, I think this could be ServiceAuthDefinitionsValidator. In the future maybe we'll want to warn if service has 0 auth schemes?
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.
Updated. Also changed the javadoc for the class
Adds a validator that warns when there's a service shape that has multiple authDefinition traits applied, but no auth trait. This encourages the use of the auth trait so auth scheme priority is being modeled explicitly. It also allows for tooling to look for and use this validation event. Documentation was also updated to explain that without the auth trait, auth scheme ordering is alphabetical. A test for the auth trait (auth-trait-must-target-service-schemes) was updated to avoid getting the warning message from the new validator.
6b5489b
to
8655119
Compare
Adds a validator that warns when there's a service shape that has multiple authDefinition traits applied, but no auth trait. This encourages the use of the auth trait so auth scheme priority is being modeled explicitly. It also allows for tooling to look for and use this validation event. Documentation was also updated to explain that without the auth trait, auth scheme ordering is alphabetical. A test for the auth trait (auth-trait-must-target-service-schemes) was updated to avoid getting the warning message from the new validator.
Adds a validator that warns when there's a service shape that has multiple authDefinition traits applied, but no auth trait. This encourages the use of the auth trait so auth scheme priority is being modeled explicitly. It also allows for tooling to look for and use this validation event.
Documentation was also updated to explain that without the auth trait, auth scheme ordering is alphabetical.
A test for the auth trait (auth-trait-must-target-service-schemes) was updated to avoid getting the warning message from the new validator.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.