Skip to content

Commit

Permalink
bumped url api version (#234)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kristinapathak authored Dec 2, 2021
1 parent aba8ded commit f37e8df
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions deploy/packaging/tr1d1um_spruce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import (
// convenient global values
const (
DefaultKeyID = "current"
applicationName, apiBase = "tr1d1um", "api/v2"
applicationName, apiBase = "tr1d1um", "api/v3"
)

const (
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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, ':')
Expand Down
2 changes: 1 addition & 1 deletion tr1d1um.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f37e8df

Please sign in to comment.