Releases: cisco-open/go-lanai
v0.15.2
Deprecation Warning
- OPA support is deprecated.
opapackage and all its sub-packages is no longer supported. It still works with OPA v0 agent
What's Changed
- Minimum Go version bumped to 1.24
- Upgraded dependencies.
- Service Discovery:
- Support scheme override when using DNS service discovery with fallback values.
- Command line tool (
lanai-cli):lanai-cli init: Allow service to ignore default tool installation by specifying emptybinaries.[].versioninModule.ymllanai-cli init: Support forgolangci-lintv2. Generate correct makefiles for both v1 and v2.lanai-cli init: Added binaries/tool conflict check before tooling installation- Tests: Added basic test support for sub commands
- OAuth2:
- Allow service developers to implement their own
auth.TokenGranterandauth.TokenEnhanceron top of the oauth2 spec. - Allow service developers to implement their own
auth.AuthorizationRegistry - Allow service developers to implement their own
th_loader.Loader
- Allow service developers to implement their own
- Minor bug fixes and more test coverage
Dependencies Upgrade Details
| Library | From | To |
|---|---|---|
| github.com/getkin/kin-openapi | v0.127.0 | v0.132.0 |
| github.com/open-policy-agent/opa | v0.67.1 | v1.4.2 |
| ------- | ----- | ----- |
| dario.cat/mergo | v1.0.0 | v1.0.2 |
| github.com/IBM/sarama | v1.43.2 | v1.45.2 |
| github.com/Masterminds/sprig/v3 | v3.2.3 | v3.3.0 |
| github.com/alicebob/miniredis/v2 | v2.33.0 | v2.34.0 |
| github.com/aws/aws-sdk-go-v2 | v1.30.3 | v1.36.3 |
| github.com/aws/aws-sdk-go-v2/config | v1.27.27 | v1.29.14 |
| github.com/aws/aws-sdk-go-v2/credentials | v1.17.27 | v1.17.67 |
| github.com/aws/aws-sdk-go-v2/service/acm | v1.28.4 | v1.32.0 |
| github.com/aws/aws-sdk-go-v2/service/sts | v1.30.3 | v1.33.19 |
| github.com/beevik/etree | v1.4.1 | v1.5.1 |
| github.com/bmatcuk/doublestar/v4 | v4.6.1 | v4.8.1 |
| github.com/crewjam/saml | v0.4.14 | v0.5.1 |
| github.com/gin-gonic/gin | v1.10.0 | v1.10.1 |
| github.com/go-git/go-git/v5 | v5.13.1 | v5.16.0 |
| github.com/go-playground/validator/v10 | v10.22.0 | v10.26.0 |
| github.com/hashicorp/consul/api | v1.30.0 | v1.32.1 |
| github.com/hashicorp/vault/api | v1.14.0 | v1.16.0 |
| github.com/hashicorp/vault/api/auth/kubernetes | v0.7.0 | v0.9.0 |
| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.5 |
| github.com/miekg/dns | v1.1.61 | v1.1.66 |
| github.com/onsi/gomega | v1.34.1 | v1.37.0 |
| github.com/pquerna/otp | v1.4.0 | v1.5.0 |
| github.com/rs/cors | v1.11.0 | v1.11.1 |
| github.com/russellhaering/goxmldsig | v1.4.0 | v1.5.0 |
| github.com/spf13/cobra | v1.8.1 | v1.9.1 |
| github.com/spf13/pflag | v1.0.5 | v1.0.6 |
| github.com/spyzhov/ajson | v0.9.3 | v0.9.6 |
| go.step.sm/crypto | v0.51.1 | v0.64.0 |
| go.uber.org/fx | v1.22.2 | v1.24.0 |
| gorm.io/driver/postgres | v1.5.9 | v1.6.0 |
| gorm.io/gorm | v1.25.11 | v1.30.0 |
| mvdan.cc/sh/v3 | v3.8.0 | v3.11.0 |
| github.com/go-jose/go-jose/v4 | v4.0.4 | v4.1.0 |
Full Changelog: v0.15.1...v0.15.2
v0.15.1
Description
Minor release to upgrade Go and Nodejs dependencies
Upgraded Go Modules
| Library | From | To |
|---|---|---|
| github.com/rs/cors | v1.10.1 | v1.11.0 |
| github.com/hashicorp/vault/api | v1.12.2 | v1.14.0 |
| github.com/hashicorp/vault/api/auth/kubernetes | v0.6.0 | v0.7.0 |
| github.com/hashicorp/go-retryablehttp | v0.6.6 | v0.7.7 |
| github.com/cockroachdb/copyist | v1.6.0 | v1.7.0 |
| github.com/jackc/pgproto3/v2 | v2.1.1 | v2.3.2* |
| github.com/jackc/pgconn | v1.10.0 | v1.14.1* |
| ------- | ----- | ----- |
| github.com/IBM/sarama | v1.43.0 | v1.43.2 |
| github.com/beevik/etree | v1.3.0 | v1.4.1 |
| github.com/aws/aws-sdk-go-v2 | v1.26.0 | v1.30.3 |
| github.com/aws/aws-sdk-go-v2/config | v1.27.8 | v1.27.27 |
| github.com/aws/aws-sdk-go-v2/credentials | v1.17.8 | v1.17.27 |
| github.com/aws/aws-sdk-go-v2/service/acm | v1.25.3 | v1.28.4 |
| github.com/aws/aws-sdk-go-v2/service/sts | v1.28.5 | v1.30.3 |
| github.com/getkin/kin-openapi | v0.123.0 | v0.127.0 |
| github.com/gin-gonic/gin | v1.9.1 | v1.10.0 |
| github.com/go-playground/validator/v10 | v10.19.0 | v10.22.0 |
| github.com/go-git/go-git/v5 | v5.11.0 | v5.12.0 |
| github.com/go-redsync/redsync/v4 | v4.12.1 | v4.13.0 |
| github.com/gorilla/websocket | v1.5.1 | v1.5.3 |
| github.com/hashicorp/consul/api | v1.28.2 | v1.29.2 |
| github.com/jackc/pgx/v5 | v5.5.5 | v5.6.0 |
| github.com/miekg/dns | v1.1.58 | v1.1.61 |
| github.com/onsi/gomega | v1.32.0 | v1.34.1 |
| github.com/open-policy-agent/opa | v0.62.1 | v0.67.1 |
| github.com/shirou/gopsutil/v3 | v3.24.2 | v3.24.5 |
| github.com/spf13/cobra | v1.8.0 | v1.8.1 |
| github.com/spyzhov/ajson | v0.9.1 | v0.9.3 |
| go.step.sm/crypto | v0.43.1 | v0.51.1 |
| go.uber.org/fx | v1.21.0 | v1.22.2 |
| golang.org/x/crypto | v0.23.0 | v0.25.0 |
| golang.org/x/net | v0.25.0 | v0.27.0 |
| golang.org/x/term | v0.20.0 | v0.22.0 |
| golang.org/x/text | v0.15.0 | v0.16.0 |
| gorm.io/driver/postgres | v1.5.7 | v1.5.9 |
| gorm.io/gorm | v1.25.8 | v1.25.11 |
(*) Higher version available with potential breaking changes
v0.15.0
This Release Includes Breaking Changes
This release includes breaking changes.
- Extended the framework to support wider selections of SQL/PostgreSQL compatible database.
- Package
postgresqlis added underdatafor supporting any PostgreSQL compatible databases. - Package
cockroachis moved topostgresqlas sub-package to provide CockroachDB-only features. - Properties (application.yml) under
data.cockroachsection is moved todata.db. - Any "PostgreSQL" specific types are moved to
types/pqxpackage.
- Package
- Extended the framework to support more JWS algorithms. (
security/oauth2/jwtpackage)- RSA specific implementations like
jwt.NewRSAJwtEncoderare replaced by generic implementations likejwt.NewSignedJwtDecoder - HS, RS and ES signing algorithms are supported and the algorithm is automatically determined based on the type of public/private keys
- Extended the private/public key support to various
jwt.JwkStoreimplementations - Added
jwt.RemoteJwkStoreto leverage remoteJWKSetendpoint JWKSetendpoint insecurity/oauth2/authnow supportsRSA,EC,oct(HMAC secret) andOKP(EdDSA)
- RSA specific implementations like
Other Changes
- Introduced
auth.ApprovalStoreinterface to allow customizing how to store user's approval decisions during OAuth2/Open ID Connect "authorization code" flow. See Auth Server Example ittestis now supporting HTTP recording/playback without usingapptest.Bootstrap().- Improved documentations of various packages such as
data,test,test/dbtest,test/sectest,test/ittest, etc. - Dependencies update
- Various bug fixes
PR History
- persist oauth2 authorize request approval in session by @TimShi in #411
- Added support for Postgresql database by @TimShi in #412
- Fixed an intermittent error in httpclient/client_test caused by test set up by @TimShi in #413
- updated the version of golang.org/x/net package by @TimShi in #415
- Added README for test package. by @TimShi in #414
- Updated license file to have the full apache license text. by @TimShi in #423
- Improvement of
security/oauth2/jwtby @stonedu1011 in #418 - Improved JWK Support by @stonedu1011 in #424
- .github: Add Scorecard workflow by @cisco-service in #427
- Improve jwk file store to support different by @TimShi in #426
- Ittest improve by @stonedu1011 in #425
New Contributors
- @cisco-service made their first contribution in #427
Full Changelog: v0.14.0...v0.15.0
v0.14.0
This Release Includes Breaking Changes
This release includes breaking changes. The changes are introduced in order to extend the framework to add more implementation options for service discovery and distributed lock. In addition, support for go-kit is dropped.
What's Changed
New Features
- Consul become an optional package. When initialized (
consul.Use()), Consul is registered withappconfigas a source of application properties - Vault become an optional package. When initialized (
vault.Use()), Vault is registered withappconfigas a source of application properties. - Added
dnssdfor DNS SRV based service lookup.dnssdalso support static service discovery as "fallback" - Added Redis based distributed lock implementation
Breaking Changes
- Breaking change in
discoverypackage:- consul backed service discovery is moved to a separate package. To use it,
consulsd(formally known asdiscoveryinit) package need to be initialized withconsulsd.Use().consul.Use()is also a prerequisite for using Consul based service discovery - Properties for
consulsdis relocated to tocloud.discovery.consulfromcloud.consul.discovery
- consul backed service discovery is moved to a separate package. To use it,
- Breaking change in
integrate/httpclientpackage:httpclient.Client.WithService(...)is changed to take optionalSDOptions. Options includes default HTTP scheme and context-path, SD error handling and SD selector- The client now supports retry back-off period and custom retry logic
- go-kit interfaces are removed
- Breaking change in
integrate/securitypackage:- Property
integrate.security.service-namemoved tointegrate.security.endpoints.service-name - Added properties
integrate.security.endpoints.schemeandintegrate.security.endpoints.context-path
- Property
- Breaking change due to dropping usage and compatibility support of go-kit:
log.Loggerno longer implements go-kit'sLoggerinterface.discovery.Instancerconcrete implementations no longer implement go-kit'ssd.Instancerinterface.webpackage interfaces re-organized to remove usage of go-kit's abstraction and server implementation.
- Breaking change due to
dsyncpackage refactoring:- dsync package is refactored to three packages
dsync,consuldsyncandredisdsync dsync.Use()is removed,consuldsync.Use()orredisdsync.Use()should be used instead.- Removed
web.Registrar.RegisterWithLifecycle()
- dsync package is refactored to three packages
Bug Fixes
- Fixed: When using go 1.21 or later, lanai-cli's
initcommand would fail if the service's go.mod file contains a replace directive that pointed to a none-existent location. - Fixed: a bug in
make init-cliwhen go-lanai is not replaced by a local copy in the go.mod file. - Fixed: a typo causing
datapackages fail to build when CGO_ENABLED=0 - Fixed: a bug in
errorutilswhereerrorutils.CodedErrordoes not correctly implementerrorutils.NestedError - Fixed: a bug in bootstrap where
bootstrap.AddOptions()was actually adding options tobootstrap.Module.PriorityOptionsinstead ofbootstrap.Module.Options - Fixed: a bug where
httpclientpackage's error was not well formatted (#408).
Others
- Updated make files in examples to match the latest make file template.
- Updated main README.md and restructured documentation locations.
- Tracing package refactored to reduce unnecessary indirect dependencies. Instrument implementations are moved to their corresponding feature packages.
Full Changelog: v0.13.0...v0.14.0
v0.13.0
This Release Includes Breaking Changes
In this release, the module name is changed to github.com/cisco-open/go-lanai. This is a breaking change from previous release.
In addition some previously public methods and variables from security package is made private.
What's Changed
- Updated swagger UI to 4.19.1. Fixed the "standalone layout not found" error.
- Fixed a bug that caused tests with
apptest.Bootstrap()to fail to start if there is no otherapptest.XXXoptions configured. - Security context, session and other security related items are now stored in
utils.MutableContextinstead ofgin.Context. - All context keys of
securityandwebare made private. - Breaking change of
utils.MutableContext.gin.Contextis no longer implementingutils.MutableContextinterface. - Breaking change of
security.Clear(). It now sets an empty authentication instead of remove the authentication. - Added
security.Set(ctx, auth).security.Set(ctx, nil)is equivalent to the oldsecurity.Clear()behaviour. - Breaking change of renaming module path to
github.com/cisco-open - Updated Dockerfile and Makefile templates to properly initialize development environment for projects that may use private modules.
Full Changelog: v0.12.0...v0.13.0
v0.12.0
Note
This is the last version of go-lanai under the name of https://cto-github.cisco.com/NFV-BU/go-lanai and this version contains all commits made to the original repository before it's migrated here.
What's Changed
- Upgraded dependencies.
- Vulnerability Fixes.
- Added examples for OAuth2 authentication/authorization service and resource service.
- Updated documents
- Increased test coverage on various feature packages.
- Bug fixes
What's New
- Added
bootstrap.OrderedCliRunnerto fine control execution order of tests/runners logis now backed byzapinstead ofgo-kit/logfor performance improvement
Full Changelog: v0.11.0...v0.12.0