Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: New /users and /users/{userId} routes #4

Merged
merged 3 commits into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,42 @@ tasks:

lint:
cmds:
- golangci-lint run -v --fix
- golangci-lint run -v --fix

tests:
cmds:
- go test ./...
- go test ./...

build:
cmds:
- go build
- go build

build-image:
cmds:
- docker build -t github.com/formancehq/{{.COMPONENT}} .
- docker build -t github.com/formancehq/{{.COMPONENT}} .

run-image:
deps:
- build-image
- build-image
cmds:
- docker run --rm github.com/formancehq/{{.COMPONENT}}
- docker run --rm github.com/formancehq/{{.COMPONENT}}

generate-client:
- >
docker run --rm
-w /local
-v ${PWD}:/local
openapitools/openapi-generator-cli:latest generate
-i swagger.yaml
-g go
-o ./authclient
--git-user-id=formancehq
--git-repo-id=auth
-p packageVersion=latest
-p isGoSubmodule=true
-p packageName=authclient
cmds:
- rm -rf ./authclient
- >
docker run --rm
-w /local
-v ${PWD}:/local
openapitools/openapi-generator-cli:latest generate
-i swagger.yaml
-g go
-o ./authclient
--git-user-id=formancehq
--git-repo-id=auth
-p packageVersion=latest
-p isGoSubmodule=true
-p packageName=authclient

install-deps-demo-client:
cmds:
Expand Down
7 changes: 7 additions & 0 deletions authclient/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
Expand All @@ -15,13 +16,16 @@ docs/CreateSecretResponse.md
docs/DefaultApi.md
docs/ListClientsResponse.md
docs/ListScopesResponse.md
docs/ListUsersResponse.md
docs/ReadClientResponse.md
docs/ReadUserResponse.md
docs/Scope.md
docs/ScopeAllOf.md
docs/ScopeOptions.md
docs/Secret.md
docs/SecretAllOf.md
docs/SecretOptions.md
docs/User.md
git_push.sh
go.mod
go.sum
Expand All @@ -34,12 +38,15 @@ model_create_scope_response.go
model_create_secret_response.go
model_list_clients_response.go
model_list_scopes_response.go
model_list_users_response.go
model_read_client_response.go
model_read_user_response.go
model_scope.go
model_scope_all_of.go
model_scope_options.go
model_secret.go
model_secret_all_of.go
model_secret_options.go
model_user.go
response.go
utils.go
5 changes: 5 additions & 0 deletions authclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**DeleteTransientScope**](docs/DefaultApi.md#deletetransientscope) | **Delete** /scopes/{scopeId}/transient/{transientScopeId} | Delete a transient scope from a scope
*DefaultApi* | [**ListClients**](docs/DefaultApi.md#listclients) | **Get** /clients | List clients
*DefaultApi* | [**ListScopes**](docs/DefaultApi.md#listscopes) | **Get** /scopes | List scopes
*DefaultApi* | [**ListUsers**](docs/DefaultApi.md#listusers) | **Get** /users | List users
*DefaultApi* | [**ReadClient**](docs/DefaultApi.md#readclient) | **Get** /clients/{clientId} | Read client
*DefaultApi* | [**ReadScope**](docs/DefaultApi.md#readscope) | **Get** /scopes/{scopeId} | Read scope
*DefaultApi* | [**ReadUser**](docs/DefaultApi.md#readuser) | **Get** /users/{userId} | Read user
*DefaultApi* | [**UpdateClient**](docs/DefaultApi.md#updateclient) | **Put** /clients/{clientId} | Update client
*DefaultApi* | [**UpdateScope**](docs/DefaultApi.md#updatescope) | **Put** /scopes/{scopeId} | Update scope

Expand All @@ -107,13 +109,16 @@ Class | Method | HTTP request | Description
- [CreateSecretResponse](docs/CreateSecretResponse.md)
- [ListClientsResponse](docs/ListClientsResponse.md)
- [ListScopesResponse](docs/ListScopesResponse.md)
- [ListUsersResponse](docs/ListUsersResponse.md)
- [ReadClientResponse](docs/ReadClientResponse.md)
- [ReadUserResponse](docs/ReadUserResponse.md)
- [Scope](docs/Scope.md)
- [ScopeAllOf](docs/ScopeAllOf.md)
- [ScopeOptions](docs/ScopeOptions.md)
- [Secret](docs/Secret.md)
- [SecretAllOf](docs/SecretAllOf.md)
- [SecretOptions](docs/SecretOptions.md)
- [User](docs/User.md)


## Documentation For Authorization
Expand Down
74 changes: 74 additions & 0 deletions authclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,39 @@ paths:
"204":
description: Scope added
summary: Add a transient scope to a scope
/users:
get:
description: List users
operationId: listUsers
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/ListUsersResponse'
description: List of users
summary: List users
/users/{userId}:
get:
description: Read user
operationId: readUser
parameters:
- description: User ID
explode: false
in: path
name: userId
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/ReadUserResponse'
description: Retrieved user
summary: Read user
components:
schemas:
Metadata:
Expand Down Expand Up @@ -434,6 +467,22 @@ components:
allOf:
- $ref: '#/components/schemas/SecretOptions'
- $ref: '#/components/schemas/Secret_allOf'
User:
example:
subject: Jane Doe
id: 3bb03708-312f-48a0-821a-e765837dc2c4
email: user1@orga1.com
properties:
id:
example: 3bb03708-312f-48a0-821a-e765837dc2c4
type: string
subject:
example: Jane Doe
type: string
email:
example: user1@orga1.com
type: string
type: object
CreateClientRequest:
$ref: '#/components/schemas/ClientOptions'
CreateClientResponse:
Expand Down Expand Up @@ -500,6 +549,31 @@ components:
data:
$ref: '#/components/schemas/Secret'
type: object
ReadUserResponse:
example:
data:
subject: Jane Doe
id: 3bb03708-312f-48a0-821a-e765837dc2c4
email: user1@orga1.com
properties:
data:
$ref: '#/components/schemas/User'
type: object
ListUsersResponse:
example:
data:
- subject: Jane Doe
id: 3bb03708-312f-48a0-821a-e765837dc2c4
email: user1@orga1.com
- subject: Jane Doe
id: 3bb03708-312f-48a0-821a-e765837dc2c4
email: user1@orga1.com
properties:
data:
items:
$ref: '#/components/schemas/User'
type: array
type: object
Client_allOf:
properties:
id:
Expand Down
Loading