Skip to content

Commit

Permalink
Merge branch 'release/v0.30.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhartstonge committed Aug 8, 2022
2 parents 5f325ab + cab6b88 commit fe22a27
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 1,016 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ 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.30.1] - 2022-08-08
### Added
- 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
### Changed
- deps: upgrades to `fosite@v0.33.0`.

## [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.

### Removed
- mongo: deprecates `SetBackground` due to MongoDB 4.0 EOL.

## [v0.28.0] - 2021-10-18
### Added
- mongo: adds support for `mongodb+srv` connection strings.
Expand Down Expand Up @@ -654,6 +672,9 @@ clear out the password field before sending the response.
- General pre-release!

[Unreleased]: https://github.com/matthewhartstonge/storage/tree/master
[v0.30.1]: https://github.com/matthewhartstonge/storage/tree/v0.30.1
[v0.30.0]: https://github.com/matthewhartstonge/storage/tree/v0.30.0
[v0.29.0]: https://github.com/matthewhartstonge/storage/tree/v0.29.0
[v0.28.0]: https://github.com/matthewhartstonge/storage/tree/v0.28.0
[v0.27.0]: https://github.com/matthewhartstonge/storage/tree/v0.27.0
[v0.26.0]: https://github.com/matthewhartstonge/storage/tree/v0.26.0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ know what versions you are successfully paired with.

| storage version | minimum fosite version | maximum fosite version |
|----------------:|-----------------------:|-----------------------:|
| `v0.30.X` | `v0.33.X` | `v0.34.X` |
| `v0.29.X` | `v0.32.X` | `v0.34.X` |
| `v0.28.X` | `v0.32.X` | `v0.34.X` |
| `v0.27.X` | `v0.32.X` | `v0.34.X` |
| `v0.26.X` | `v0.32.X` | `v0.34.X` |
| `v0.25.X` | `v0.32.X` | `v0.34.X` |
| `v0.24.X` | `v0.32.X` | `v0.32.X` |

## Development
To start hacking:
Expand Down
4 changes: 2 additions & 2 deletions examples/mongo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ replace github.com/matthewhartstonge/storage => ../../../storage

require (
github.com/matthewhartstonge/storage v0.0.0
github.com/ory/fosite v0.32.2
github.com/ory/fosite v0.33.0
github.com/sirupsen/logrus v1.4.2
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
golang.org/x/net v0.0.0-20200625001655-4c5254603344
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
)
594 changes: 91 additions & 503 deletions examples/mongo/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
github.com/google/uuid v1.2.0
github.com/opentracing/opentracing-go v1.1.0
github.com/ory/fosite v0.32.2
github.com/ory/fosite v0.33.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.6.1
Expand Down
594 changes: 91 additions & 503 deletions go.sum

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion mongo/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ func generateIndexKeys(keys ...string) (indexKeys bson.D) {
// generateIndexOptions generates new index options.
func generateIndexOptions(name string, unique bool) *options.IndexOptions {
opts := options.Index().
SetBackground(true).
SetSparse(true).
SetUnique(unique)

Expand Down
6 changes: 5 additions & 1 deletion mongo/user_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ func (u *UserManager) List(ctx context.Context, filter storage.ListUsersRequest)
if filter.AllowedPersonAccess != "" {
query["allowedPersonAccess"] = filter.AllowedPersonAccess
}
if filter.PersonID != "" {
switch {
case filter.PersonID != "":
query["personId"] = filter.PersonID

case len(filter.PersonIDs) > 0:
query["personId"] = bson.M{"$in": filter.PersonIDs}
}
if filter.Username != "" {
query["username"] = filter.Username
Expand Down
9 changes: 6 additions & 3 deletions user_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ type ListUsersRequest struct {
AllowedTenantAccess string `json:"allowedTenantAccess" xml:"allowedTenantAccess"`
// AllowedPersonAccess filters users based on Allowed Person Access.
AllowedPersonAccess string `json:"allowedPersonAccess" xml:"allowedPersonAccess"`
// AllowedPersonAccess filters users based on Person Access.
// PersonID filters users based on a person's identifier.
PersonID string `json:"personId" xml:"personId"`
// PersonIDs filters users based on a list of person identifiers.
// Setting PersonID will take precedence over this filter.
PersonIDs []string `json:"personIds" xml:"personIds"`
// Username filters users based on username.
Username string `json:"username" xml:"username"`
// ScopesUnion filters users that have at least one of of the listed scopes.
// ScopesUnion filters users that have at least one of the listed scopes.
// ScopesUnion performs an OR operation.
// If ScopesUnion is provided, a union operation will be performed as it
// returns the wider selection.
ScopesUnion []string `json:"scopesUnion" xml:"scopesUnion"`
// ScopesIntersection filters users that have all of the listed scopes.
// ScopesIntersection filters users that have all the listed scopes.
// ScopesIntersection performs an AND operation.
ScopesIntersection []string `json:"scopesIntersection" xml:"scopesIntersection"`
// FirstName filters users based on their First Name.
Expand Down

0 comments on commit fe22a27

Please sign in to comment.