سرد النطاقات
curl --request GET \
--url https://api.truthlocks.com/v1/scopes \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/scopes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/scopes"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/scopes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": "<string>",
"resource": "<string>",
"action": "<string>",
"display_name": "<string>",
"description": "<string>",
"category": "<string>",
"is_builtin": true,
"created_at": "2023-11-07T05:31:56Z"
}
]{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}جلسات وأدوات الوكيل
سرد النطاقات
سرد جميع نطاقات الأذونات المتاحة بما في ذلك المدمجة في النظام الأساسي والنطاقات المخصصة للمستأجر
GET
/
v1
/
scopes
سرد النطاقات
curl --request GET \
--url https://api.truthlocks.com/v1/scopes \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.truthlocks.com/v1/scopes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/scopes"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/scopes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": "<string>",
"resource": "<string>",
"action": "<string>",
"display_name": "<string>",
"description": "<string>",
"category": "<string>",
"is_builtin": true,
"created_at": "2023-11-07T05:31:56Z"
}
]{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}قائمة النطاقات
GET /v1/scopes
يعرض جميع نطاقات الأذونات المتاحة للمستأجر المصادق عليه. يتضمن ذلك النطاقات المضمنة المحددة بواسطة النظام الأساسي وأي نطاقات مخصصة أنشأها المستأجر. تتبع النطاقات تنسيق resource:action المحدد بواسطة بروتوكول MAIP.
المصادقة
يتطلب رأسX-API-Key أو رمز Bearer JWT. يتم اشتقاق مساحة العمل من بيانات الاعتماد الموثقة؛ لا ترسل X-Tenant-ID.
الاستجابة
يعرض مصفوفة من كائنات تعريف النطاق.مثال
curl -G https://api.truthlocks.com/v1/scopes \
-H "X-API-Key: tl_live_..." \
-d "category=data"
فئات النطاق المضمنة
توفر المنصة أكثر من 25 نطاقًا مدمجًا عبر 6 فئات:| الفئة | النطاقات | الوصف |
|---|---|---|
data | read، write، delete، * | الوصول إلى موارد البيانات |
model | train، evaluate، deploy، attest، * | دورة حياة نموذج التعلم الآلي |
tool | search.web، search.db، execute، * | استدعاء الأداة |
agent | delegate، manage، inspect، * | إدارة دورة حياة الوكيل |
admin | config، audit، billing، * | العمليات الإدارية |
receipt | create، verify، revoke، * | إدارة الإيصالات |
مرجع تنسيق النطاق
resource:action Standard scope (e.g., "data:read")
resource:* Wildcard scope (e.g., "data:*" grants all data actions)
!resource:action Negation scope (e.g., "!data:delete" explicitly denies)
resource:sub.action Dotted sub-actions (e.g., "tool:search.web")

