From 4902ee42efedd0575adfdf0517f370c07950131b Mon Sep 17 00:00:00 2001 From: Patrick Cowland <44225864+patrickcping@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:24:26 +0000 Subject: [PATCH] Added the `UriParameters` field to the `DeviceAuthenticationPolicyTotp` data model (#384) * Added the `UriParameters` field to the `DeviceAuthenticationPolicyTotp` data model * changelog --- CHANGELOG.md | 3 +- mfa/.version | 2 +- mfa/CHANGELOG.md | 3 +- mfa/README.md | 2 +- mfa/api/openapi.yaml | 23 ++++++++++++ mfa/configuration.go | 2 +- mfa/docs/DeviceAuthenticationPolicyTotp.md | 26 +++++++++++++ mfa/generate/pingone-mfa.yml | 5 +++ ...model_device_authentication_policy_totp.go | 37 +++++++++++++++++++ 9 files changed, 98 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23a1787e..86bcb6b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,9 @@ * `github.com/patrickcping/pingone-go-sdk-v2/management` : [v0.44.0](./management/CHANGELOG.md) * **Note** Upgraded go version to 1.22 to align with the go [release policy](https://go.dev/doc/devel/release#policy). [#376](https://github.com/patrickcping/pingone-go-sdk-v2/pull/376) * **Feature** Added support for the Administrator Security API. [#381](https://github.com/patrickcping/pingone-go-sdk-v2/pull/381) -* `github.com/patrickcping/pingone-go-sdk-v2/mfa` : [v0.20.1](./mfa/CHANGELOG.md) +* `github.com/patrickcping/pingone-go-sdk-v2/mfa` : [v0.21.0](./mfa/CHANGELOG.md) * **Note** Upgraded go version to 1.22 to align with the go [release policy](https://go.dev/doc/devel/release#policy). [#376](https://github.com/patrickcping/pingone-go-sdk-v2/pull/376) + * **Enhancement** Added the `UriParameters` field to the `DeviceAuthenticationPolicyTotp` data model. [#384](https://github.com/patrickcping/pingone-go-sdk-v2/pull/384) * `github.com/patrickcping/pingone-go-sdk-v2/risk` : [v0.17.0](./risk/CHANGELOG.md) * **Note** Upgraded go version to 1.22 to align with the go [release policy](https://go.dev/doc/devel/release#policy). [#376](https://github.com/patrickcping/pingone-go-sdk-v2/pull/376) * **Enhancement** Added the `ShouldValidatePayloadSignature` field to the `RiskPredictorDevice` model. [#380](https://github.com/patrickcping/pingone-go-sdk-v2/pull/380) diff --git a/mfa/.version b/mfa/.version index 9d263216..1db0edec 100644 --- a/mfa/.version +++ b/mfa/.version @@ -1 +1 @@ -0.20.1 \ No newline at end of file +0.21.0 \ No newline at end of file diff --git a/mfa/CHANGELOG.md b/mfa/CHANGELOG.md index b99c3458..bc101fc5 100644 --- a/mfa/CHANGELOG.md +++ b/mfa/CHANGELOG.md @@ -1,6 +1,7 @@ -# v0.20.1 (Unreleased) +# v0.21.0 (Unreleased) * **Note** Upgraded go version to 1.22 to align with the go [release policy](https://go.dev/doc/devel/release#policy). [#376](https://github.com/patrickcping/pingone-go-sdk-v2/pull/376) +* **Enhancement** Added the `UriParameters` field to the `DeviceAuthenticationPolicyTotp` data model. [#384](https://github.com/patrickcping/pingone-go-sdk-v2/pull/384) # v0.20.0 (2024-07-04) diff --git a/mfa/README.md b/mfa/README.md index 1df9570f..ee0f6cfc 100644 --- a/mfa/README.md +++ b/mfa/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the PingOne MFA service This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 2023-06-29 -- Package version: 0.20.1 +- Package version: 0.21.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation diff --git a/mfa/api/openapi.yaml b/mfa/api/openapi.yaml index ff56e01d..8e9c0c6d 100644 --- a/mfa/api/openapi.yaml +++ b/mfa/api/openapi.yaml @@ -3139,6 +3139,8 @@ components: promptForNicknameOnPairing: true totp: pairingDisabled: true + uriParameters: + key: uriParameters otp: failure: count: 6 @@ -3511,6 +3513,8 @@ components: promptForNicknameOnPairing: true totp: pairingDisabled: true + uriParameters: + key: uriParameters otp: failure: count: 6 @@ -3652,6 +3656,8 @@ components: promptForNicknameOnPairing: true totp: pairingDisabled: true + uriParameters: + key: uriParameters otp: failure: count: 6 @@ -4857,6 +4863,8 @@ components: description: TOTP device authentication policy settings. example: pairingDisabled: true + uriParameters: + key: uriParameters otp: failure: count: 6 @@ -4882,6 +4890,17 @@ components: description: Set to `true` if you want to allow users to provide nicknames for devices during pairing. type: boolean + uriParameters: + additionalProperties: + type: string + description: "Object that you can use to provide key:value pairs for `otpauth`\ + \ URI parameters. For example, if you provide a value for the `issuer`\ + \ parameter, then authenticators that support that parameter will display\ + \ the text you specify together with the OTP (in addition to the username).\ + \ This can help users recognize which application the OTP is for. If you\ + \ intend on using the same MFA policy for multiple applications, choose\ + \ a name that reflects the group of applications." + type: object required: - enabled - otp @@ -5042,6 +5061,8 @@ components: promptForNicknameOnPairing: true totp: pairingDisabled: true + uriParameters: + key: uriParameters otp: failure: count: 6 @@ -5183,6 +5204,8 @@ components: promptForNicknameOnPairing: true totp: pairingDisabled: true + uriParameters: + key: uriParameters otp: failure: count: 6 diff --git a/mfa/configuration.go b/mfa/configuration.go index 78948f5e..1bcca697 100644 --- a/mfa/configuration.go +++ b/mfa/configuration.go @@ -91,7 +91,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "pingtools PingOne-GOLANG-SDK-mfa/0.20.1", + UserAgent: "pingtools PingOne-GOLANG-SDK-mfa/0.21.0", Debug: false, DefaultServerIndex: 0, Servers: ServerConfigurations{ diff --git a/mfa/docs/DeviceAuthenticationPolicyTotp.md b/mfa/docs/DeviceAuthenticationPolicyTotp.md index 95d839b9..2e282edd 100644 --- a/mfa/docs/DeviceAuthenticationPolicyTotp.md +++ b/mfa/docs/DeviceAuthenticationPolicyTotp.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **PairingDisabled** | Pointer to **bool** | You can set `pairingDisabled` to true to prevent users from pairing new devices with the relevant method. You can use this option if you want to phase out an existing authentication method but want to allow users to continue using the method for authentication for existing devices. | [optional] **Otp** | [**DeviceAuthenticationPolicyTotpOtp**](DeviceAuthenticationPolicyTotpOtp.md) | | **PromptForNicknameOnPairing** | Pointer to **bool** | Set to `true` if you want to allow users to provide nicknames for devices during pairing. | [optional] +**UriParameters** | Pointer to **map[string]string** | Object that you can use to provide key:value pairs for `otpauth` URI parameters. For example, if you provide a value for the `issuer` parameter, then authenticators that support that parameter will display the text you specify together with the OTP (in addition to the username). This can help users recognize which application the OTP is for. If you intend on using the same MFA policy for multiple applications, choose a name that reflects the group of applications. | [optional] ## Methods @@ -118,6 +119,31 @@ SetPromptForNicknameOnPairing sets PromptForNicknameOnPairing field to given val HasPromptForNicknameOnPairing returns a boolean if a field has been set. +### GetUriParameters + +`func (o *DeviceAuthenticationPolicyTotp) GetUriParameters() map[string]string` + +GetUriParameters returns the UriParameters field if non-nil, zero value otherwise. + +### GetUriParametersOk + +`func (o *DeviceAuthenticationPolicyTotp) GetUriParametersOk() (*map[string]string, bool)` + +GetUriParametersOk returns a tuple with the UriParameters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUriParameters + +`func (o *DeviceAuthenticationPolicyTotp) SetUriParameters(v map[string]string)` + +SetUriParameters sets UriParameters field to given value. + +### HasUriParameters + +`func (o *DeviceAuthenticationPolicyTotp) HasUriParameters() bool` + +HasUriParameters 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) diff --git a/mfa/generate/pingone-mfa.yml b/mfa/generate/pingone-mfa.yml index 6c75b005..aea51ee7 100644 --- a/mfa/generate/pingone-mfa.yml +++ b/mfa/generate/pingone-mfa.yml @@ -362,6 +362,11 @@ components: promptForNicknameOnPairing: type: boolean description: Set to `true` if you want to allow users to provide nicknames for devices during pairing. + uriParameters: + type: object + additionalProperties: + type: string + description: Object that you can use to provide key:value pairs for `otpauth` URI parameters. For example, if you provide a value for the `issuer` parameter, then authenticators that support that parameter will display the text you specify together with the OTP (in addition to the username). This can help users recognize which application the OTP is for. If you intend on using the same MFA policy for multiple applications, choose a name that reflects the group of applications. required: - enabled - otp diff --git a/mfa/model_device_authentication_policy_totp.go b/mfa/model_device_authentication_policy_totp.go index 3736f212..e77809d1 100644 --- a/mfa/model_device_authentication_policy_totp.go +++ b/mfa/model_device_authentication_policy_totp.go @@ -26,6 +26,8 @@ type DeviceAuthenticationPolicyTotp struct { Otp DeviceAuthenticationPolicyTotpOtp `json:"otp"` // Set to `true` if you want to allow users to provide nicknames for devices during pairing. PromptForNicknameOnPairing *bool `json:"promptForNicknameOnPairing,omitempty"` + // Object that you can use to provide key:value pairs for `otpauth` URI parameters. For example, if you provide a value for the `issuer` parameter, then authenticators that support that parameter will display the text you specify together with the OTP (in addition to the username). This can help users recognize which application the OTP is for. If you intend on using the same MFA policy for multiple applications, choose a name that reflects the group of applications. + UriParameters *map[string]string `json:"uriParameters,omitempty"` } // NewDeviceAuthenticationPolicyTotp instantiates a new DeviceAuthenticationPolicyTotp object @@ -159,6 +161,38 @@ func (o *DeviceAuthenticationPolicyTotp) SetPromptForNicknameOnPairing(v bool) { o.PromptForNicknameOnPairing = &v } +// GetUriParameters returns the UriParameters field value if set, zero value otherwise. +func (o *DeviceAuthenticationPolicyTotp) GetUriParameters() map[string]string { + if o == nil || IsNil(o.UriParameters) { + var ret map[string]string + return ret + } + return *o.UriParameters +} + +// GetUriParametersOk returns a tuple with the UriParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceAuthenticationPolicyTotp) GetUriParametersOk() (*map[string]string, bool) { + if o == nil || IsNil(o.UriParameters) { + return nil, false + } + return o.UriParameters, true +} + +// HasUriParameters returns a boolean if a field has been set. +func (o *DeviceAuthenticationPolicyTotp) HasUriParameters() bool { + if o != nil && !IsNil(o.UriParameters) { + return true + } + + return false +} + +// SetUriParameters gets a reference to the given map[string]string and assigns it to the UriParameters field. +func (o *DeviceAuthenticationPolicyTotp) SetUriParameters(v map[string]string) { + o.UriParameters = &v +} + func (o DeviceAuthenticationPolicyTotp) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -177,6 +211,9 @@ func (o DeviceAuthenticationPolicyTotp) ToMap() (map[string]interface{}, error) if !IsNil(o.PromptForNicknameOnPairing) { toSerialize["promptForNicknameOnPairing"] = o.PromptForNicknameOnPairing } + if !IsNil(o.UriParameters) { + toSerialize["uriParameters"] = o.UriParameters + } return toSerialize, nil }