-
-
Notifications
You must be signed in to change notification settings - Fork 16
remove deprecated service #780
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
Open
ewollesen
wants to merge
8
commits into
master
Choose a base branch
from
eric-platform-deprecated-service
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
50bd065
add a comment to declare the goal
ewollesen acf2d47
run the deprecated service contemporarily with the new service code
ewollesen 1c523f8
remove the deprecated service
ewollesen 71f63c4
minimal modifications of the deprecated service tests, to test the ne…
ewollesen bbb7a49
restore the deprecated service tests, applied to Authenticated
ewollesen 87e2501
remove duplicated/replaced tests
ewollesen 180cc9a
initialize the authentication client
ewollesen 04e96e0
add a test for auth client initialization
ewollesen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,88 @@ | ||
| package service_test | ||
|
|
||
| import ( | ||
| "net/http" | ||
|
|
||
| . "github.com/onsi/ginkgo/v2" | ||
| . "github.com/onsi/gomega" | ||
| . "github.com/onsi/gomega/ghttp" | ||
|
|
||
| applicationTest "github.com/tidepool-org/platform/application/test" | ||
| authTest "github.com/tidepool-org/platform/auth/test" | ||
| configTest "github.com/tidepool-org/platform/config/test" | ||
| serviceService "github.com/tidepool-org/platform/service/service" | ||
| ) | ||
|
|
||
| var _ = Describe("Authenticated", func() { | ||
|
|
||
| var provider *applicationTest.Provider | ||
| var svc *serviceService.Authenticated | ||
| var serverSecret string | ||
| var sessionToken string | ||
| var authClientConfig map[string]interface{} | ||
| var serviceConfig map[string]interface{} | ||
| var serverConfig map[string]interface{} | ||
| var testServer *Server | ||
|
|
||
| BeforeEach(func() { | ||
| provider = applicationTest.NewProviderWithDefaults() | ||
|
|
||
| serverSecret = authTest.NewServiceSecret() | ||
| sessionToken = authTest.NewSessionToken() | ||
|
|
||
| testServer = NewServer() | ||
| testServer.AppendHandlers( | ||
| CombineHandlers( | ||
| VerifyRequest("POST", "/auth/serverlogin"), | ||
| VerifyHeaderKV("X-Tidepool-Server-Name", *provider.NameOutput), | ||
| VerifyHeaderKV("X-Tidepool-Server-Secret", serverSecret), | ||
| VerifyBody(nil), | ||
| RespondWith(http.StatusOK, nil, http.Header{"X-Tidepool-Session-Token": []string{sessionToken}})), | ||
| ) | ||
|
|
||
| authClientConfig = map[string]interface{}{ | ||
| "address": testServer.URL(), | ||
| "server_token_secret": authTest.NewServiceSecret(), | ||
| "external": map[string]interface{}{ | ||
| "address": testServer.URL(), | ||
| "server_session_token_secret": serverSecret, | ||
| }, | ||
| } | ||
| serverConfig = map[string]interface{}{ | ||
| "address": testServer.URL(), | ||
| "tls": "false", | ||
| } | ||
| serviceConfig = map[string]interface{}{ | ||
| "secret": authTest.NewServiceSecret(), | ||
| "server": serverConfig, | ||
| "auth": map[string]interface{}{ | ||
| "client": authClientConfig, | ||
| }, | ||
| } | ||
| (*provider.ConfigReporterOutput).(*configTest.Reporter).Config = serviceConfig | ||
|
|
||
| svc = serviceService.NewAuthenticated() | ||
| Expect(svc).ToNot(BeNil()) | ||
|
|
||
| Expect(svc.Initialize(provider)).To(Succeed()) | ||
| }) | ||
|
|
||
| AfterEach(func() { | ||
| if svc != nil { | ||
| svc.Terminate() | ||
| } | ||
| provider.AssertOutputsEmpty() | ||
| }) | ||
|
|
||
| It("returns the secret", func() { | ||
| Expect(svc.Secret()).To(Equal(serviceConfig["secret"])) | ||
| }) | ||
|
|
||
| Context("AuthClient", func() { | ||
| It("returns successfully with server token", func() { | ||
| authClient := svc.AuthClient() | ||
| Expect(authClient).ToNot(BeNil()) | ||
| Eventually(authClient.ServerSessionToken).Should(Equal(sessionToken)) | ||
| }) | ||
| }) | ||
| }) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.