Made some fairly large changes to the underlying implementations, however the test logic was unchanged (minus type compatibility) to ensure backwards compatibility.
$ git rev-parse HEAD && go test -v ./...
9edddc0df5e33a039577c004cef6b874c81cf89c
# github.com/18F/cf-cdn-service-broker/cmd/cdn-broker [github.com/18F/cf-cdn-service-broker/cmd/cdn-broker.test]
cmd/cdn-broker/main.go:71:28: cannot use broker (type *broker.CdnServiceBroker) as type brokerapi.ServiceBroker in argument to brokerapi.New:
*broker.CdnServiceBroker does not implement brokerapi.ServiceBroker (wrong type for Bind method)
have Bind(context.Context, string, string, brokerapi.BindDetails) (brokerapi.Binding, error)
want Bind(context.Context, string, string, brokerapi.BindDetails, bool) (brokerapi.Binding, error)
cmd/cdn-broker/main_test.go:16:3: cannot use &broker.CdnServiceBroker literal (type *broker.CdnServiceBroker) as type brokerapi.ServiceBroker in argument to brokerapi.New:
*broker.CdnServiceBroker does not implement brokerapi.ServiceBroker (wrong type for Bind method)
have Bind(context.Context, string, string, brokerapi.BindDetails) (brokerapi.Binding, error)
want Bind(context.Context, string, string, brokerapi.BindDetails, bool) (brokerapi.Binding, error)
=== RUN TestBind
--- PASS: TestBind (0.00s)
=== RUN TestUnbind
--- PASS: TestUnbind (0.00s)
=== RUN TestLastOperation
=== RUN TestLastOperation/TestLastOperationDeprovisioning
=== RUN TestLastOperation/TestLastOperationMissing
=== RUN TestLastOperation/TestLastOperationProvisioning
=== RUN TestLastOperation/TestLastOperationSucceeded
--- PASS: TestLastOperation (0.00s)
--- PASS: TestLastOperation/TestLastOperationDeprovisioning (0.00s)
--- PASS: TestLastOperation/TestLastOperationMissing (0.00s)
--- PASS: TestLastOperation/TestLastOperationProvisioning (0.00s)
--- PASS: TestLastOperation/TestLastOperationSucceeded (0.00s)
=== RUN TestProvisioning
=== RUN TestProvisioning/TestDomainNotExists
=== RUN TestProvisioning/TestForwardedHeadersDuplicates
=== RUN TestProvisioning/TestForwardedHeadersMoreThanTen
=== RUN TestProvisioning/TestForwardedHeadersWhitelistAndWildcard
=== RUN TestProvisioning/TestInstanceExists
=== RUN TestProvisioning/TestMultipleDomainsMoreThanOneNotExists
=== RUN TestProvisioning/TestMultipleDomainsOneNotExists
=== RUN TestProvisioning/TestSuccess
=== RUN TestProvisioning/TestSuccessCustomOrigin
=== RUN TestProvisioning/TestSuccessForwardedSingleHeader
=== RUN TestProvisioning/TestSuccessForwardingDuplicatedHostHeader
=== RUN TestProvisioning/TestSuccessForwardingWildcardHeader
=== RUN TestProvisioning/TestSuccessNineForwardedHeaders
=== RUN TestProvisioning/TestSync
=== RUN TestProvisioning/TestWithoutDetails
=== RUN TestProvisioning/TestWithoutOptions
--- PASS: TestProvisioning (0.01s)
--- PASS: TestProvisioning/TestDomainNotExists (0.00s)
--- PASS: TestProvisioning/TestForwardedHeadersDuplicates (0.00s)
--- PASS: TestProvisioning/TestForwardedHeadersMoreThanTen (0.00s)
--- PASS: TestProvisioning/TestForwardedHeadersWhitelistAndWildcard (0.00s)
--- PASS: TestProvisioning/TestInstanceExists (0.00s)
--- PASS: TestProvisioning/TestMultipleDomainsMoreThanOneNotExists (0.00s)
--- PASS: TestProvisioning/TestMultipleDomainsOneNotExists (0.00s)
--- PASS: TestProvisioning/TestSuccess (0.00s)
--- PASS: TestProvisioning/TestSuccessCustomOrigin (0.00s)
--- PASS: TestProvisioning/TestSuccessForwardedSingleHeader (0.00s)
--- PASS: TestProvisioning/TestSuccessForwardingDuplicatedHostHeader (0.00s)
--- PASS: TestProvisioning/TestSuccessForwardingWildcardHeader (0.00s)
--- PASS: TestProvisioning/TestSuccessNineForwardedHeaders (0.00s)
--- PASS: TestProvisioning/TestSync (0.00s)
--- PASS: TestProvisioning/TestWithoutDetails (0.00s)
--- PASS: TestProvisioning/TestWithoutOptions (0.00s)
=== RUN TestUpdating
=== RUN TestUpdating/TestDomainNotExists
=== RUN TestUpdating/TestForwardedHeadersMoreThanTen
=== RUN TestUpdating/TestForwardedHeadersWhitelistAndWildcard
=== RUN TestUpdating/TestSuccessForwardedSingleHeader
=== RUN TestUpdating/TestSuccessForwardingDuplicatedHostHeader
=== RUN TestUpdating/TestSuccessForwardingWildcardHeader
=== RUN TestUpdating/TestSuccessNineForwardedHeaders
=== RUN TestUpdating/TestUpdateSuccess
=== RUN TestUpdating/TestUpdateSuccessOnlyDomain
=== RUN TestUpdating/TestUpdateSuccessOnlyOrigin
=== RUN TestUpdating/TestUpdateWithoutOptions
--- PASS: TestUpdating (0.00s)
--- PASS: TestUpdating/TestDomainNotExists (0.00s)
--- PASS: TestUpdating/TestForwardedHeadersMoreThanTen (0.00s)
--- PASS: TestUpdating/TestForwardedHeadersWhitelistAndWildcard (0.00s)
--- PASS: TestUpdating/TestSuccessForwardedSingleHeader (0.00s)
--- PASS: TestUpdating/TestSuccessForwardingDuplicatedHostHeader (0.00s)
--- PASS: TestUpdating/TestSuccessForwardingWildcardHeader (0.00s)
--- PASS: TestUpdating/TestSuccessNineForwardedHeaders (0.00s)
--- PASS: TestUpdating/TestUpdateSuccess (0.00s)
--- PASS: TestUpdating/TestUpdateSuccessOnlyDomain (0.00s)
--- PASS: TestUpdating/TestUpdateSuccessOnlyOrigin (0.00s)
--- PASS: TestUpdating/TestUpdateWithoutOptions (0.00s)
PASS
ok github.com/18F/cf-cdn-service-broker/broker (cached)
? github.com/18F/cf-cdn-service-broker/cf [no test files]
? github.com/18F/cf-cdn-service-broker/cf/mocks [no test files]
FAIL github.com/18F/cf-cdn-service-broker/cmd/cdn-broker [build failed]
? github.com/18F/cf-cdn-service-broker/cmd/cdn-cron [no test files]
? github.com/18F/cf-cdn-service-broker/config [no test files]
? github.com/18F/cf-cdn-service-broker/healthchecks [no test files]
=== RUN TestDeleteOrphanedCerts
{"timestamp":"1555358880.991091013","source":"cdn-cron-test","message":"cdn-cron-test.Deleting orphaned certificate","log_level":1,"data":{"cert":{"Arn":"some-orphaned-cert","Expiration":null,"Path":null,"ServerCertificateId":"this-cert-should-be-deleted","ServerCertificateName":"some-orphaned-cert","UploadDate":"2019-04-13T14:08:00.990981-06:00"}}}
{"timestamp":"1555358880.991387844","source":"cdn-cron-test","message":"cdn-cron-test.Deleting orphaned certificate","log_level":1,"data":{"cert":{"Arn":"some-other-orphaned-cert","Expiration":null,"Path":null,"ServerCertificateId":"this-cert-should-also-be-deleted","ServerCertificateName":"some-other-orphaned-cert","UploadDate":"2019-04-13T14:08:00.990981-06:00"}}}
--- PASS: TestDeleteOrphanedCerts (0.00s)
models_test.go:156: PASS: DeleteCertificate(string)
models_test.go:156: PASS: DeleteCertificate(string)
PASS
ok github.com/18F/cf-cdn-service-broker/models (cached)
? github.com/18F/cf-cdn-service-broker/models/mocks [no test files]
=== RUN TestHeaders
=== RUN TestHeaders/TestAdd
=== RUN TestHeaders/TestContains
=== RUN TestHeaders/TestStrings
--- PASS: TestHeaders (0.00s)
--- PASS: TestHeaders/TestAdd (0.00s)
--- PASS: TestHeaders/TestContains (0.00s)
--- PASS: TestHeaders/TestStrings (0.00s)
PASS
ok github.com/18F/cf-cdn-service-broker/utils (cached)
updated from dep package manager to vgo, the default in go1.12 and above.
fixed dependency issue where the lego client was pointing to github.com/jmcarp/lego, it's now pointing directly to github.com/go-acme/lego
removed acme challenge JSON payloads as they are no longer needed.
refactored DNS challenge logic. originally, the acme client needed to perform the challenges manually. that's no longer the case, so in order for things to work properly, the dns challenge is now surfaced through a channel directly from our mock dns provider. not ideal, but it should work for now.
removed RouteManager.ensureChallenges since we no longer need to worry about specific challenges.
refactored a bunch of the session references to localSession to prevent naming collisions.
fixed deferral leak.
fixed error string formatting to be complaint with golang recommendations.
refactored certificate expiry parsing. since acme now gives us the cert directly, we can convert it to an x509.Certificate, and grab the NotAfter field.
changed RouteManager.deployCertificate calls to include dereferences.
added internal error checking to RouteManager.DeleteOrphanedCerts so we can at least query for error messages.
refactored RouteManager.getClients to RouteManager.getClient to also handle the dns provider channel. updated it's internal AWS session instantiation to use recommended APIs.
updated RouteManager.deployCertificate to use the proper types.
updated RouteManager test suite to use the proper typing.
updated the healthcheck lego client to work with the latest and greatest.
internalised the old github.com/jmcarp/lego/acme.WaitFor function as it was removed from the upstream client, but I believe it was useful, so it was moved internally.
Made some fairly large changes to the underlying implementations, however the test logic was unchanged (minus type compatibility) to ensure backwards compatibility.
updated from
dep
package manager tovgo
, the default in go1.12 and above.fixed dependency issue where the lego client was pointing to github.com/jmcarp/lego, it's now pointing directly to github.com/go-acme/lego
removed acme challenge JSON payloads as they are no longer needed.
refactored DNS challenge logic. originally, the acme client needed to perform the challenges manually. that's no longer the case, so in order for things to work properly, the dns challenge is now surfaced through a channel directly from our mock dns provider. not ideal, but it should work for now.
removed
RouteManager.ensureChallenges
since we no longer need to worry about specific challenges.refactored a bunch of the session references to
localSession
to prevent naming collisions.fixed deferral leak.
fixed error string formatting to be complaint with golang recommendations.
refactored certificate expiry parsing. since acme now gives us the cert directly, we can convert it to an x509.Certificate, and grab the
NotAfter
field.changed
RouteManager.deployCertificate
calls to include dereferences.added internal error checking to
RouteManager.DeleteOrphanedCerts
so we can at least query for error messages.refactored
RouteManager.getClients
toRouteManager.getClient
to also handle the dns provider channel. updated it's internal AWS session instantiation to use recommended APIs.updated
RouteManager.deployCertificate
to use the proper types.updated RouteManager test suite to use the proper typing.
updated the healthcheck lego client to work with the latest and greatest.
internalised the old
github.com/jmcarp/lego/acme.WaitFor
function as it was removed from the upstream client, but I believe it was useful, so it was moved internally.updated AWS IAM resource types.
Signed-off-by: Mike Lloyd mike.lloyd@gsa.gov