All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v0.34.0 - 2024-02-22
- user: adds support for regions.
- deps: updates to
github.com/google/[email protected]
. - deps: updates to
github.com/stretchr/[email protected]
. - deps: updates to
go.mongodb.org/[email protected]
. - ci: added testing against
[email protected]
. - ci: added testing against
[email protected]
. - ci: removed testing against
[email protected]
.
v0.33.0 - 2023-08-25
- user: aligns
bson
,json
andxml
marshalling to the name of themfaFactors
property.
v0.32.0 - 2023-07-18
- user: Adds support for MFA factors.
- deps: updates to
github.com/opentracing/[email protected]
. - deps: updates to
github.com/sirupsen/[email protected]
. - deps: updates to
go.mongodb.org/[email protected]
. - deps: updates
examples/mongo
togithub.com/sirupsen/[email protected]
. - deps: updates
examples/mongo
togolang.org/x/[email protected]
. - deps: updates
examples/mongo
togolang.org/x/[email protected]
.
v0.31.0 - 2023-01-10
- deps: updates to
github.com/google/[email protected]
. - deps: updates to
github.com/sirupsen/[email protected]
. - deps: updates to
github.com/stretchr/[email protected]
. - deps: updates to
go.mongodb.org/[email protected]
. - deps: updates
examples/mongo
togithub.com/sirupsen/[email protected]
. - deps: updates
examples/mongo
togolang.org/x/[email protected]
. - deps: updates
examples/mongo
togolang.org/x/[email protected]
. - deps: updates
examples/mongo
togo.mongodb.org/[email protected]
. - examples/mongo/authorizationserver: migrates deprecated use of
Exact()
toExactOne()
. - storage: gofmts the project with [email protected].
- examples/mongo/authorizationserver: sets session subject and username. fixes #65.
- examples/mongo/authorizationserver: properly logs out the generated user id.
- mongo/mongo: reduces read errors occurring in a mongo replica set. fixes #68.
v0.30.1 - 2022-08-08
- user_manager: adds support for filtering users given a list of people ids.
- mongo/user_manager: adds support for filtering users given a list of people ids.
v0.30.0 - 2022-07-28
- deps: upgrades to
[email protected]
.
v0.29.0 - 2022-07-28
Breaking Change: If you are running on Mongo<4.0, please update as the indices will now build in the foreground. Mongo>4.0 has changed to a new indexing engine and this option is now deprecated.
- mongo: deprecates
SetBackground
due to MongoDB 4.0 EOL.
v0.28.0 - 2021-10-18
- mongo: adds support for
mongodb+srv
connection strings. - mongo: binds in a default TLS Config if
ssl=true
and a TLS config has not been provided. - storage: adds
Expirer
interface to enable stores to add support for configuring record expiration. - mongo: implements
storage.Expirer
interface to enable TTL based expiry on tokens.
- mongo: migrated internal use of
isDup(err)
tomongo.IsDuplicateKeyError(err)
.
- mongo: removed internal
isDup(err)
function.
v0.27.0 - 2021-09-24
This release will add a new hashed index on signature
for the accessTokens
collection. This makes the old accessTokens.idxSignatureId
index redundant and
can be removed.
- mongo: migrates to using a hashed index for the signature index on access tokens.
- The signature for an access token could grow quite large, leading to a large index. By migrating to using a hashed index, the size can be reduced to 2% of the original indices size. In our testing we went from 2.8GB -> 57MB.
- examples/mongo/authorizationserver: removes
mongo-features
example.
v0.26.0 - 2021-08-05
- utils: adds functions to help with adding and removing items from string sets.
- user: adds test cases for enabling and disabling person access.
- user: adds tests for
user.FullName()
. - user: adds test cases to check create time and update time equality.
- user: adds test cases to check equality of allowed person ids, person id and extra fields in user record.
- user: adds support for storing user roles.
- storage: adds a benchmark for
user.Equal()
.
- user: refactors enable and disable functions to use util append/remove functions.
- examples/mongo: updates
go.mod
to[email protected]
and tidiesgo.sum
.
- mongo:
SetClientAssertionJWT
now logs unknown errors if deleting expired JTIs fails. - mongo: fixes do not pass a nil Context (staticcheck)
- user: fixes whitespace issues when returning a user's full name.
- deps: removed support for dep.
v0.25.1 - 2021-07-27
- deps: updates to
[email protected]
.- This mongo driver release contains a fix to prevent clearing server connection pools on operation-scoped timeouts.
v0.25.0 - 2021-06-01
- README: updates documentation.
- Adds links to download Go.
- Adds information for working with Go modules.
- Changes build badge link to travis-ci.com.
- Changes mgo link to the official MongoDB mongo-driver.
- deps: migrates from
pborman/uuid
togoogle/uuid
. - deps: updates dependencies.
- updates module to go1.14 (go@n-2).
- updates to
[email protected]
. - updates to
[email protected]
. - migrates from
pborman/uuid
togoogle/[email protected]
. - removed
[email protected]
.
- .travis: removes
[email protected]
, adds[email protected]
.
- mongo: not found on token revocation should return nil.
- .travis: go install goveralls binary.
- transactional: removes transactional interface implementation.
- There isn't an easy way to tell via the mongo driver if the version of
mongo running is compatible with transactions (>mongo 4.4) without
enabling admin commands to be run for example,
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
. Therefore, for now, it's easier to remove it until every current mongo version supports transactions.
- There isn't an easy way to tell via the mongo driver if the version of
mongo running is compatible with transactions (>mongo 4.4) without
enabling admin commands to be run for example,
- deps: removes use of
mongo-features
due to bugfix released viamongo-driver
.mongo-driver
wasn't pulling or pushing sessions into the context correctly.mongo-features
also relied on admin commands/permissions to detect the running mongo version to ascertain if the mongo version connected to was transaction compatible, so no longer needed.
v0.24.0 - 2020-09-02
As mentioned under changed:
AuthClientFunc
andAuthUserFunc
now take in a context.store.DB
is now of type*DB
not*mongo.Database
but the API remains the same. If you explicitly require type*mongo.Database
, you can obtain this by stepping into theDB
wrapperstore.DB.Database
.
- deps: adds
[email protected]
for mongoDB feature detection. - mongo: adds
DB
a wrapper containing*mongo.Database
and*feat.Features
. - mongo: implements mongo feature detection for correct session and transaction handling.
- storage:
AuthClientFunc
andAuthUserFunc
now accept a context.type AuthClientFunc func() (Client, bool)
=>type AuthClientFunc func(ctx context.Context) (Client, bool)
type AuthUserFunc func() (User, bool)
=>type AuthUserFunc func(ctx context.Context) (User, bool)
- mongo: all handlers have moved from
DB *mongo.Database
to our wrapperDB *DB
in order to provide mongoDB feature detection for managing sessions and transactions, if available. - examples/mongo/authorizationserver: puts session creation behind a feature flag.
v0.23.0 - 2020-08-27
Deprecated - don't use.
The session and transaction implementation does not work for single node users (i.e. mongo not running as a replicaset), or those using mongo <v4.0.0.
- mongo: implements
storage.Transactional
- deps: upgrades to
[email protected]
v0.22.2 - 2020-07-06
- mongo: fixes
UserManager.Migrate
returning not found on a successful insert.
v0.22.1 - 2020-07-06
- mongo: fixes
filter.ScopesIntersection
usingfilter.ScopesUnion
instead offilter.ScopesIntersection
.
v0.22.0 - 2020-07-02
- deps: upgrades to
[email protected]
v0.21.0 - 2020-07-02
- storage: added support for managing and denying JTIs due to newly added
methods in
[email protected]
's interfacefosite.ClientManager
. - mongo: added concrete implementation for
DeniedJTIManager
andDeniedJTIStorer
to comply to added methods infosite.ClientManager
. - mongo: ensured update time is updated when updates are performed.
- mongo: added config options to adjust mongo connection min/max pool size.
- deps: upgrades to
[email protected]
- readme: added version support information for
[email protected]
- readme: added version support information for
[email protected]
- storage: removed missed entity constants that helped define cache table/schema/collection.
- mongo: removed dead-code index constants resulting from the removal of the cache collection.
v0.20.0 - 2020-06-26
Removes 'Cache' implementation which actually added a level of indirection, doubling required database calls in some instances.
- mongo: uses a defined database for testing.
- examples/mongo/authorizationserver: uses a defined database for the demo.
- travisci: fixes travis not running tests over the whole code base.
- cache: removed cache structure, interfaces and db
storage.SessionCache
(struct)storage.Cacher
(interface)storage.CacheManager
(interface)storage.CacheStorer
(interface)storage.RequestManager.Cache
(interface binding to astorage.CacheStorer
)mongo.CacheManager
(concrete implementation ofstorage.CacheManager
)
v0.19.0 - 2020-06-26
This release migrates to the official Go MongoDB driver.
If you have any custom code using mgo that feeds into storage
, you will need
to migrate these to use mongo-go-driver patterns.
- examples/mongo: added fosite-example featuring mongo integration.
- deps: updates to
[email protected]
. - deps: migrates from
globalsign/mgo
tomongodb/mongo-go-driver
. - readme: references
examples/mongo
instead of having a wad of example code in the readme.
v0.18.9 - 2020-06-13
- mongo:
RevokeAccessToken
attempted to delete the access token twice from the datastore leading tofosite.ErrNotFound
always being returned. - mongo:
RevokeRefreshToken
attempted to delete the refresh token twice from the datastore leading tofosite.ErrNotFound
always being returned.
v0.18.8 - 2020-06-11
- mongo: auth codes should be set to active by default on creation.
v0.18.7 - 2020-05-24
- travisci: updated to test against
go@{1.14, tip}
- mongo: fixed
ineffassign
andstaticcheck
issues. - mongo: fixed
maligned
issues reducing config struct memory allocation from 138 bytes to 127 bytes. - mongo: fixed missed error check.
- mongo: fixed
lint
issues where context was not the first parameter. - mongo: fixed user delete test creating a client instead of a user for deletion.
- mongo: fixed create client parameter ordering.
- travisci: support for go < 1.13
v0.18.6 - 2019-09-25
- client: added
published
to enable filtering clients by published state.
v0.18.5 - 2019-09-24
- deps: updated to
[email protected]
- client: fixes
client.Equal
by doing a compare on allowed regions.
v0.18.4 - 2019-09-24
- client: added support for allowed regions. This enables filtering for clients based on geographic region.
- mongo: added tests for
client.list
.
- travis: updated CI testing to test against go versions
1.13.x
,1.12.x
,1.11.x
. - travis: migrated to go modules for dependency management.
- deps: updated to
[email protected]
and[email protected]
.
- client: removed redundant type conversions in various return statements.
v0.18.3 - 2019-09-11
- mongo: fixes OpenTracing logging in the
cache
storage manager.
v0.18.2 - 2019-09-11
- Calls to
Cache.Get
andCache.Delete
in theRevokeAccessToken
andRevokeRefreshToken
handlers were specified in the wrong order.
v0.18.1 - 2019-02-07
- experimental support for go modules.
- Fixed the last ineffassign issue reported via goreportcard.
- Tested against upstream [email protected]
- Tested against upstream [email protected]
- RequestManager:
RequestManager.List
now usesentityName
instead of hardcodedstorage.EntityClients
#24 - RequestManager:
RequestManager.Update
should useentityName
instead of hardcodedstorage.EntityClients
#25
v0.18.0 - 2019-01-24
- Support for testing under Go 1.11
- Adds support for Fosite
v0.27.x
Client
: Now has anAllowedAudiences
attribute to comply to the new interface method required forfosite.Client
.Request
: Changed attributeScopes
toRequestedScope
. bson, json and xml tags remain the same.Request
: Changed attributeGrantedScopes
toGrantedScope
. bson, json and xml tags remain the same.
- Fixes the last golint error which was not reported when run locally.
- Fixes ineffassign issues reported via goreportcard.
- Support for testing under Go 1.8
v0.17.0 - 2018-11-07
- Adds support for Fosite
v0.26.0
- Exported Mongo index constants have been changed to align with idiomatic Go,
where the
Id
suffixes are nowID
- Fixed all golint errors
v0.16.0 - 2018-10-15
- Adds support for Fosite
v0.25.0
v0.15.0 - 2018-10-15
- Adds support for Fosite
v0.23.0
v0.14.0 - 2018-10-15
- Adds support for Fosite
v0.22.0
- Updated readme example to match upstream.
v0.13.0-beta - 2018-09-04
We have been using this release in house for the past month with our own auth server. If you have any issues related to the mongo storage implementation, please report an issue.
- deps: updated
Gopkg.lock
to support depv0.5.0
- mongo: Have added a struct tag to tell the
envconfig
package to ignore processingConfig.TLSConfig
, as the instantiated config it creates breaks TLS mongo connections. - user manager: Fixes filtering not being performed on
PersonID
v0.13.0-alpha2 - 2018-07-12
- mongo: Added tests to CacheManager for Create, Get, Update, Delete and DeleteByValue.
- CacheManager: must support
Configurer
interface - RequestManager: must support
Configurer
interface - deps: updated to support fosite
v0.21.X
- readme: version link for
v0.13.0-alpha1
- default config: Fixed a configuration bug, where repeat connections would lead to the default port being appended multiple times to cfg.hostnames.
- cachemanager: DeleteByValue's query selector should have been querying by
attribute
signature
not by the non-existant bson attributevalue
. - requestmanager: Reverted session data back to []byte due to not being able to unmarshal into an interface.
v0.13.0-alpha1 - 2018-06-18
- mongo: Added New to re-support custom mongo configuration and hashers.
- Store: Added top level function override to enable
Store
to conform to the requiredfosite
interfaces. - Store: Added interface tests to
Store
to ensure the functions are available at the top level!
- Storer: Changed
storage.Storer
toStorage.Store
to be more idiomatic. - Storer: Changed from named interfaces to a struct composition to enable the required fosite interface functions to be raised to the top level.
- mongo: Changed
MongoStore
toStore
to be more idiomatic. - mongo: Changed
ConnectToMongo
toConnect
to be more idiomatic. - mongo: Changed
NewDefaultMongoStore
toNewDefaultStore
to be more idiomatic. - mongo: exported
cacheMongoManager
- mongo: exported
clientMongoManager
- mongo: exported
requestMongoManager
- mongo: exported
userMongoManager
- mongo: Changed
CacheMongoManager
toCacheManager
to be more idiomatic. - mongo: Changed
ClientMongoManager
toClientManager
to be more idiomatic. - mongo: Changed
RequestMongoManager
toRequestManager
to be more idiomatic. - mongo: Changed
UserMongoManager
toUserManager
to be more idiomatic. - mongo: Changed unexported attributes
db
andhasher
to be exported to enable custom data store composition.
- documentation: typo in
user_manager
referring to clients instead of users.
v0.13.0-alpha - 2018-06-14
- mongo: Added indices for quick look up.
- mongo: Added a way to pass the mongo session via
context.Context
- OpenTracing: Added OpenTracing support. You can now gain distributed tracing information on how your mongo queries are performing.
- logging: Added logging support. Now provides a way to bind in your own logrus logger to get information, or debug output from the storage driver.
- Client: Added to the domain model. Provides a data storage model for OAuth 2 clients.
- AuthClientMigrator: Added to the domain model. Provides an interface to help enable migration of hashes for legacy clients.
- AuthUserMigrator: Added to the domain model. Provides an interface to help enable migration of hashes for legacy users.
- Configurer: Provides an interface to initialize datastore entities if required.
- Cache: Added to the domain model. Provides caching functionality.
- Tests: Added fosite interface tests to easily test API compatibility with newer version of fosite.
- Users: Added to the domain model. Provides a data storage model for OAuth 2 users.
- Requests: Added to the domain model. Provides a data storage model for OAuth 2 auth session requests.
- Entity Names: Added to the domain model. Provides a way to use the entity names consistently between multiple backend storage implementations.
- Storer: Added to the domain model. Provides a struct for composing backend
storage drivers. See
MongoStore
for an example of how to bind this in. - AuthorizeCode: Added support for
InvalidateAuthorizeCodeSession(ctx context.Context, code string) (err error)
as per[email protected]
- fosite: v0.20.X support.
Pretty much everything..
Storage has been re-written in such a way that multiple datastore backends can be created, and bound together. This can become useful over time as you need to scale out and would like to switch components out to a different backend.
For example, hitting the cache. You could implement and compose in a Redis
CacheManager
, which you could bind into your mongo storage implementation.
- OSS: Updated licenses and added attributions.
- Client: Secret is now stored as a string rather than bytes.
- Configurer: requires passing in
context.Context
DeleteAuthorizeCodeSession(ctx context.Context, code string) (err error)
has been removed from the interface and is no longer used by the upstream, fosite, library.- The old API
- There are no mongo integration tests.
- Documentation needs to be updated to match current API.
v0.12.0 - 2018-05-31
- client: Tests to ensure storage implements fosite interfaces correctly
- request: Tests to ensure storage implements oauth2 interfaces correctly
- request: Tests to ensure storage implements openid interfaces correctly
- readme: compatibility table
- license: updated year, added github link.
- mongo: conformed collection names to match javascript naming conventions (camelCase)
- deps: changed dependency manager to dep
- ci: changed TravisCI dependency manager to dep
- file naming: removed package name pre-pending to file names.
- Tested against upstream [email protected]
- Tested against upstream [email protected]
- Tested against upstream [email protected]
- Tested against upstream [email protected]
- Tested against upstream [email protected]
- request: Removed CreateImplicitAccessTokenSession function as per github issue removed implicit storage as its never used
- storage_mongo: Removed CreateImplicitAccessTokenSession function as per github issue removed implicit storage as its never used
v0.11.2 - 2018-05-30
- git: updated repo links
- deps: updated glide lock
v0.11.1 - 2018-05-14
- readme: updated latest version
- user: Equal() now supports comparisons including personID
- legal: Removed mergo, now not in use
v0.11.0 - 2018-05-10
- user: Removed use of lib mergo. Please move to passing through a full update, instead of partials. This caused issues where fields were required to be blanked out, for example, disabling a user account.
- client: Removed use of lib mergo. Please move to passing through a full update, instead of partials. This caused issues where fields were required to be blanked out, for example, disabling a client.
- changelog: to be changelog compliant!
- glide: unpinned fosite version. Please ensure it works with your version of fosite, please see readme disclaimers.
- glide: mergo
v0.10.0 - 2018-04-13
- Configuration now allows passing hostnames with included ports, for example:
[]string{"mongo.example.com:123456", "mongo.example.com:234567"}
allowing developers to bypass having to configureconfig.Port
as well. - Configuration now allows passing a custom tls.Config to the Config. This
requires manual initialization of a
tls.Config
struct, but enables users to use their own TLS certs for connecting to mongo. - Cleaned up the Readme
v0.9.1 - 2018-03-19
- Fixes AllowedPeopleAccess filtering.
v0.9.0 - 2018-03-19
v0.9.0 makes a few under the hood changes in order to conform method and attribute naming to make the API cleaner.
First of all, big shout out to @niemeyer for his amazing effort and continued support through the years to the mgo Go driver!! It's no small feat, with the driver in use today in many production stacks.
We have decided to move to the community supported fork of mgo as it has a couple of extra github issues tidied up and is moving to add support for Mongo 3.6 features which make some aggregation pipelines easier internally for us. As such, this repo is also moving to use the community fork of mgo.
Big shoutout to @domodwyer + contributors past and future!
- User:
AllowedPeopleAccess
has been added to the user model support enabling and disabling explicit access to people accounts. - User: Added
EnablePeopleAccess
method to user - User: Added
DisablePeopleAccess
method to user
- User:
AllowedAccess
has been changed toAllowedTenantAccess
to better represent the underlying data.- The
bson
/json
/xml
tags have also been updated fromtenantIDs
toallowedTenantAccess
- The
- User: User
AddTenantIDs
method conformed toEnableTenantAccess
- User: User
RemoveTenantIDs
method conformed toDisableTenantAccess
- Client:
TenantIDs
have been changed to conform toAllowedTenantAccess
, same as user. - Client:
AddScopes
method has been changed toEnableScopeAccess
- Client:
RemoveScopes
method has been changed toDisableScopeAccess
- Client:
AddTenantIDs
method has been changed toEnableTenantAccess
- Client:
RemoveTenantIDs
method has been changed toDisableTenantAccess
v0.8.0 - 2018-03-16
- Makes users filterable with
user.Filter
via theGetUsers(filters user.Filter)
function
v0.7.5 - 2017-10-12
- Adds
PersonID
to the client record to enable foreign key lookups
v0.7.4 - 2017-10-06
- Adds
TenantIDs
to the client record to enableclient_credentials
for multi-tenant applications
v0.7.3 - 2017-10-03
- Adds better error checking support for clients
v0.7.2 - 2017-10-03
- Adds support for disabling clients via the model
v0.7.1 - 2017-10-03
- Adds functions to enable sorting Clients by Name and Owner
- Adds functions to enable sorting Users by Username, FirstName and LastName
v0.7.0 - 2017-10-02
- Adds support for mongo connections over SSL
ConnectionURI
has been dropped in favour ofConnectionInfo
to enable SSL connections
v0.6.0 - 2017-10-02
- Uses the new interfaces that were brought in to simplify storage with fosite v0.11.x
- Removes
request.PersistRefreshTokenGrantSession
fromrequest.Storer
interface as per required fosite v0.11.x breaking changes - Removes
request.PersistAuthorizeCodeGrantSession
fromrequest.Storer
interface as per required fosite v0.11.x breaking changes
v0.5.3 - 2017-09-19
- Add omitempty for marshaling json tags
v0.5.2 - 2017-09-18
- Added returning
fosite.ErrNotFound
if unable to find a user record to delete
v0.5.1 - 2017-09-18
- Add omitempty for marshaling tags
v0.5.0 - 2017-09-18
- Opened the user model up to accept passwords via JSON/XML payloads.
Ensure that on all API routes, if using the model directly, to either cast attributes to a response struct that does not contain a password attribute or clear out the password field before sending the response.
v0.4.4 - 2017-09-18
- Added error for conflicting user accounts on creation based on username
v0.4.3 - 2017-09-15
- Fixed a filtering case where organisation_id had not been changed to tenantIDs
- Fixes a couple of testcases
v0.4.2 - 2017-09-11
- Adds user account disabled boolean.
- Adds user methods to check for equality and emptiness.
v0.4.1 - 2017-09-08
- Remove go 1.9 test helper function to enable testing on go 1.7 and go 1.8
v0.4.0 - 2017-09-07
- Adds tenantIDs to the user model to enable multi-tenanted applications
- Removes user organisationID.
v0.3.2 - 2017-07-10
- Adds an edge case test for a single hostname in hostnames
- Updates Storer interface to include the now existing concrete implementations of
RevokeRefreshToken
andRevokeAccessToken
v0.3.1 - 2017-06-08
- Users
- Fixes an issue in GetUser() where error checking
err != mgo.ErrNotFound
should have beenerr == mgo.ErrNotFound
- Fixes error handling being over generous with multi-returns of
errors.withstack(errors.withstack(...))
- Fixes an issue in GetUser() where error checking
v0.3.0 - 2017-06-07
- Adds support for fosite v0.9.0+
v0.2.1 - 2017-06-02
- Fixes bug related to findSessionBySignature where mgo requires a MongoRequest struct that has been malloc'd
v0.2.0 - 2017-06-02
- Make all marshalling conform to JS/JSON camelCase convention
v0.1.0 - 2017-05-31
- General pre-release!