Skip to content

Commit

Permalink
refactor: login flow forced renamed to refresh
Browse files Browse the repository at this point in the history
BREAKING CHANGE: To stay consistent with other query parameter's, the self-service login flow's `forced` key has been renamed to `refresh`.
  • Loading branch information
aeneasr committed Oct 22, 2021
1 parent d200c08 commit 92087e5
Show file tree
Hide file tree
Showing 26 changed files with 238 additions and 103 deletions.
26 changes: 22 additions & 4 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,20 @@ paths:
schema:
type: string
style: simple
- description: |-
DeclassifyCredentials will declassify one or more identity's credentials
Currently, only `oidc` is supported. This will return the initial OAuth 2.0 Access,
Refresh and (optionally) OpenID Connect ID Token.
explode: true
in: query
name: include_credential
required: false
schema:
items:
type: string
type: array
style: form
responses:
"200":
content:
Expand Down Expand Up @@ -2904,8 +2918,8 @@ components:
text: text
type: type
updated_at: 2000-01-23T04:56:07.000+00:00
forced: true
created_at: 2000-01-23T04:56:07.000+00:00
refresh: true
return_to: return_to
id: id
type: type
Expand All @@ -2924,16 +2938,16 @@ components:
a new flow has to be initiated.
format: date-time
type: string
forced:
description: Refresh stores whether this login flow should enforce re-authentication.
type: boolean
id:
format: uuid4
type: string
issued_at:
description: IssuedAt is the time (UTC) when the flow started.
format: date-time
type: string
refresh:
description: Refresh stores whether this login flow should enforce re-authentication.
type: boolean
request_url:
description: |-
RequestURL is the initial URL that was requested from Ory Kratos. It can be used
Expand Down Expand Up @@ -3692,6 +3706,10 @@ components:
provider:
description: The provider to register with
type: string
traits:
description: The identity traits. This is a placeholder for the registration
flow.
type: object
required:
- method
- provider
Expand Down
24 changes: 21 additions & 3 deletions internal/httpclient/api_v0alpha2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 26 additions & 26 deletions internal/httpclient/docs/SelfServiceLoginFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Name | Type | Description | Notes
**Active** | Pointer to [**IdentityCredentialsType**](IdentityCredentialsType.md) | | [optional]
**CreatedAt** | Pointer to **time.Time** | CreatedAt is a helper struct field for gobuffalo.pop. | [optional]
**ExpiresAt** | **time.Time** | ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in, a new flow has to be initiated. |
**Forced** | Pointer to **bool** | Refresh stores whether this login flow should enforce re-authentication. | [optional]
**Id** | **string** | |
**IssuedAt** | **time.Time** | IssuedAt is the time (UTC) when the flow started. |
**Refresh** | Pointer to **bool** | Refresh stores whether this login flow should enforce re-authentication. | [optional]
**RequestUrl** | **string** | RequestURL is the initial URL that was requested from Ory Kratos. It can be used to forward information contained in the URL's path or query for example. |
**RequestedAal** | Pointer to [**AuthenticatorAssuranceLevel**](AuthenticatorAssuranceLevel.md) | | [optional]
**ReturnTo** | Pointer to **string** | ReturnTo contains the requested return_to URL. | [optional]
Expand Down Expand Up @@ -106,31 +106,6 @@ and a boolean to check if the value has been set.
SetExpiresAt sets ExpiresAt field to given value.


### GetForced

`func (o *SelfServiceLoginFlow) GetForced() bool`

GetForced returns the Forced field if non-nil, zero value otherwise.

### GetForcedOk

`func (o *SelfServiceLoginFlow) GetForcedOk() (*bool, bool)`

GetForcedOk returns a tuple with the Forced field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetForced

`func (o *SelfServiceLoginFlow) SetForced(v bool)`

SetForced sets Forced field to given value.

### HasForced

`func (o *SelfServiceLoginFlow) HasForced() bool`

HasForced returns a boolean if a field has been set.

### GetId

`func (o *SelfServiceLoginFlow) GetId() string`
Expand Down Expand Up @@ -171,6 +146,31 @@ and a boolean to check if the value has been set.
SetIssuedAt sets IssuedAt field to given value.


### GetRefresh

`func (o *SelfServiceLoginFlow) GetRefresh() bool`

GetRefresh returns the Refresh field if non-nil, zero value otherwise.

### GetRefreshOk

`func (o *SelfServiceLoginFlow) GetRefreshOk() (*bool, bool)`

GetRefreshOk returns a tuple with the Refresh field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetRefresh

