From ef09620ce0036a7d4d89d97712130d35225506fc Mon Sep 17 00:00:00 2001 From: lostlevels Date: Tue, 16 Apr 2024 15:44:58 -0700 Subject: [PATCH 1/5] [BACK-2996] Add environment variable config for disabling some tasks. --- task/service/service/service.go | 45 +++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/task/service/service/service.go b/task/service/service/service.go index 874254535d..d035dff156 100644 --- a/task/service/service/service.go +++ b/task/service/service/service.go @@ -4,6 +4,8 @@ import ( "context" "fmt" + "github.com/kelseyhightower/envconfig" + "github.com/tidepool-org/platform/clinics" "github.com/tidepool-org/platform/ehr/reconcile" "github.com/tidepool-org/platform/ehr/sync" @@ -31,6 +33,12 @@ import ( summaryUpdate "github.com/tidepool-org/platform/task/summary" ) +// taskConfig is mainly used to disable certain tasks (for shadowing) +type taskConfig struct { + DisableDexcom bool `envconfig:"TIDEPOOL_TASK_DISABLE_DEXCOM"` + DisableClinic bool `envconfig:"TIDEPOOL_TASK_DISABLE_CLINIC"` +} + type Service struct { *serviceService.Authenticated taskStore store.Store @@ -40,6 +48,7 @@ type Service struct { dexcomClient dexcom.Client taskQueue queue.Queue clinicsClient clinics.Client + cfg taskConfig } func New() *Service { @@ -53,6 +62,10 @@ func (s *Service) Initialize(provider application.Provider) error { return err } + if err := envconfig.Process("", s.cfg); err != nil { + return err + } + if err := s.initializeTaskStore(); err != nil { return err } @@ -222,6 +235,10 @@ func (s *Service) terminateDataSourceClient() { } func (s *Service) initializeDexcomClient() error { + if s.cfg.DisableDexcom { + s.Logger().Debug("Skipping creating dexcom provider") + return nil + } s.Logger().Debug("Loading dexcom provider") dxcmPrvdr, err := dexcomProvider.New(s.ConfigReporter().WithScopes("provider"), s.dataSourceClient, s.TaskClient()) @@ -258,6 +275,11 @@ func (s *Service) terminateDexcomClient() { } func (s *Service) initializeClinicsClient() error { + if s.cfg.DisableClinic { + s.Logger().Debug("Skipping creating clinics client") + return nil + } + s.Logger().Debug("Creating clinics client") clnt, err := clinics.NewClient(s.AuthClient()) @@ -287,14 +309,13 @@ func (s *Service) initializeTaskQueue() error { s.taskQueue = taskQueue var runners []queue.Runner - if s.dexcomClient != nil { + if !s.cfg.DisableDexcom && s.dexcomClient != nil { s.Logger().Debug("Creating dexcom fetch runner") rnnr, rnnrErr := dexcomFetch.NewRunner(s.Logger(), s.VersionReporter(), s.AuthClient(), s.dataClient, s.dataSourceClient, s.dexcomClient) if rnnrErr != nil { return errors.Wrap(rnnrErr, "unable to create dexcom fetch runner") } - runners = append(runners, rnnr) } @@ -318,17 +339,19 @@ func (s *Service) initializeTaskQueue() error { } taskQueue.RegisterRunner(summaryMigrationRnnr) - ehrReconcileRnnr, err := reconcile.NewRunner(s.AuthClient(), s.clinicsClient, s.taskClient, s.Logger()) - if err != nil { - return errors.Wrap(err, "unable to create ehr reconcile runner") - } - runners = append(runners, ehrReconcileRnnr) + if !s.cfg.DisableClinic { + ehrReconcileRnnr, err := reconcile.NewRunner(s.AuthClient(), s.clinicsClient, s.taskClient, s.Logger()) + if err != nil { + return errors.Wrap(err, "unable to create ehr reconcile runner") + } + runners = append(runners, ehrReconcileRnnr) - ehrSyncRnnr, err := sync.NewRunner(s.clinicsClient, s.Logger()) - if err != nil { - return errors.Wrap(err, "unable to create ehr sync runner") + ehrSyncRnnr, err := sync.NewRunner(s.clinicsClient, s.Logger()) + if err != nil { + return errors.Wrap(err, "unable to create ehr sync runner") + } + runners = append(runners, ehrSyncRnnr) } - runners = append(runners, ehrSyncRnnr) for _, r := range runners { r := r From 4af2f688c40779556bd43c5785ee9e929d0ec91f Mon Sep 17 00:00:00 2001 From: lostlevels Date: Mon, 22 Apr 2024 10:05:32 -0700 Subject: [PATCH 2/5] Use pointer in envconfig. --- task/service/service/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/task/service/service/service.go b/task/service/service/service.go index d035dff156..9360f0a69c 100644 --- a/task/service/service/service.go +++ b/task/service/service/service.go @@ -62,7 +62,7 @@ func (s *Service) Initialize(provider application.Provider) error { return err } - if err := envconfig.Process("", s.cfg); err != nil { + if err := envconfig.Process("", &s.cfg); err != nil { return err } From 3ea1268ec8e92ee5b68fcd831e40511afdfa698d Mon Sep 17 00:00:00 2001 From: lostlevels Date: Wed, 3 Jan 2024 11:42:42 -0800 Subject: [PATCH 3/5] [BACK-2416] Add optional TIDEPOOL_AUTH_CLIENT_EXTERNAL_PATH_PREFIX environment variable for path prefixes to auth services calls. --- auth/client/client_test.go | 2 ++ auth/client/external.go | 8 ++++++-- client/client.go | 6 +++++- env.sh | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/auth/client/client_test.go b/auth/client/client_test.go index 76fdad9723..d43ea60926 100644 --- a/auth/client/client_test.go +++ b/auth/client/client_test.go @@ -54,6 +54,7 @@ var _ = Describe("Client", func() { config.Config.UserAgent = testHttp.NewUserAgent() config.Config.ServiceSecret = authTest.NewServiceSecret() config.ExternalConfig.Address = testHttp.NewAddress() + config.ExternalConfig.PathPrefix = "auth" config.ExternalConfig.UserAgent = testHttp.NewUserAgent() config.ExternalConfig.ServerSessionTokenSecret = serverTokenSecret config.ExternalConfig.ServerSessionTokenTimeout = time.Duration(serverTokenTimeout) * time.Second @@ -115,6 +116,7 @@ var _ = Describe("Client", func() { config.Config.UserAgent = testHttp.NewUserAgent() config.Config.ServiceSecret = authTest.NewServiceSecret() config.ExternalConfig.Address = server.URL() + config.ExternalConfig.PathPrefix = "auth" config.ExternalConfig.UserAgent = testHttp.NewUserAgent() config.ExternalConfig.ServerSessionTokenSecret = serverTokenSecret authorizeAs = platform.AuthorizeAsService diff --git a/auth/client/external.go b/auth/client/external.go index 8eb9f45ff1..c0c7149e0c 100644 --- a/auth/client/external.go +++ b/auth/client/external.go @@ -68,6 +68,8 @@ type ExternalConfig struct { *platform.Config ServerSessionTokenSecret string `envconfig:"TIDEPOOL_AUTH_CLIENT_EXTERNAL_SERVER_SESSION_TOKEN_SECRET"` ServerSessionTokenTimeout time.Duration `envconfig:"TIDEPOOL_AUTH_CLIENT_EXTERNAL_SERVER_SESSION_TOKEN_TIMEOUT" default:"1h"` + // PathPrefix to prepend to the path of any service calls (if any). + PathPrefix string `envconfig:"TIDEPOOL_AUTH_CLIENT_EXTERNAL_PATH_PREFIX" default:"auth"` } func NewExternalConfig() *ExternalConfig { @@ -107,6 +109,7 @@ type External struct { serverSessionTokenMutex sync.Mutex serverSessionTokenSafe string closingChannel chan chan bool + PathPrefix string // PathPrefix is the prefix to prepend to all external URL path calls to the auth service (if any) } func NewExternal(cfg *ExternalConfig, authorizeAs platform.AuthorizeAs, name string, lgr log.Logger) (*External, error) { @@ -135,6 +138,7 @@ func NewExternal(cfg *ExternalConfig, authorizeAs platform.AuthorizeAs, name str name: name, serverSessionTokenSecret: cfg.ServerSessionTokenSecret, serverSessionTokenTimeout: cfg.ServerSessionTokenTimeout, + PathPrefix: cfg.PathPrefix, }, nil } @@ -200,7 +204,7 @@ func (e *External) ValidateSessionToken(ctx context.Context, token string) (requ IsServer bool UserID string } - if err := e.client.RequestData(ctx, "GET", e.client.ConstructURL("auth", "token", token), nil, nil, &result); err != nil { + if err := e.client.RequestData(ctx, "GET", e.client.ConstructURL(e.PathPrefix, "token", token), nil, nil, &result); err != nil { return nil, err } @@ -301,7 +305,7 @@ func (e *External) refreshServerSessionToken() error { e.logger.Debug("Refreshing server session token") requestMethod := "POST" - requestURL := e.client.ConstructURL("auth", "serverlogin") + requestURL := e.client.ConstructURL(e.PathPrefix, "serverlogin") request, err := http.NewRequest(requestMethod, requestURL, nil) if err != nil { return errors.Wrapf(err, "unable to create new request for %s %s", requestMethod, requestURL) diff --git a/client/client.go b/client/client.go index 24e8f30b61..55e77b97b1 100644 --- a/client/client.go +++ b/client/client.go @@ -39,7 +39,11 @@ func New(cfg *Config) (*Client, error) { func (c *Client) ConstructURL(paths ...string) string { segments := []string{} for _, path := range paths { - segments = append(segments, url.PathEscape(strings.Trim(path, "/"))) + escapedPath := url.PathEscape(strings.Trim(path, "/")) + if escapedPath == "" { + continue + } + segments = append(segments, escapedPath) } return fmt.Sprintf("%s/%s", strings.TrimRight(c.address, "/"), strings.Join(segments, "/")) } diff --git a/env.sh b/env.sh index 13f8a66e31..22ec573817 100644 --- a/env.sh +++ b/env.sh @@ -32,6 +32,7 @@ export TIDEPOOL_USER_CLIENT_ADDRESS="http://localhost:8009" export TIDEPOOL_AUTH_CLIENT_EXTERNAL_ADDRESS="http://localhost:8009" export TIDEPOOL_AUTH_CLIENT_EXTERNAL_SERVER_SESSION_TOKEN_SECRET="This needs to be the same secret everywhere. YaHut75NsK1f9UKUXuWqxNN0RUwHFBCy" +export TIDEPOOL_AUTH_CLIENT_EXTERNAL_PATH_PREFIX="auth" export TIDEPOOL_AUTH_SERVICE_SERVER_ADDRESS=":9222" export TIDEPOOL_BLOB_SERVICE_SERVER_ADDRESS=":9225" From 0f89c037008095bcc7abffb891d0f3dae2845ca1 Mon Sep 17 00:00:00 2001 From: Todd Kazakov Date: Wed, 15 Mar 2023 15:43:41 +0200 Subject: [PATCH 4/5] Add ability to disable index creation on startup with an env variable Allow disabling the user events handler Add error context Fix imports --- auth/service/service/service.go | 19 +++++++++++++------ blob/service/service.go | 19 +++++++++++++------ client/config.go | 3 ++- client/config_test.go | 2 +- data/service/service/standard.go | 20 ++++++++++++++------ events/events.go | 25 +++++++++++++++++++++++++ platform/config_test.go | 2 +- store/structured/mongo/config.go | 19 ++++++++++--------- store/structured/mongo/repository.go | 12 +++++++++++- store/structured/mongo/store.go | 5 ++++- 10 files changed, 94 insertions(+), 32 deletions(-) diff --git a/auth/service/service/service.go b/auth/service/service/service.go index abc5011970..178e035c05 100644 --- a/auth/service/service/service.go +++ b/auth/service/service/service.go @@ -108,7 +108,7 @@ func (s *Service) Initialize(provider application.Provider) error { if err := s.initializeDeviceCheck(); err != nil { return err } - return s.initializeUserEventsHandler() + return s.initializeUserEventsHandler(provider) } func (s *Service) Terminate() { @@ -400,13 +400,20 @@ func (s *Service) terminateAuthClient() { } } -func (s *Service) initializeUserEventsHandler() error { +func (s *Service) initializeUserEventsHandler(provider application.Provider) error { s.Logger().Debug("Initializing user events handler") - ctx := logInternal.NewContextWithLogger(context.Background(), s.Logger()) - handler := authEvents.NewUserDataDeletionHandler(ctx, s.authClient) - handlers := []eventsCommon.EventHandler{handler} - runner := events.NewRunner(handlers) + var runner events.Runner + + configReporter := provider.ConfigReporter().WithScopes("user", "events", "handler") + if configReporter.GetWithDefault("disable", "") != "true" { + ctx := logInternal.NewContextWithLogger(context.Background(), s.Logger()) + handler := authEvents.NewUserDataDeletionHandler(ctx, s.authClient) + handlers := []eventsCommon.EventHandler{handler} + runner = events.NewRunner(handlers) + } else { + runner = events.NewNoopRunner() + } if err := runner.Initialize(); err != nil { return errors.Wrap(err, "unable to initialize events runner") diff --git a/blob/service/service.go b/blob/service/service.go index a8381e2bd4..ee99021c65 100644 --- a/blob/service/service.go +++ b/blob/service/service.go @@ -69,7 +69,7 @@ func (s *Service) Initialize(provider application.Provider) error { if err := s.initializeBlobClient(); err != nil { return err } - if err := s.initializeUserEventsHandler(); err != nil { + if err := s.initializeUserEventsHandler(provider); err != nil { return err } return s.initializeRouter() @@ -211,13 +211,20 @@ func (s *Service) terminateDeviceLogsUnstructuredStore() { } } -func (s *Service) initializeUserEventsHandler() error { +func (s *Service) initializeUserEventsHandler(provider application.Provider) error { s.Logger().Debug("Initializing user events handler") - ctx := logInternal.NewContextWithLogger(context.Background(), s.Logger()) - handler := blobEvents.NewUserDataDeletionHandler(ctx, s.blobClient) - handlers := []eventsCommon.EventHandler{handler} - runner := events.NewRunner(handlers) + var runner events.Runner + + configReporter := provider.ConfigReporter().WithScopes("user", "events", "handler") + if configReporter.GetWithDefault("disable", "") != "true" { + ctx := logInternal.NewContextWithLogger(context.Background(), s.Logger()) + handler := blobEvents.NewUserDataDeletionHandler(ctx, s.blobClient) + handlers := []eventsCommon.EventHandler{handler} + runner = events.NewRunner(handlers) + } else { + runner = events.NewNoopRunner() + } if err := runner.Initialize(); err != nil { return errors.Wrap(err, "unable to initialize events runner") diff --git a/client/config.go b/client/config.go index 74bdd29dcc..c43574fd85 100644 --- a/client/config.go +++ b/client/config.go @@ -1,6 +1,7 @@ package client import ( + "fmt" "net/url" "github.com/kelseyhightower/envconfig" @@ -36,7 +37,7 @@ func (c *Config) Validate() error { if c.Address == "" { return errors.New("address is missing") } else if _, err := url.Parse(c.Address); err != nil { - return errors.New("address is invalid") + return fmt.Errorf("address is invalid: %w", err) } return nil diff --git a/client/config_test.go b/client/config_test.go index 4c22fbcf29..62090aca71 100644 --- a/client/config_test.go +++ b/client/config_test.go @@ -86,7 +86,7 @@ var _ = Describe("Config", func() { It("returns an error if the address is not a parseable URL", func() { cfg.Address = "Not%Parseable" - Expect(cfg.Validate()).To(MatchError("address is invalid")) + Expect(cfg.Validate()).To(MatchError("address is invalid: parse \"Not%Parseable\": invalid URL escape \"%Pa\"")) }) It("returns success", func() { diff --git a/data/service/service/standard.go b/data/service/service/standard.go index 80911f4b20..cea18b84f5 100644 --- a/data/service/service/standard.go +++ b/data/service/service/standard.go @@ -87,7 +87,7 @@ func (s *Standard) Initialize(provider application.Provider) error { if err := s.initializeDataSourceClient(); err != nil { return err } - if err := s.initializeUserEventsHandler(); err != nil { + if err := s.initializeUserEventsHandler(provider); err != nil { return err } if err := s.initializeAPI(); err != nil { @@ -404,14 +404,22 @@ func (s *Standard) initializeServer() error { return nil } -func (s *Standard) initializeUserEventsHandler() error { +func (s *Standard) initializeUserEventsHandler(provider application.Provider) error { s.Logger().Debug("Initializing user events handler") sarama.Logger = log.New(os.Stdout, "SARAMA ", log.LstdFlags|log.Lshortfile) - ctx := logInternal.NewContextWithLogger(context.Background(), s.Logger()) - handler := dataEvents.NewUserDataDeletionHandler(ctx, s.dataStore, s.dataSourceStructuredStore) - handlers := []eventsCommon.EventHandler{handler} - runner := events.NewRunner(handlers) + var runner events.Runner + + configReporter := provider.ConfigReporter().WithScopes("user", "events", "handler") + if configReporter.GetWithDefault("disable", "") != "true" { + ctx := logInternal.NewContextWithLogger(context.Background(), s.Logger()) + handler := dataEvents.NewUserDataDeletionHandler(ctx, s.dataStore, s.dataSourceStructuredStore) + handlers := []eventsCommon.EventHandler{handler} + runner = events.NewRunner(handlers) + } else { + runner = events.NewNoopRunner() + } + if err := runner.Initialize(); err != nil { return errors.Wrap(err, "unable to initialize user events handler runner") } diff --git a/events/events.go b/events/events.go index e1d3129300..240850c756 100644 --- a/events/events.go +++ b/events/events.go @@ -47,3 +47,28 @@ func (r *runner) Terminate() error { } return nil } + +type noopRunner struct { + terminate chan struct{} +} + +func (n *noopRunner) Initialize() error { + n.terminate = make(chan struct{}, 0) + return nil +} + +func (n *noopRunner) Run() error { + <-n.terminate + return nil +} + +func (n *noopRunner) Terminate() error { + n.terminate <- struct{}{} + return nil +} + +var _ Runner = &noopRunner{} + +func NewNoopRunner() Runner { + return &noopRunner{} +} diff --git a/platform/config_test.go b/platform/config_test.go index edba20a423..841e15294a 100644 --- a/platform/config_test.go +++ b/platform/config_test.go @@ -110,7 +110,7 @@ var _ = Describe("Config", func() { It("returns an error if the address is not a parseable URL", func() { cfg.Address = "Not%Parseable" - Expect(cfg.Validate()).To(MatchError("address is invalid")) + Expect(cfg.Validate()).To(MatchError("address is invalid: parse \"Not%Parseable\": invalid URL escape \"%Pa\"")) }) It("returns success", func() { diff --git a/store/structured/mongo/config.go b/store/structured/mongo/config.go index 72bdf08031..8212f760d1 100644 --- a/store/structured/mongo/config.go +++ b/store/structured/mongo/config.go @@ -28,15 +28,16 @@ func LoadConfig() (*Config, error) { // Config describe parameters need to make a connection to a Mongo database type Config struct { - Scheme string `json:"scheme" envconfig:"TIDEPOOL_STORE_SCHEME"` - Addresses []string `json:"addresses" envconfig:"TIDEPOOL_STORE_ADDRESSES" required:"true"` - TLS bool `json:"tls" envconfig:"TIDEPOOL_STORE_TLS" default:"true"` - Database string `json:"database" envconfig:"TIDEPOOL_STORE_DATABASE" required:"true"` - CollectionPrefix string `json:"collectionPrefix" envconfig:"TIDEPOOL_STORE_COLLECTION_PREFIX"` - Username *string `json:"-" envconfig:"TIDEPOOL_STORE_USERNAME"` - Password *string `json:"-" envconfig:"TIDEPOOL_STORE_PASSWORD"` - Timeout time.Duration `json:"timeout" envconfig:"TIDEPOOL_STORE_TIMEOUT" default:"60s"` - OptParams *string `json:"optParams" envconfig:"TIDEPOOL_STORE_OPT_PARAMS"` + Scheme string `json:"scheme" envconfig:"TIDEPOOL_STORE_SCHEME"` + Addresses []string `json:"addresses" envconfig:"TIDEPOOL_STORE_ADDRESSES" required:"true"` + TLS bool `json:"tls" envconfig:"TIDEPOOL_STORE_TLS" default:"true"` + Database string `json:"database" envconfig:"TIDEPOOL_STORE_DATABASE" required:"true"` + CollectionPrefix string `json:"collectionPrefix" envconfig:"TIDEPOOL_STORE_COLLECTION_PREFIX"` + Username *string `json:"-" envconfig:"TIDEPOOL_STORE_USERNAME"` + Password *string `json:"-" envconfig:"TIDEPOOL_STORE_PASSWORD"` + Timeout time.Duration `json:"timeout" envconfig:"TIDEPOOL_STORE_TIMEOUT" default:"60s"` + OptParams *string `json:"optParams" envconfig:"TIDEPOOL_STORE_OPT_PARAMS"` + DisableIndexCreation bool `json:"disableIndexCreation" envconfig:"TIDEPOOL_DISABLE_INDEX_CREATION"` } // AsConnectionString constructs a MongoDB connection string from a Config diff --git a/store/structured/mongo/repository.go b/store/structured/mongo/repository.go index 274d9217db..16f2ba79f2 100644 --- a/store/structured/mongo/repository.go +++ b/store/structured/mongo/repository.go @@ -15,15 +15,25 @@ import ( type Repository struct { *mongo.Collection + config RepositoryConfig } -func NewRepository(collection *mongo.Collection) *Repository { +type RepositoryConfig struct { + DisableIndexCreation bool +} + +func NewRepository(collection *mongo.Collection, config RepositoryConfig) *Repository { return &Repository{ collection, + config, } } func (r *Repository) CreateAllIndexes(ctx context.Context, indexes []mongo.IndexModel) error { + if r.config.DisableIndexCreation { + return nil + } + if ctx == nil { ctx = context.Background() } diff --git a/store/structured/mongo/store.go b/store/structured/mongo/store.go index 93ef92d1e6..584373bfc9 100644 --- a/store/structured/mongo/store.go +++ b/store/structured/mongo/store.go @@ -62,7 +62,10 @@ func AppendLifecycleHooksToStore(store *Store, lifecycle fx.Lifecycle) { } func (o *Store) GetRepository(collection string) *Repository { - return NewRepository(o.GetCollection(collection)) + config := RepositoryConfig{ + DisableIndexCreation: o.config.DisableIndexCreation, + } + return NewRepository(o.GetCollection(collection), config) } func (o *Store) GetCollection(collection string) *mongoDriver.Collection { From 9e9b4403777747de905eb0ffb8e9c8f6806b38a9 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Wed, 3 Jan 2024 18:32:55 -0800 Subject: [PATCH 5/5] Fix auth service tests. --- auth/service/service/service_test.go | 2 +- blob/service/service_test.go | 2 +- prescription/application/application_test.go | 2 +- service/service/DEPRECATED_service_test.go | 2 +- task/service/service/service_test.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/auth/service/service/service_test.go b/auth/service/service/service_test.go index d6f698dd2a..b92ef2cefa 100644 --- a/auth/service/service/service_test.go +++ b/auth/service/service/service_test.go @@ -48,7 +48,7 @@ var _ = Describe("Service", func() { server = NewServer() server.AppendHandlers( CombineHandlers( - VerifyRequest("POST", "/auth/serverlogin"), + VerifyRequest("POST", "/serverlogin"), // by default the path prefix is empty to the auth service unless set in the env var TIDEPOOL_AUTH_CLIENT_EXTERNAL_PATH_PREFIX VerifyHeaderKV("X-Tidepool-Server-Name", *provider.NameOutput), VerifyHeaderKV("X-Tidepool-Server-Secret", serverSecret), VerifyBody(nil), diff --git a/blob/service/service_test.go b/blob/service/service_test.go index 251c376a17..b0246c707c 100644 --- a/blob/service/service_test.go +++ b/blob/service/service_test.go @@ -47,7 +47,7 @@ var _ = Describe("Service", func() { server = NewServer() server.AppendHandlers( CombineHandlers( - VerifyRequest(http.MethodPost, "/auth/serverlogin"), + VerifyRequest(http.MethodPost, "/serverlogin"), VerifyHeaderKV("X-Tidepool-Server-Name", *provider.NameOutput), VerifyHeaderKV("X-Tidepool-Server-Secret", serverSecret), VerifyBody(nil), diff --git a/prescription/application/application_test.go b/prescription/application/application_test.go index 9e2d511bd2..6f27e00087 100644 --- a/prescription/application/application_test.go +++ b/prescription/application/application_test.go @@ -53,7 +53,7 @@ var _ = Describe("Application", func() { server = NewServer() server.AppendHandlers( CombineHandlers( - VerifyRequest(http.MethodPost, "/auth/serverlogin"), + VerifyRequest(http.MethodPost, "/serverlogin"), VerifyHeaderKV("X-Tidepool-Server-Name", *prvdr.NameOutput), VerifyHeaderKV("X-Tidepool-Server-Secret", serverSecret), VerifyBody(nil), diff --git a/service/service/DEPRECATED_service_test.go b/service/service/DEPRECATED_service_test.go index 95e148f7be..621256e107 100644 --- a/service/service/DEPRECATED_service_test.go +++ b/service/service/DEPRECATED_service_test.go @@ -39,7 +39,7 @@ var _ = Describe("DEPRECATEDService", func() { Expect(server).ToNot(BeNil()) server.AppendHandlers( CombineHandlers( - VerifyRequest("POST", "/auth/serverlogin"), + VerifyRequest("POST", "/serverlogin"), VerifyHeaderKV("X-Tidepool-Server-Name", *provider.NameOutput), VerifyHeaderKV("X-Tidepool-Server-Secret", serverSecret), VerifyBody(nil), diff --git a/task/service/service/service_test.go b/task/service/service/service_test.go index 8fe529cca5..69f4f2efc2 100644 --- a/task/service/service/service_test.go +++ b/task/service/service/service_test.go @@ -46,7 +46,7 @@ var _ = Describe("Service", func() { server = NewServer() server.AppendHandlers( CombineHandlers( - VerifyRequest("POST", "/auth/serverlogin"), + VerifyRequest("POST", "/serverlogin"), VerifyHeaderKV("X-Tidepool-Server-Name", *provider.NameOutput), VerifyHeaderKV("X-Tidepool-Server-Secret", serverSecret), VerifyBody(nil),