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

fix: lazy load connectivity info #107

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jbutler
Copy link
Contributor

@jbutler jbutler commented Aug 18, 2022

Initial calls to getCachedConnectivityInfo() may return an empty list if
it occurs before an initial call to getConnectivityInfo(). This change
will ensure that getConnectivityInfo() has been called when returning
cached results.

Issue #, if available:

Description of changes:

Why is this change necessary:

    "certificates": {
      "disableCertificateRotation": true
    }

Disabling certificate rotation does not work as expected, as the initial certificate does not contain connectivity information. This change forces an initial load so that this config option is actually usable without needing to restart the CDA component.

How was this change tested:
Deployed CDA with above config and confirmed that connectivity info is included in the initial certificate.

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
Copy link

github-actions bot commented Aug 18, 2022

Unit Tests Coverage Report

File Coverage Lines Branches
All files 68% 75% 61%
com.aws.greengrass.clientdevices.auth.ClientDevicesAuthService 82% 90% 73%
com.aws.greengrass.clientdevices.auth.PermissionEvaluationUtils 78% 82% 74%
com.aws.greengrass.clientdevices.auth.DeviceAuthClient 58% 60% 57%
com.aws.greengrass.clientdevices.auth.PermissionEvaluationUtils$Operation 100% 100% 0%
com.aws.greengrass.clientdevices.auth.PermissionEvaluationUtils$Resource 100% 100% 0%
com.aws.greengrass.clientdevices.auth.CertificateManager 80% 96% 64%
com.aws.greengrass.clientdevices.auth.iot.registry.ThingRegistry 100% 100% 100%
com.aws.greengrass.clientdevices.auth.iot.registry.CertificateRegistry 67% 85% 50%
com.aws.greengrass.clientdevices.auth.iot.registry.ThingRegistry$1 75% 100% 50%
com.aws.greengrass.clientdevices.auth.iot.registry.RegistryConfig 0% 0% 0%
com.aws.greengrass.clientdevices.auth.iot.registry.CertificateRegistry$1 75% 100% 50%
com.aws.greengrass.clientdevices.auth.certificate.CertificateGenerator 70% 90% 50%
com.aws.greengrass.clientdevices.auth.certificate.CISShadowMonitor$1 83% 83% 0%
com.aws.greengrass.clientdevices.auth.certificate.CertificateStore$CAType 100% 100% 0%
com.aws.greengrass.clientdevices.auth.certificate.ClientCertificateGenerator 96% 93% 100%
com.aws.greengrass.clientdevices.auth.certificate.CertificateHelper 76% 99% 54%
com.aws.greengrass.clientdevices.auth.certificate.CertificateStore 76% 85% 67%
com.aws.greengrass.clientdevices.auth.certificate.CertificateExpiryMonitor 77% 88% 67%
com.aws.greengrass.clientdevices.auth.certificate.CISShadowMonitor 62% 78% 45%
com.aws.greengrass.clientdevices.auth.certificate.CertificateExpiryMonitor$CertRotationDecider 90% 100% 80%
com.aws.greengrass.clientdevices.auth.certificate.ServerCertificateGenerator 95% 90% 100%
com.aws.greengrass.clientdevices.auth.certificate.CertificatesConfig 100% 100% 100%
com.aws.greengrass.clientdevices.auth.configuration.AuthorizationPolicyStatement$Effect 100% 100% 0%
com.aws.greengrass.clientdevices.auth.configuration.GroupDefinition 75% 100% 50%
com.aws.greengrass.clientdevices.auth.configuration.ExpressionVisitor 84% 94% 75%
com.aws.greengrass.clientdevices.auth.configuration.GroupManager 89% 94% 83%
com.aws.greengrass.clientdevices.auth.configuration.ConfigurationFormatVersion 100% 100% 0%
com.aws.greengrass.clientdevices.auth.configuration.GroupConfiguration 90% 95% 86%
com.aws.greengrass.clientdevices.auth.api.ClientDevicesAuthServiceApi 54% 59% 50%
com.aws.greengrass.clientdevices.auth.api.GetCertificateRequestOptions$CertificateType 100% 100% 0%
com.aws.greengrass.clientdevices.auth.session.attribute.StringLiteralAttribute 100% 100% 0%
com.aws.greengrass.clientdevices.auth.session.attribute.WildcardSuffixAttribute 88% 100% 75%
com.aws.greengrass.clientdevices.auth.util.ResizableLinkedBlockingQueue 90% 80% 100%
com.aws.greengrass.clientdevices.auth.util.ParseIPAddress 90% 95% 84%
com.aws.greengrass.clientdevices.auth.iot.IotAuthClient$Default 83% 86% 80%
com.aws.greengrass.clientdevices.auth.iot.Thing 100% 100% 100%
com.aws.greengrass.clientdevices.auth.iot.Component 67% 67% 0%
com.aws.greengrass.clientdevices.auth.iot.ConnectivityInfoProvider 92% 100% 83%
com.aws.greengrass.clientdevices.auth.iot.Certificate 100% 100% 0%
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpressionDefaultVisitor 0% 0% 0%
com.aws.greengrass.clientdevices.auth.configuration.parser.ASTOr 67% 67% 0%
com.aws.greengrass.clientdevices.auth.configuration.parser.SimpleCharStream 28% 31% 25%
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpressionTreeConstants 0% 0% 0%
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpressionConstants 100% 100% 0%
com.aws.greengrass.clientdevices.auth.configuration.parser.TokenMgrError 22% 32% 12%
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpressionTokenManager 61% 65% 58%
com.aws.greengrass.clientdevices.auth.configuration.parser.JJTRuleExpressionState 67% 65% 70%
com.aws.greengrass.clientdevices.auth.configuration.parser.ASTThing 67% 67% 0%
com.aws.greengrass.clientdevices.auth.configuration.parser.ASTStart 33% 33% 0%
com.aws.greengrass.clientdevices.auth.configuration.parser.RuleExpression 63% 63% 62%
com.aws.greengrass.clientdevices.auth.configuration.parser.ASTAnd 67% 67% 0%
com.aws.greengrass.clientdevices.auth.configuration.parser.SimpleNode 27% 35% 19%
com.aws.greengrass.clientdevices.auth.configuration.parser.Token 58% 58% 0%
com.aws.greengrass.ipc.IPCUtils 58% 67% 50%
com.aws.greengrass.ipc.GetClientDeviceAuthTokenOperationHandler 87% 98% 75%
com.aws.greengrass.ipc.VerifyClientDeviceIdentityOperationHandler 64% 79% 50%
com.aws.greengrass.ipc.AuthorizeClientDeviceActionOperationHandler 80% 93% 67%
com.aws.greengrass.ipc.SubscribeToCertificateUpdatesOperationHandler 77% 87% 67%
com.aws.greengrass.clientdevices.auth.session.SessionCreator 100% 100% 100%
com.aws.greengrass.clientdevices.auth.session.SessionConfig 92% 100% 83%
com.aws.greengrass.clientdevices.auth.session.SessionManager 88% 100% 75%
com.aws.greengrass.clientdevices.auth.session.SessionImpl 94% 89% 100%
com.aws.greengrass.clientdevices.auth.session.SessionManager$1 100% 100% 100%
com.aws.greengrass.clientdevices.auth.session.SessionCreator$SessionFactorySingleton 100% 100% 0%
com.aws.greengrass.clientdevices.auth.session.MqttSessionFactory 100% 100% 100%
com.aws.greengrass.clientdevices.auth.session.MqttSessionFactory$MqttCredential 100% 100% 0%

Minimum allowed coverage is 50%

Generated by 🐒 cobertura-action against c63e827

Initial calls to getCachedConnectivityInfo() may return an empty list if
it occurs before an initial call to getConnectivityInfo(). This change
will ensure that getConnectivityInfo() has been called when returning
cached results.
Copy link
Member

@MikeDombo MikeDombo left a comment

Choose a reason for hiding this comment

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

Still want this change?

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.

3 participants