# Idps

## GET /api/v1/idps

> Get external idps list

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Idps"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"Idps":{"type":"array","items":{"$ref":"#/components/schemas/Idp1"}},"Idp1":{"type":"object","required":["alias","type","redirectUri"],"properties":{"alias":{"type":"string","pattern":"^[a-z0-9_-]+$"},"type":{"type":"string","enum":["saml","oidc","openshift-v4"]},"redirectUri":{"type":"string"},"samlData":{"$ref":"#/components/schemas/SamlData"},"oidcData":{"$ref":"#/components/schemas/OidcData"},"ocpData":{"$ref":"#/components/schemas/OcpData"},"mappers":{"$ref":"#/components/schemas/Mappers"}}},"SamlData":{"type":"object","nullable":true,"properties":{"signingCertificate":{"type":"string"},"singleSignOnServiceUrl":{"type":"string"},"entityId":{"type":"string"},"serviceProviderMetadataUrl":{"type":"string","description":"Service Provider (SP) metadata url"}}},"OidcData":{"type":"object","nullable":true,"required":["clientId","clientSecret","discoverDocumentUrl"],"properties":{"clientId":{"type":"string"},"clientSecret":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","pattern":"^([a-zA-Z0-9-._:]+)(\\s[a-zA-Z0-9-._:]+)*$"}},"mandatoryClaim":{"$ref":"#/components/schemas/MandatoryClaim"}}},"MandatoryClaim":{"type":"object","nullable":true,"required":["claim","values"],"properties":{"claim":{"type":"string","pattern":".*[a-zA-Z].*"},"values":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^(?!.*\\s).*?[a-zA-Z].*$"}}}},"OcpData":{"type":"object","nullable":true,"properties":{"idpBaseUrl":{"type":"string"},"clientId":{"type":"string"},"clientSecret":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}}},"Mappers":{"type":"object","required":["alias"],"properties":{"gid":{"type":"string"},"uid":{"type":"string"},"groups":{"type":"string"},"supplementaryGroups":{"type":"string"},"email":{"type":"string"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/idps":{"get":{"summary":"Get external idps list","operationId":"get_idps","tags":["Idps"],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Idps"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## POST /api/v1/idps

> Configure external idp

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Idps"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"IdpCreationRequest":{"type":"object","required":["type","data"],"properties":{"name":{"type":"string"},"type":{"allOf":[{"$ref":"#/components/schemas/IdpCreationRequestTypeEnum"}]},"samlData":{"$ref":"#/components/schemas/SamlCreationData"},"oidcData":{"$ref":"#/components/schemas/OidcCreationData"},"ocpData":{"$ref":"#/components/schemas/OcpCreationData"},"mappers":{"$ref":"#/components/schemas/Mappers"}}},"IdpCreationRequestTypeEnum":{"type":"string","enum":["oidc","saml","openshift-v4"]},"SamlCreationData":{"type":"object","nullable":true,"properties":{"metadataXmlUrl":{"type":"string","pattern":"/^(https?://)?([a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})(:[0-9]{1,5})?(/[^\\s]*)?$|^$/"},"metadataXmlFile":{"type":"string"},"fileName":{"type":"string"},"metadataXmlType":{"allOf":[{"$ref":"#/components/schemas/SamlCreationDataMetadataXmlTypeEnum"}]},"entityId":{"type":"string"}}},"SamlCreationDataMetadataXmlTypeEnum":{"type":"string","enum":["url","file"]},"OidcCreationData":{"type":"object","nullable":true,"required":["clientId","clientSecret","discoverDocumentUrl"],"properties":{"clientId":{"type":"string","minLength":1},"clientSecret":{"type":"string","minLength":1},"discoverDocumentUrl":{"type":"string","pattern":"/^(https?://)?([a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})(:[0-9]{1,5})?(/[^\\s]*)?$|^$/"},"scopes":{"type":"array","items":{"type":"string","pattern":"^([a-zA-Z0-9-._:]+)(\\s[a-zA-Z0-9-._:]+)*$"}},"mandatoryClaim":{"$ref":"#/components/schemas/MandatoryClaim"}}},"MandatoryClaim":{"type":"object","nullable":true,"required":["claim","values"],"properties":{"claim":{"type":"string","pattern":".*[a-zA-Z].*"},"values":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^(?!.*\\s).*?[a-zA-Z].*$"}}}},"OcpCreationData":{"type":"object","nullable":true,"required":["idpBaseUrl","clientSecret"],"properties":{"clientId":{"type":"string","minLength":1},"idpBaseUrl":{"type":"string","pattern":"/^(https?://)?([a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})(:[0-9]{1,5})?(/[^\\s]*)?$|^$/"},"clientSecret":{"type":"string","minLength":1},"scopes":{"type":"array","items":{"type":"string","pattern":"^([a-zA-Z0-9-._:]+)(\\s[a-zA-Z0-9-._:]+)*$"}}}},"Mappers":{"type":"object","required":["alias"],"properties":{"gid":{"type":"string"},"uid":{"type":"string"},"groups":{"type":"string"},"supplementaryGroups":{"type":"string"},"email":{"type":"string"}}},"IdpPostResponse":{"type":"object","required":["alias"],"properties":{"alias":{"type":"string"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409Conflict":{"description":"The specified resource already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/idps":{"post":{"summary":"Configure external idp","operationId":"create_idp","tags":["Idps"],"requestBody":{"description":"Idp configuration","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdpCreationRequest"}}}},"responses":{"201":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdpPostResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"409":{"$ref":"#/components/responses/409Conflict"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## GET /api/v1/idps/{idp}

