输入一次授权上下文,实时获取聚合后的属性与血缘信息
以下属性已从 HR、CMDB、风控系统等数据源实时/缓存获取:
{
"user.department": "Finance",
"user.role": "analyst",
"resource.classification": "Confidential",
"resource.owner": "bob@company.com",
"user.risk_score": 0.12,
"device.trusted": true
}
{
"user.department": { "source": "HR System (Workday)", "timestamp": "2025-12-13T18:55:02Z", "ttl": "1h" },
"resource.classification": { "source": "CMDB API", "timestamp": "2025-12-13T18:55:03Z", "ttl": "5m" },
"user.risk_score": { "source": "Real-time Risk Engine", "timestamp": "2025-12-13T18:55:03Z", "ttl": "0s" }
}
curl -X POST https://api.attributemesh.example/v1/attributes \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"subject": "alice@company.com",
"resource": "https://api.company.com/v1/reports/q3-financial",
"action": "read",
"context": {"device.trusted": true}
}'
import requests
response = requests.post(
"https://api.attributemesh.example/v1/attributes",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"subject": "alice@company.com",
"resource": "https://api.company.com/v1/reports/q3-financial",
"action": "read",
"context": {"device.trusted": True}
}
)
print(response.json())
package main
import (
"bytes"
"net/http"
"encoding/json"
"fmt"
)
func main() {
payload := map[string]interface{}{
"subject": "alice@company.com",
"resource": "https://api.company.com/v1/reports/q3-financial",
"action": "read",
"context": map[string]interface{}{"device.trusted": true},
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.attributemesh.example/v1/attributes", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}