Exchange a GitHub Actions OIDC token for an exact-revision CI credential
curl --request POST \
--url https://api.firedrill.run/v1/auth/github-actions/exchange \
--header 'Content-Type: application/json' \
--data '
{
"oidcToken": "<string>",
"projectId": "<string>",
"environmentId": "<string>",
"repositoryBindingId": "<string>",
"suiteKey": "default"
}
'import requests
url = "https://api.firedrill.run/v1/auth/github-actions/exchange"
payload = {
"oidcToken": "<string>",
"projectId": "<string>",
"environmentId": "<string>",
"repositoryBindingId": "<string>",
"suiteKey": "default"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
oidcToken: '<string>',
projectId: '<string>',
environmentId: '<string>',
repositoryBindingId: '<string>',
suiteKey: 'default'
})
};
fetch('https://api.firedrill.run/v1/auth/github-actions/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.firedrill.run/v1/auth/github-actions/exchange",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'oidcToken' => '<string>',
'projectId' => '<string>',
'environmentId' => '<string>',
'repositoryBindingId' => '<string>',
'suiteKey' => 'default'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firedrill.run/v1/auth/github-actions/exchange"
payload := strings.NewReader("{\n \"oidcToken\": \"<string>\",\n \"projectId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"repositoryBindingId\": \"<string>\",\n \"suiteKey\": \"default\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.firedrill.run/v1/auth/github-actions/exchange")
.header("Content-Type", "application/json")
.body("{\n \"oidcToken\": \"<string>\",\n \"projectId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"repositoryBindingId\": \"<string>\",\n \"suiteKey\": \"default\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firedrill.run/v1/auth/github-actions/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"oidcToken\": \"<string>\",\n \"projectId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"repositoryBindingId\": \"<string>\",\n \"suiteKey\": \"default\"\n}"
response = http.request(request)
puts response.read_body{
"schemaVersion": 1,
"credential": "<string>",
"credentialExpiresAtMs": 0,
"actions": [
"ci.execute"
],
"invocation": {
"schemaVersion": 1,
"ciInvocationId": "<string>",
"organizationId": "<string>",
"projectId": "<string>",
"environmentId": "<string>",
"repositoryBindingId": "<string>",
"credentialId": "<string>",
"provider": "github_actions",
"suiteKey": "<string>",
"state": "active",
"installationId": "<string>",
"repositoryId": "<string>",
"repository": "<string>",
"repositoryOwnerId": "<string>",
"repositoryVisibility": "public",
"eventName": "<string>",
"source": {
"kind": "workflow",
"candidateRevision": "<string>",
"ref": "<string>"
},
"githubActor": "<string>",
"githubActorId": "<string>",
"workflowRunId": "<string>",
"workflowRunNumber": "<string>",
"workflowRunAttempt": 4503599627370495,
"workflowName": "<string>",
"workflowRef": "<string>",
"workflowSha": "<string>",
"credentialExpiresAtMs": 0,
"createdAtMs": 0,
"updatedAtMs": 0,
"jobWorkflowRef": "<string>",
"jobWorkflowSha": "<string>",
"githubEnvironment": "<string>",
"checkRunId": "<string>",
"commentId": "<string>",
"finishedAtMs": 0
}
}{
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"retryable": true,
"source": "platform",
"retryAfterMs": 123,
"operationId": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": {},
"evidence": {
"sessionId": "<string>",
"runId": "<string>",
"journalSeq": 4503599627370495,
"buildHash": "<string>"
}
}Exchange a GitHub Actions OIDC token for an exact-revision CI credential
Exchange a GitHub Actions OIDC token for an exact-revision CI credential
curl --request POST \
--url https://api.firedrill.run/v1/auth/github-actions/exchange \
--header 'Content-Type: application/json' \
--data '
{
"oidcToken": "<string>",
"projectId": "<string>",
"environmentId": "<string>",
"repositoryBindingId": "<string>",
"suiteKey": "default"
}
'import requests
url = "https://api.firedrill.run/v1/auth/github-actions/exchange"
payload = {
"oidcToken": "<string>",
"projectId": "<string>",
"environmentId": "<string>",
"repositoryBindingId": "<string>",
"suiteKey": "default"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
oidcToken: '<string>',
projectId: '<string>',
environmentId: '<string>',
repositoryBindingId: '<string>',
suiteKey: 'default'
})
};
fetch('https://api.firedrill.run/v1/auth/github-actions/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.firedrill.run/v1/auth/github-actions/exchange",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'oidcToken' => '<string>',
'projectId' => '<string>',
'environmentId' => '<string>',
'repositoryBindingId' => '<string>',
'suiteKey' => 'default'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.firedrill.run/v1/auth/github-actions/exchange"
payload := strings.NewReader("{\n \"oidcToken\": \"<string>\",\n \"projectId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"repositoryBindingId\": \"<string>\",\n \"suiteKey\": \"default\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.firedrill.run/v1/auth/github-actions/exchange")
.header("Content-Type", "application/json")
.body("{\n \"oidcToken\": \"<string>\",\n \"projectId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"repositoryBindingId\": \"<string>\",\n \"suiteKey\": \"default\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firedrill.run/v1/auth/github-actions/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"oidcToken\": \"<string>\",\n \"projectId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"repositoryBindingId\": \"<string>\",\n \"suiteKey\": \"default\"\n}"
response = http.request(request)
puts response.read_body{
"schemaVersion": 1,
"credential": "<string>",
"credentialExpiresAtMs": 0,
"actions": [
"ci.execute"
],
"invocation": {
"schemaVersion": 1,
"ciInvocationId": "<string>",
"organizationId": "<string>",
"projectId": "<string>",
"environmentId": "<string>",
"repositoryBindingId": "<string>",
"credentialId": "<string>",
"provider": "github_actions",
"suiteKey": "<string>",
"state": "active",
"installationId": "<string>",
"repositoryId": "<string>",
"repository": "<string>",
"repositoryOwnerId": "<string>",
"repositoryVisibility": "public",
"eventName": "<string>",
"source": {
"kind": "workflow",
"candidateRevision": "<string>",
"ref": "<string>"
},
"githubActor": "<string>",
"githubActorId": "<string>",
"workflowRunId": "<string>",
"workflowRunNumber": "<string>",
"workflowRunAttempt": 4503599627370495,
"workflowName": "<string>",
"workflowRef": "<string>",
"workflowSha": "<string>",
"credentialExpiresAtMs": 0,
"createdAtMs": 0,
"updatedAtMs": 0,
"jobWorkflowRef": "<string>",
"jobWorkflowSha": "<string>",
"githubEnvironment": "<string>",
"checkRunId": "<string>",
"commentId": "<string>",
"finishedAtMs": 0
}
}{
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"retryable": true,
"source": "platform",
"retryAfterMs": 123,
"operationId": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": {},
"evidence": {
"sessionId": "<string>",
"runId": "<string>",
"journalSeq": 4503599627370495,
"buildHash": "<string>"
}
}Body
application/json
Required string length:
100 - 16384Pattern:
^prj_[0-9a-z]{12,32}$Pattern:
^env_[0-9a-z]{12,32}$Pattern:
^repo_[0-9a-z]{12,32}$Required string length:
1 - 96Pattern:
^[A-Za-z0-9][A-Za-z0-9._-]*$Response
CI credential and immutable workflow invocation
Available options:
1 Pattern:
^fd_ci_[A-Za-z0-9_-]{32,}$Required range:
-9007199254740991 <= x <= 9007199254740991Required array length:
1 elementAvailable options:
ci.execute Show child attributes
Show child attributes