`func (o *SelfServiceLoginFlow) SetRefresh(v bool)`

SetRefresh sets Refresh field to given value.

### HasRefresh

`func (o *SelfServiceLoginFlow) HasRefresh() bool`

HasRefresh returns a boolean if a field has been set.

### GetRequestUrl

`func (o *SelfServiceLoginFlow) GetRequestUrl() string`
Expand Down
26 changes: 26 additions & 0 deletions internal/httpclient/docs/SubmitSelfServiceLoginFlowBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description | Notes
**Password** | **string** | The user's password. |
**PasswordIdentifier** | **string** | Identifier is the email or username of the user trying to log in. |
**Provider** | **string** | The provider to register with |
**Traits** | Pointer to **map[string]interface{}** | The identity traits. This is a placeholder for the registration flow. | [optional]
**TotpCode** | **string** | The TOTP code. |

## Methods
Expand Down Expand Up @@ -135,6 +136,31 @@ and a boolean to check if the value has been set.
SetProvider sets Provider field to given value.


### GetTraits

`func (o *SubmitSelfServiceLoginFlowBody) GetTraits() map[string]interface{}`

GetTraits returns the Traits field if non-nil, zero value otherwise.

### GetTraitsOk

`func (o *SubmitSelfServiceLoginFlowBody) GetTraitsOk() (*map[string]interface{}, bool)`

GetTraitsOk returns a tuple with the Traits field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetTraits

`func (o *SubmitSelfServiceLoginFlowBody) SetTraits(v map[string]interface{})`

SetTraits sets Traits field to given value.

### HasTraits

`func (o *SubmitSelfServiceLoginFlowBody) HasTraits() bool`

HasTraits returns a boolean if a field has been set.

### GetTotpCode

`func (o *SubmitSelfServiceLoginFlowBody) GetTotpCode() string`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**CsrfToken** | Pointer to **string** | The CSRF Token | [optional]
**Method** | **string** | Method to use This field must be set to `oidc` when using the oidc method. |
**Provider** | **string** | The provider to register with |
**Traits** | Pointer to **map[string]interface{}** | The identity traits. This is a placeholder for the registration flow. | [optional]

## Methods

Expand Down Expand Up @@ -92,6 +93,31 @@ and a boolean to check if the value has been set.
SetProvider sets Provider field to given value.


### GetTraits

`func (o *SubmitSelfServiceLoginFlowWithOidcMethodBody) GetTraits() map[string]interface{}`

GetTraits returns the Traits field if non-nil, zero value otherwise.

### GetTraitsOk

`func (o *SubmitSelfServiceLoginFlowWithOidcMethodBody) GetTraitsOk() (*map[string]interface{}, bool)`

GetTraitsOk returns a tuple with the Traits field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetTraits

`func (o *SubmitSelfServiceLoginFlowWithOidcMethodBody) SetTraits(v map[string]interface{})`

SetTraits sets Traits field to given value.

### HasTraits

`func (o *SubmitSelfServiceLoginFlowWithOidcMethodBody) HasTraits() bool`

HasTraits returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
6 changes: 4 additions & 2 deletions internal/httpclient/docs/V0alpha2Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Name | Type | Description | Notes

## AdminGetIdentity

> Identity AdminGetIdentity(ctx, id).Execute()
> Identity AdminGetIdentity(ctx, id).IncludeCredential(includeCredential).Execute()
Get an Identity

Expand All @@ -332,10 +332,11 @@ import (

func main() {
id := "id_example" // string | ID must be set to the ID of identity you want to get
includeCredential := []string{"Inner_example"} // []string | DeclassifyCredentials will declassify one or more identity's credentials Currently, only `oidc` is supported. This will return the initial OAuth 2.0 Access, Refresh and (optionally) OpenID Connect ID Token. (optional)

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.V0alpha2Api.AdminGetIdentity(context.Background(), id).Execute()
resp, r, err := apiClient.V0alpha2Api.AdminGetIdentity(context.Background(), id).IncludeCredential(includeCredential).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `V0alpha2Api.AdminGetIdentity``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand All @@ -361,6 +362,7 @@ Other parameters are passed through a pointer to a apiAdminGetIdentityRequest st
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------

**includeCredential** | **[]string** | DeclassifyCredentials will declassify one or more identity's credentials Currently, only `oidc` is supported. This will return the initial OAuth 2.0 Access, Refresh and (optionally) OpenID Connect ID Token. |

### Return type

Expand Down

0 comments on commit 92087e5

Please sign in to comment.