aws-greengrass / aws-greengrass-client-device-auth

Apache License 2.0
2 stars 3 forks source link

chore: add integ test for removing resources from policy #424

Closed jcosentino11 closed 9 months ago

jcosentino11 commented 9 months ago

Issue #, if available:

Description of changes: Adding some more test coverage at the integration level. Tests that if resource A is removed from a policy, that we immediately are no longer able to publish to it

Why is this change necessary:

How was this change tested:

Any additional information or context required to review the change:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

github-actions[bot] commented 9 months ago

Code Coverage Report

File Coverage
All files 74% :white_check_mark:
com.aws.greengrass.clientdevices.auth.PermissionEvaluationUtils 90% :white_check_mark:
com.aws.greengrass.clientdevices.auth.CertificateManager 88% :white_check_mark:
com.aws.greengrass.clientdevices.auth.ClientDevicesAuthService 82% :white_check_mark:
com.aws.greengrass.clientdevices.auth.DeviceAuthClient 73% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.ClientCertificateGenerator 95% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.CertificateHelper 74% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.CertificateStore 72% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.CertificateExpiryMonitor 77% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.ServerCertificateGenerator 93% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.CertificateGenerator 70% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.CertificateExpiryMonitor$CertRotationDecider 90% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.usecases.VerifyIotCertificate 94% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.usecases.VerifyThingAttachedToCertificate 89% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.usecases.CreateIoTThingSession 67% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.usecases.VerifyCertificateValidityPeriod 88% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.infra.BackgroundCertificateRefresh 82% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.infra.ThingRegistry 92% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.usecases.ConfigureManagedCertificateAuthority 85% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.usecases.ConfigureCustomCertificateAuthority 83% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.usecases.RegisterCertificateAuthorityUseCase 65% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.MetricsConfiguration 83% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.GroupManager 94% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.CAConfiguration 96% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.RuntimeConfiguration 83% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.SecurityConfiguration 80% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.GroupDefinition 75% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.ExpressionVisitor 84% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.GroupConfiguration 92% :white_check_mark:
com.aws.greengrass.clientdevices.auth.api.ClientDevicesAuthServiceApi 85% :white_check_mark:
com.aws.greengrass.clientdevices.auth.api.GetCertificateRequestWithGenerator 75% :white_check_mark:
com.aws.greengrass.clientdevices.auth.api.UseCases 71% :white_check_mark:
com.aws.greengrass.clientdevices.auth.session.attribute.WildcardSuffixAttribute 96% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.IotAuthClient$Default 56% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.Thing 85% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.Certificate 74% :white_check_mark:
com.aws.greengrass.clientdevices.auth.iot.GreengrassV2DataClientFactory 18% :x:
com.aws.greengrass.clientdevices.auth.iot.CertificateRegistry 95% :white_check_mark:
com.aws.greengrass.clientdevices.auth.infra.NetworkStateProvider$Default 83% :white_check_mark:
com.aws.greengrass.ipc.IPCUtils 83% :white_check_mark:
com.aws.greengrass.ipc.VerifyClientDeviceIdentityOperationHandler 60% :white_check_mark:
com.aws.greengrass.ipc.GetClientDeviceAuthTokenOperationHandler 83% :white_check_mark:
com.aws.greengrass.ipc.AuthorizeClientDeviceActionOperationHandler 79% :white_check_mark:
com.aws.greengrass.ipc.SubscribeToCertificateUpdatesOperationHandler 81% :white_check_mark:
com.aws.greengrass.clientdevices.auth.session.SessionConfig 92% :white_check_mark:
com.aws.greengrass.clientdevices.auth.session.SessionManager 88% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.handlers.CAConfigurationChangedHandler 93% :white_check_mark:
com.aws.greengrass.clientdevices.auth.certificate.handlers.CertificateRotationHandler 96% :white_check_mark:
com.aws.greengrass.clientdevices.auth.metrics.handlers.SessionCreationEventHandler 88% :white_check_mark:
com.aws.greengrass.clientdevices.auth.metrics.handlers.MetricsConfigurationChangedHandler 70% :white_check_mark:
com.aws.greengrass.clientdevices.auth.metrics.handlers.AuthorizeClientDeviceActionsMetricHandler 88% :white_check_mark:
com.aws.greengrass.clientdevices.auth.metrics.handlers.VerifyClientDeviceIdentityEventHandler 88% :white_check_mark:
com.aws.greengrass.clientdevices.auth.metrics.handlers.CertificateSubscriptionEventHandler 83% :white_check_mark:
com.aws.greengrass.clientdevices.auth.util.ResizableLinkedBlockingQueue 90% :white_check_mark:
com.aws.greengrass.clientdevices.auth.util.ParseIPAddress 90% :white_check_mark:
com.aws.greengrass.clientdevices.auth.connectivity.CISShadowMonitor$SucceedOnceOperation 88% :white_check_mark:
com.aws.greengrass.clientdevices.auth.connectivity.CISShadowMonitor 79% :white_check_mark:
com.aws.greengrass.clientdevices.auth.connectivity.CISShadowMonitor$ProcessCISShadowTask 83% :white_check_mark:
com.aws.greengrass.clientdevices.auth.connectivity.CISShadowMonitor$CISShadowTaskQueue 82% :white_check_mark:
com.aws.greengrass.clientdevices.auth.connectivity.HostAddress 67% :white_check_mark:
com.aws.greengrass.clientdevices.auth.connectivity.CISShadowMonitor$CISShadowTaskExecutor 80% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.parser.TokenMgrError 22% :x:
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpressionTokenManager 61% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.parser.ASTStart 33% :x:
com.aws.greengrass.clientdevices.auth.configuration.parser.ASTAnd 67% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.parser.Token 58% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpressionDefaultVisitor 0% :x:
com.aws.greengrass.clientdevices.auth.configuration.parser.ASTOr 67% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.parser.SimpleCharStream 28% :x:
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpressionTreeConstants 0% :x:
com.aws.greengrass.clientdevices.auth.configuration.parser.JJTRuleExpressionState 67% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.parser.ASTThing 67% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpression 63% :white_check_mark:
com.aws.greengrass.clientdevices.auth.configuration.parser.SimpleNode 27% :x:

Minimum allowed coverage is 50%

Generated by :monkey: cobertura-action against a36283d80104f69ab5a9469a0a3ba66ab988dd93

github-actions[bot] commented 9 months ago

Benchmark Results

Benchmark Score
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_policy_with_thing_name_variable_WHEN_auth_request_THEN_successful_auth 1273596.88 ops/s
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_policy_with_wildcards_WHEN_auth_request_THEN_successful_auth 208346.16 ops/s
com.aws.greengrass.clientdevices.auth.benchmark.AuthorizationBenchmarks.GIVEN_single_group_permission_WHEN_simple_auth_request_THEN_successful_auth 2487850.43 ops/s