Authenticate portable workload redeem
curl --request POST \
--url https://app.factorize.sh/api/v1/workloads/redeem \
--header 'Content-Type: application/json' \
--header 'X-Factorize-Attachment-Proof: <api-key>' \
--data '
{
"secret": "<string>",
"key": {
"kty": "EC",
"crv": "P-256",
"x": "<string>",
"y": "<string>"
}
}
'import requests
url = "https://app.factorize.sh/api/v1/workloads/redeem"
payload = {
"secret": "<string>",
"key": {
"kty": "EC",
"crv": "P-256",
"x": "<string>",
"y": "<string>"
}
}
headers = {
"X-Factorize-Attachment-Proof": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Factorize-Attachment-Proof': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
secret: '<string>',
key: {kty: 'EC', crv: 'P-256', x: '<string>', y: '<string>'}
})
};
fetch('https://app.factorize.sh/api/v1/workloads/redeem', 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://app.factorize.sh/api/v1/workloads/redeem",
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([
'secret' => '<string>',
'key' => [
'kty' => 'EC',
'crv' => 'P-256',
'x' => '<string>',
'y' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Factorize-Attachment-Proof: <api-key>"
],
]);
$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://app.factorize.sh/api/v1/workloads/redeem"
payload := strings.NewReader("{\n \"secret\": \"<string>\",\n \"key\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Factorize-Attachment-Proof", "<api-key>")
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://app.factorize.sh/api/v1/workloads/redeem")
.header("X-Factorize-Attachment-Proof", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"secret\": \"<string>\",\n \"key\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.factorize.sh/api/v1/workloads/redeem")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Factorize-Attachment-Proof"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"secret\": \"<string>\",\n \"key\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"active": true
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}workloads
Authenticate portable workload redeem
Requires an ES256 X-Factorize-Attachment-Proof bound to the exact request. See docs/portable-workloads.md.
Accepts a scoped bearer token or interactive owner session.
POST
/
api
/
v1
/
workloads
/
redeem
Authenticate portable workload redeem
curl --request POST \
--url https://app.factorize.sh/api/v1/workloads/redeem \
--header 'Content-Type: application/json' \
--header 'X-Factorize-Attachment-Proof: <api-key>' \
--data '
{
"secret": "<string>",
"key": {
"kty": "EC",
"crv": "P-256",
"x": "<string>",
"y": "<string>"
}
}
'import requests
url = "https://app.factorize.sh/api/v1/workloads/redeem"
payload = {
"secret": "<string>",
"key": {
"kty": "EC",
"crv": "P-256",
"x": "<string>",
"y": "<string>"
}
}
headers = {
"X-Factorize-Attachment-Proof": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Factorize-Attachment-Proof': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
secret: '<string>',
key: {kty: 'EC', crv: 'P-256', x: '<string>', y: '<string>'}
})
};
fetch('https://app.factorize.sh/api/v1/workloads/redeem', 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://app.factorize.sh/api/v1/workloads/redeem",
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([
'secret' => '<string>',
'key' => [
'kty' => 'EC',
'crv' => 'P-256',
'x' => '<string>',
'y' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Factorize-Attachment-Proof: <api-key>"
],
]);
$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://app.factorize.sh/api/v1/workloads/redeem"
payload := strings.NewReader("{\n \"secret\": \"<string>\",\n \"key\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Factorize-Attachment-Proof", "<api-key>")
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://app.factorize.sh/api/v1/workloads/redeem")
.header("X-Factorize-Attachment-Proof", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"secret\": \"<string>\",\n \"key\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.factorize.sh/api/v1/workloads/redeem")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Factorize-Attachment-Proof"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"secret\": \"<string>\",\n \"key\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"active": true
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}