Create a GitHub Actions trust policy for a browser session
import requests
url = "https://api.platform.ankra.app/org/organisation/oidc-trust-policies"
payload = {
"name": "<string>",
"repository_owner": "<string>",
"repository_name": "<string>",
"role_slug": "<string>",
"repository_id": 2,
"repository_owner_id": 2
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
repository_owner: '<string>',
repository_name: '<string>',
role_slug: '<string>',
repository_id: 2,
repository_owner_id: 2
})
};
fetch('https://api.platform.ankra.app/org/organisation/oidc-trust-policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/organisation/oidc-trust-policies \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"name": "<string>",
"repository_owner": "<string>",
"repository_name": "<string>",
"role_slug": "<string>",
"repository_id": 2,
"repository_owner_id": 2
}
'{
"name": "<string>",
"repository_owner": "<string>",
"repository_name": "<string>",
"role_slug": "<string>",
"repository_id": 2,
"repository_owner_id": 2,
"ref": "<string>",
"environment": "<string>",
"job_workflow_ref": "<string>",
"allow_pull_request": false,
"scopes": [
"<string>"
],
"ttl_seconds": 900,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"service_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Organisation IAM
Create a GitHub Actions trust policy for a browser session
Requires members.manage in the authenticated organisation; service accounts are refused. Creating a policy provisions its service account and refuses role escalation. Removing a policy revokes tokens issued by it. Browser mutations require the session CSRF token.
POST
/
org
/
organisation
/
oidc-trust-policies
Create a GitHub Actions trust policy for a browser session
import requests
url = "https://api.platform.ankra.app/org/organisation/oidc-trust-policies"
payload = {
"name": "<string>",
"repository_owner": "<string>",
"repository_name": "<string>",
"role_slug": "<string>",
"repository_id": 2,
"repository_owner_id": 2
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
repository_owner: '<string>',
repository_name: '<string>',
role_slug: '<string>',
repository_id: 2,
repository_owner_id: 2
})
};
fetch('https://api.platform.ankra.app/org/organisation/oidc-trust-policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/organisation/oidc-trust-policies \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"name": "<string>",
"repository_owner": "<string>",
"repository_name": "<string>",
"role_slug": "<string>",
"repository_id": 2,
"repository_owner_id": 2
}
'{
"name": "<string>",
"repository_owner": "<string>",
"repository_name": "<string>",
"role_slug": "<string>",
"repository_id": 2,
"repository_owner_id": 2,
"ref": "<string>",
"environment": "<string>",
"job_workflow_ref": "<string>",
"allow_pull_request": false,
"scopes": [
"<string>"
],
"ttl_seconds": 900,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"service_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Browser session. Mutations also require X-Ankra-CSRF.
Body
application/json
Required range:
x >= 1Required range:
x >= 1Exact value without wildcards.
Exact value without wildcards.
Exact value without wildcards.
Required range:
60 <= x <= 3600Response
Policy operation completed.
Required range:
x >= 1Required range:
x >= 1Exact value without wildcards.
Exact value without wildcards.
Exact value without wildcards.
Required range:
60 <= x <= 3600