//native
/**
* Update enterprise connection
*
*/
export async function main(
auth: RT.Qovery,
organizationId: string,
connectionName: string,
body: EnterpriseConnectionDto
) {
const url = new URL(
`https://api.qovery.com/organization/${organizationId}/enterpriseconnection/${connectionName}`
)
const response = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
Authorization: 'Token ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface EnterpriseConnectionDto {
/**
* The connection name
*/
connection_name: string
/**
* The purpose of this default role is to be associated to your users if:
* - you choose to not expose your IDPs groups to the SAML / OIDC connection
* - no associated group is found in your `group_mappings` defined
*
* You can define either a Qovery provided role (i.e `viewer`) or one of your custom role`s uuid.
*
*/
default_role: string
/**
* * if `true`, roles will be synchronized at each user login according to your `group_mappings` configuration based on your IDP groups
* * if `false`, no synchronization is done for your users and `group_mappings` configuration will be ignored
*
*/
enforce_group_sync: boolean
/**
* This will allow to create mapping rules based on your IDP group names.
* It's a dictionnary having:
* - key: either a Qovery provided role (i.e `viewer`) or one of your custom role`s uuid
* - value: an array of your IDP group names
*
* Example: "I want to associate the Qovery role `devops` to my IDP groups ['Administrators', 'DevSecOps']"
*
*/
group_mappings: {
[k: string]: string[]
}
[k: string]: unknown
}
Submitted by hugo697 235 days ago