Skip to content

Commit

Permalink
chore: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 25, 2021
1 parent 7c3ec7c commit 117dd35
Show file tree
Hide file tree
Showing 14 changed files with 530 additions and 518 deletions.
6 changes: 6 additions & 0 deletions docs/docs/guides/login-session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,9 @@ $ curl -s -X POST -H "Accept: application/json" \
}
}
```

## Revoke Sessions using Self-Service

## List Sessions using Self-Service

## List and Revoke Sessions as an Administrator
4 changes: 2 additions & 2 deletions internal/httpclient/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ docs/JsonError.md
docs/MetadataApi.md
docs/NeedsPrivilegedSessionError.md
docs/Pagination.md
docs/PublicRevokeMySessionsResponse.md
docs/RecoveryAddress.md
docs/RevokedSessions.md
docs/SelfServiceBrowserLocationChangeRequiredError.md
docs/SelfServiceError.md
docs/SelfServiceFlowExpiredError.md
Expand Down Expand Up @@ -104,8 +104,8 @@ model_inline_response_503.go
model_json_error.go
model_needs_privileged_session_error.go
model_pagination.go
model_public_revoke_my_sessions_response.go
model_recovery_address.go
model_revoked_sessions.go
model_self_service_browser_location_change_required_error.go
model_self_service_error.go
model_self_service_flow_expired_error.go
Expand Down
8 changes: 4 additions & 4 deletions internal/httpclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ Class | Method | HTTP request | Description
*V0alpha2Api* | [**InitializeSelfServiceVerificationFlowForBrowsers**](docs/V0alpha2Api.md#initializeselfserviceverificationflowforbrowsers) | **Get** /self-service/verification/browser | Initialize Verification Flow for Browser Clients
*V0alpha2Api* | [**InitializeSelfServiceVerificationFlowWithoutBrowser**](docs/V0alpha2Api.md#initializeselfserviceverificationflowwithoutbrowser) | **Get** /self-service/verification/api | Initialize Verification Flow for APIs, Services, Apps, ...
*V0alpha2Api* | [**ListIdentitySchemas**](docs/V0alpha2Api.md#listidentityschemas) | **Get** /schemas |
*V0alpha2Api* | [**PublicListOtherSessions**](docs/V0alpha2Api.md#publiclistothersessions) | **Get** /sessions/others | This endpoints returns all other active sessions that belong to the logged-in user. The current session can be retrieved by calling the `/sessions/whoami` endpoint.
*V0alpha2Api* | [**PublicRevokeOtherSessions**](docs/V0alpha2Api.md#publicrevokeothersessions) | **Delete** /sessions/others | Calling this endpoint invalidates all except the current session that belong to the logged-in user. Session data are not deleted.
*V0alpha2Api* | [**PublicRevokeSession**](docs/V0alpha2Api.md#publicrevokesession) | **Delete** /sessions/others/{id} | Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted.
*V0alpha2Api* | [**ListSessions**](docs/V0alpha2Api.md#listsessions) | **Get** /sessions | This endpoints returns all other active sessions that belong to the logged-in user. The current session can be retrieved by calling the `/sessions/whoami` endpoint.
*V0alpha2Api* | [**RevokeSession**](docs/V0alpha2Api.md#revokesession) | **Delete** /sessions/{id} | Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted.
*V0alpha2Api* | [**RevokeSessions**](docs/V0alpha2Api.md#revokesessions) | **Delete** /sessions | Calling this endpoint invalidates all except the current session that belong to the logged-in user. Session data are not deleted.
*V0alpha2Api* | [**SubmitSelfServiceLoginFlow**](docs/V0alpha2Api.md#submitselfserviceloginflow) | **Post** /self-service/login | Submit a Login Flow
*V0alpha2Api* | [**SubmitSelfServiceLogoutFlow**](docs/V0alpha2Api.md#submitselfservicelogoutflow) | **Get** /self-service/logout | Complete Self-Service Logout
*V0alpha2Api* | [**SubmitSelfServiceLogoutFlowWithoutBrowser**](docs/V0alpha2Api.md#submitselfservicelogoutflowwithoutbrowser) | **Delete** /self-service/logout/api | Perform Logout for APIs, Services, Apps, ...
Expand Down Expand Up @@ -148,8 +148,8 @@ Class | Method | HTTP request | Description
- [JsonError](docs/JsonError.md)
- [NeedsPrivilegedSessionError](docs/NeedsPrivilegedSessionError.md)
- [Pagination](docs/Pagination.md)
- [PublicRevokeMySessionsResponse](docs/PublicRevokeMySessionsResponse.md)
- [RecoveryAddress](docs/RecoveryAddress.md)
- [RevokedSessions](docs/RevokedSessions.md)
- [SelfServiceBrowserLocationChangeRequiredError](docs/SelfServiceBrowserLocationChangeRequiredError.md)
- [SelfServiceError](docs/SelfServiceError.md)
- [SelfServiceFlowExpiredError](docs/SelfServiceFlowExpiredError.md)
Expand Down
102 changes: 51 additions & 51 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2238,13 +2238,13 @@ paths:
summary: Get Verification Flow
tags:
- v0alpha2
/sessions/others:
/sessions:
delete:
description: |-
This endpoint is useful for:
To forcefully logout the current user from all other devices and sessions
operationId: publicRevokeOtherSessions
operationId: revokeSessions
parameters:
- description: Set the Session Token when calling from non-browser clients.
A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.
Expand Down Expand Up @@ -2273,8 +2273,8 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/publicRevokeMySessionsResponse'
description: publicRevokeMySessionsResponse
$ref: '#/components/schemas/revokedSessions'
description: revokedSessions
"400":
content:
application/json:
Expand Down Expand Up @@ -2309,7 +2309,7 @@ paths:
This endpoint is useful for:
Displaying all other sessions that belong to the logged-in user
operationId: publicListOtherSessions
operationId: listSessions
parameters:
- description: Set the Session Token when calling from non-browser clients.
A session token has a format of `MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj`.
Expand Down Expand Up @@ -2395,49 +2395,6 @@ paths:
The current session can be retrieved by calling the `/sessions/whoami` endpoint.
tags:
- v0alpha2
/sessions/others/{id}:
delete:
description: |-
This endpoint is useful for:
To forcefully logout the current user from another device or session
operationId: publicRevokeSession
parameters:
- description: ID is the session's ID.
explode: false
in: path
name: id
required: true
schema:
type: string
style: simple
responses:
"204":
description: Empty responses are sent when, for example, resources are deleted.
The HTTP status code for empty responses is typically 201.
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/jsonError'
description: jsonError
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/jsonError'
description: jsonError
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/jsonError'
description: jsonError
summary: |-
Calling this endpoint invalidates the specified session. The current session cannot be revoked.
Session data are not deleted.
tags:
- v0alpha2
/sessions/whoami:
get:
description: |-
Expand Down Expand Up @@ -2543,6 +2500,49 @@ paths:
summary: Check Who the Current HTTP Session Belongs To
tags:
- v0alpha2
/sessions/{id}:
delete:
description: |-
This endpoint is useful for:
To forcefully logout the current user from another device or session
operationId: revokeSession
parameters:
- description: ID is the session's ID.
explode: false
in: path
name: id
required: true
schema:
type: string
style: simple
responses:
"204":
description: Empty responses are sent when, for example, resources are deleted.
The HTTP status code for empty responses is typically 201.
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/jsonError'
description: jsonError
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/jsonError'
description: jsonError
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/jsonError'
description: jsonError
summary: |-
Calling this endpoint invalidates the specified session. The current session cannot be revoked.
Session data are not deleted.
tags:
- v0alpha2
/version:
get:
description: |-
Expand Down Expand Up @@ -3092,11 +3092,11 @@ components:
minimum: 1
type: integer
type: object
publicRevokeMySessionsResponse:
revokedSessions:
example:
number_revoked_sessions: 0
count: 0
properties:
number_revoked_sessions:
count:
description: The number of sessions that were revoked.
format: int64
type: integer
Expand Down
Loading

0 comments on commit 117dd35

Please sign in to comment.