Closed ThisIsMani closed 1 day ago
Currently create will accept and insert auth methods with same type and name, which shouldn't be possible. This PR fixes that.
Closes #5160.
curl --location 'http://localhost:8080/user/auth' \ --header 'Content-Type: application/json' \ --header 'api-key: test_admin' \ --data '{ "owner_id": "org_qaamgpukifSyBG0AxtYA2x", "owner_type": "organization", "auth_method": { "auth_type": "open_id_connect", "private_config": { "base_url": "https://dev-28418517.okta.com", "client_id": "0oahmmwdmuFvv2pFo5d7", "client_secret": "-VIrZZeN_A0SdSpFykAUZ0iMJNpSYQyILcfUmYlmZaLaFK7uRayrEuSvhs-Um5IR" }, "public_config": { "name": "okta" } }, "allow_signup": false }'
If this API is hit with same auth_type and name in public_config, then the API will throw the following error.
auth_type
name
public_config
{ "error": { "type": "invalid_request", "message": "User auth method already exists", "code": "UR_43" } }
cargo +nightly fmt --all
cargo clippy
Type of Change
Description
Currently create will accept and insert auth methods with same type and name, which shouldn't be possible. This PR fixes that.
Additional Changes
Motivation and Context
Closes #5160.
How did you test it?
If this API is hit with same
auth_type
andname
inpublic_config
, then the API will throw the following error.Checklist
cargo +nightly fmt --all
cargo clippy