From f37e8df00d483e9e26336baff7cdc2ea8bfad346 Mon Sep 17 00:00:00 2001 From: Kristina Pathak Date: Thu, 2 Dec 2021 11:15:24 -0800 Subject: [PATCH] bumped url api version (#234) * bumped url api version * updated changelog * updated code to not use api base for two different things * changed docker logging default to debug * prep for release --- CHANGELOG.md | 7 ++++++- deploy/packaging/tr1d1um_spruce.yaml | 4 ++-- main.go | 7 ++++--- tr1d1um.yaml | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5651c75..421acca8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [v0.7.0] - Bumped argus to v0.6.0, bumped ancla to v0.3.5, and changed errorEncoder to pull logger from context.[#233](https://github.com/xmidt-org/tr1d1um/pull/233) +- Updated api version in url to v3 to indicate breaking changes in response codes when an invalid auth is sent. This change was made in an earlier release (v0.5.10). [#234](https://github.com/xmidt-org/tr1d1um/pull/234) +- Updated target URL to not have an api base hard coded onto it. Instead, the base should be provided as a part of the configuration value. [#234](https://github.com/xmidt-org/tr1d1um/pull/234) ## [v0.6.4] - Bumped ancla to v0.3.4: @@ -125,7 +129,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Initial creation. -[Unreleased]: https://github.com/xmidt-org/tr1d1um/compare/v0.6.4...HEAD +[Unreleased]: https://github.com/xmidt-org/tr1d1um/compare/v0.7.0...HEAD +[v0.7.0]: https://github.com/xmidt-org/tr1d1um/compare/v0.6.4...v0.7.0 [v0.6.4]: https://github.com/xmidt-org/tr1d1um/compare/v0.6.3...v0.6.4 [v0.6.3]: https://github.com/xmidt-org/tr1d1um/compare/v0.6.2...v0.6.3 [v0.6.2]: https://github.com/xmidt-org/tr1d1um/compare/v0.6.1...v0.6.2 diff --git a/deploy/packaging/tr1d1um_spruce.yaml b/deploy/packaging/tr1d1um_spruce.yaml index a2a09c0d..1a4bf2cb 100644 --- a/deploy/packaging/tr1d1um_spruce.yaml +++ b/deploy/packaging/tr1d1um_spruce.yaml @@ -93,7 +93,7 @@ log: # level is the logging level to use - INFO, DEBUG, WARN, ERROR # (Optional) defaults to ERROR - level: (( grab $LOG_LEVEL || "INFO" )) + level: (( grab $LOG_LEVEL || "DEBUG" )) # maxsize is the maximum log file size in MB # (Optional) defaults to max 100MB @@ -285,7 +285,7 @@ jwtValidator: ############################################################################## # targetURL is the base URL of the XMiDT cluster -targetURL: (( grab $XMIDT_CLUSTER || "http://scytale:6300" )) +targetURL: (( grab $XMIDT_CLUSTER || "http://scytale:6300/api/v3" )) # WRPSource is used as 'source' field for all outgoing WRP Messages WRPSource: "dns:tr1d1um.example.com" diff --git a/main.go b/main.go index 3579cb71..63ca4a12 100644 --- a/main.go +++ b/main.go @@ -64,7 +64,7 @@ import ( // convenient global values const ( DefaultKeyID = "current" - applicationName, apiBase = "tr1d1um", "api/v2" + applicationName, apiBase = "tr1d1um", "api/v3" ) const ( @@ -227,14 +227,14 @@ func tr1d1um(arguments []string) (exitCode int) { xmidtHTTPClient.Do), RequestTimeout: xmidtClientTimeout.RequestTimeout, }), - XmidtStatURL: fmt.Sprintf("%s/%s/device/${device}/stat", v.GetString(targetURLKey), apiBase), + XmidtStatURL: fmt.Sprintf("%s/device/${device}/stat", v.GetString(targetURLKey)), } // // WRP Service configs // translationOptions := &translation.ServiceOptions{ - XmidtWrpURL: fmt.Sprintf("%s/%s/device", v.GetString(targetURLKey), apiBase), + XmidtWrpURL: fmt.Sprintf("%s/device", v.GetString(targetURLKey)), WRPSource: v.GetString(wrpSourceKey), Tr1d1umTransactor: common.NewTr1d1umTransactor( &common.Tr1d1umTransactorOptions{ @@ -453,6 +453,7 @@ func authenticationHandler(v *viper.Viper, logger log.Logger, registry xmetrics. decoded, err := base64.StdEncoding.DecodeString(a) if err != nil { logging.Info(logger).Log(logging.MessageKey(), "failed to decode auth header", "authHeader", a, logging.ErrorKey(), err.Error()) + continue } i := bytes.IndexByte(decoded, ':') diff --git a/tr1d1um.yaml b/tr1d1um.yaml index 04b94596..eb4fb39c 100644 --- a/tr1d1um.yaml +++ b/tr1d1um.yaml @@ -289,7 +289,7 @@ jwtValidator: ############################################################################## # targetURL is the base URL of the XMiDT cluster -targetURL: http://scytale:6300 +targetURL: http://scytale:6300/api/v3 # WRPSource is used as 'source' field for all outgoing WRP Messages WRPSource: "dns:tr1d1um.example.com"