> Get external idp by alias

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Idps"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"idp":{"name":"idp","in":"path","required":true,"description":"The alias of the idp","schema":{"type":"string"}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/idps/{idp}":{"get":{"summary":"Get external idp by alias","operationId":"get_idp","tags":["Idps"],"parameters":[{"$ref":"#/components/parameters/idp"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## PUT /api/v1/idps/{idp}

> Update external idp by alias

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Idps"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"idp":{"name":"idp","in":"path","required":true,"description":"The alias of the idp","schema":{"type":"string"}}},"schemas":{"IdpCreationRequest":{"type":"object","required":["type","data"],"properties":{"name":{"type":"string"},"type":{"allOf":[{"$ref":"#/components/schemas/IdpCreationRequestTypeEnum"}]},"samlData":{"$ref":"#/components/schemas/SamlCreationData"},"oidcData":{"$ref":"#/components/schemas/OidcCreationData"},"ocpData":{"$ref":"#/components/schemas/OcpCreationData"},"mappers":{"$ref":"#/components/schemas/Mappers"}}},"IdpCreationRequestTypeEnum":{"type":"string","enum":["oidc","saml","openshift-v4"]},"SamlCreationData":{"type":"object","nullable":true,"properties":{"metadataXmlUrl":{"type":"string","pattern":"/^(https?://)?([a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})(:[0-9]{1,5})?(/[^\\s]*)?$|^$/"},"metadataXmlFile":{"type":"string"},"fileName":{"type":"string"},"metadataXmlType":{"allOf":[{"$ref":"#/components/schemas/SamlCreationDataMetadataXmlTypeEnum"}]},"entityId":{"type":"string"}}},"SamlCreationDataMetadataXmlTypeEnum":{"type":"string","enum":["url","file"]},"OidcCreationData":{"type":"object","nullable":true,"required":["clientId","clientSecret","discoverDocumentUrl"],"properties":{"clientId":{"type":"string","minLength":1},"clientSecret":{"type":"string","minLength":1},"discoverDocumentUrl":{"type":"string","pattern":"/^(https?://)?([a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})(:[0-9]{1,5})?(/[^\\s]*)?$|^$/"},"scopes":{"type":"array","items":{"type":"string","pattern":"^([a-zA-Z0-9-._:]+)(\\s[a-zA-Z0-9-._:]+)*$"}},"mandatoryClaim":{"$ref":"#/components/schemas/MandatoryClaim"}}},"MandatoryClaim":{"type":"object","nullable":true,"required":["claim","values"],"properties":{"claim":{"type":"string","pattern":".*[a-zA-Z].*"},"values":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^(?!.*\\s).*?[a-zA-Z].*$"}}}},"OcpCreationData":{"type":"object","nullable":true,"required":["idpBaseUrl","clientSecret"],"properties":{"clientId":{"type":"string","minLength":1},"idpBaseUrl":{"type":"string","pattern":"/^(https?://)?([a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})(:[0-9]{1,5})?(/[^\\s]*)?$|^$/"},"clientSecret":{"type":"string","minLength":1},"scopes":{"type":"array","items":{"type":"string","pattern":"^([a-zA-Z0-9-._:]+)(\\s[a-zA-Z0-9-._:]+)*$"}}}},"Mappers":{"type":"object","required":["alias"],"properties":{"gid":{"type":"string"},"uid":{"type":"string"},"groups":{"type":"string"},"supplementaryGroups":{"type":"string"},"email":{"type":"string"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/idps/{idp}":{"put":{"summary":"Update external idp by alias","operationId":"update_idp","tags":["Idps"],"parameters":[{"$ref":"#/components/parameters/idp"}],"requestBody":{"description":"Updated idp object","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdpCreationRequest"}}}},"responses":{"200":{"description":"Idp successfully updated"},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## DELETE /api/v1/idps/{idp}

> Delete external idp by alias

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Idps"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"idp":{"name":"idp","in":"path","required":true,"description":"The alias of the idp","schema":{"type":"string"}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/idps/{idp}":{"delete":{"summary":"Delete external idp by alias","operationId":"delete_idp","tags":["Idps"],"parameters":[{"$ref":"#/components/parameters/idp"}],"responses":{"200":{"description":"Idp successfully deleted"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## GET /api/v1/idps/{idp}/mappers

> Get idp mappers

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Idps"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"idp":{"name":"idp","in":"path","required":true,"description":"The alias of the idp","schema":{"type":"string"}}},"schemas":{"Mappers":{"type":"object","required":["alias"],"properties":{"gid":{"type":"string"},"uid":{"type":"string"},"groups":{"type":"string"},"supplementaryGroups":{"type":"string"},"email":{"type":"string"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/idps/{idp}/mappers":{"get":{"summary":"Get idp mappers","operationId":"get_idp_mappers","tags":["Idps"],"parameters":[{"$ref":"#/components/parameters/idp"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mappers"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## PUT /api/v1/idps/{idp}/mappers

> Update idp mappers

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.22"},"tags":[{"name":"Idps"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"idp":{"name":"idp","in":"path","required":true,"description":"The alias of the idp","schema":{"type":"string"}}},"schemas":{"Mappers":{"type":"object","required":["alias"],"properties":{"gid":{"type":"string"},"uid":{"type":"string"},"groups":{"type":"string"},"supplementaryGroups":{"type":"string"},"email":{"type":"string"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/idps/{idp}/mappers":{"put":{"summary":"Update idp mappers","operationId":"update_idp_mappers","tags":["Idps"],"parameters":[{"$ref":"#/components/parameters/idp"}],"requestBody":{"description":"Map of our mappers and their source in the external idp","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mappers"}}}},"responses":{"202":{"description":"Request accepted successfully."},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```
