Skip to content

Commit 7edfc29

Browse files
committed
Merge remote-tracking branch 'origin' into DSPX-3344-authz-v2-request-limits
2 parents a0a6004 + 4bbe9f1 commit 7edfc29

213 files changed

Lines changed: 9228 additions & 6082 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.docs-drift.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# docs-drift configuration for opentdf/platform.
2+
#
3+
# This file is consumed by the docs-drift skill
4+
# (https://github.com/virtru-corp/agent-skills/tree/main/skills/developers/docs-drift)
5+
# when a contributor runs `/docs-drift` after editing SDK code. The skill scans
6+
# for new/changed exported Go symbols and proto RPCs, drafts MDX stubs for
7+
# opentdf/docs, and prepares a PR.
8+
#
9+
# Most of the values below mirror the skill's built-in OpenTDF defaults — they're
10+
# committed as a documentation artifact so the contract is discoverable in this
11+
# repo. The `mappings:` section below them adds repo-specific routing the skill
12+
# wouldn't otherwise know about.
13+
14+
docs:
15+
repo: ../docs # Sibling clone of opentdf/docs
16+
root: docs/sdks # Docs root within opentdf/docs
17+
18+
version:
19+
tag_prefix: "sdk/" # SDK is independently versioned (sdk/v0.X.Y)
20+
21+
scan:
22+
go_paths: # Where the scanner looks for Go source
23+
- sdk/ # the public SDK package
24+
- protocol/go/internal/ # source-file codegen helpers (PR #3232 pattern)
25+
proto_paths: # Where the scanner looks for .proto files
26+
- service/
27+
exclude_paths: # Substring match — these are generated or test-only
28+
- sdk/sdkconnect/ # auto-generated Connect-RPC wrappers
29+
- sdk/gen/ # generated proto code (legacy path)
30+
- sdk/internal/ # Go internal package
31+
32+
# Mappings route new symbols to the right MDX file when the name-only sniff
33+
# can't find an existing reference. Keys are glob patterns matched against
34+
# the fully-qualified symbol name; values are doc paths (relative to the
35+
# docs repo root) with an optional #section anchor for the heading to
36+
# append under.
37+
#
38+
# First-match-wins, ordered by insertion. Put the most specific patterns
39+
# first; the catch-all patterns last.
40+
mappings:
41+
42+
# ── EntityIdentifier constructor helpers (PR #3232 pattern) ──────────────
43+
# Live in protocol/go/internal/authorization/v2/ and get codegen-copied
44+
# into protocol/go/authorization/v2/*.gen.go. They're documented in
45+
# authorization.mdx under the ## EntityIdentifier section.
46+
"ForToken": docs/sdks/authorization.mdx#entityidentifier
47+
"ForClientID": docs/sdks/authorization.mdx#entityidentifier
48+
"ForEmail": docs/sdks/authorization.mdx#entityidentifier
49+
"ForUserName": docs/sdks/authorization.mdx#entityidentifier
50+
"ForRegisteredResource": docs/sdks/authorization.mdx#entityidentifier
51+
"WithRequestToken": docs/sdks/authorization.mdx#entityidentifier
52+
53+
# ── SDK discovery / attribute checks ─────────────────────────────────────
54+
# Methods on the SDK struct that read platform state without writing.
55+
# All land in discovery.mdx alongside ListAttributes / AttributeExists / etc.
56+
"SDK.List*": docs/sdks/discovery.mdx
57+
"SDK.Attribute*": docs/sdks/discovery.mdx
58+
"SDK.Validate*": docs/sdks/discovery.mdx
59+
"SDK.GetEntityAttributes": docs/sdks/discovery.mdx
60+
61+
# ── TDF mechanics and re-wrap helpers ────────────────────────────────────
62+
# Package-level functions for TDF inspection and option building.
63+
# CreateTDF, LoadTDF, and IsValidTdf already live in tdf.mdx; new
64+
# adjacent helpers (e.g., WithPolicyFrom from DSPX-2603) belong there too.
65+
"IsTDF": docs/sdks/tdf.mdx
66+
"IsValidTdf": docs/sdks/tdf.mdx
67+
"WithPolicyFrom": docs/sdks/tdf.mdx
68+
"BulkDecrypt": docs/sdks/tdf.mdx
69+
70+
# ── Platform-client setup options ────────────────────────────────────────
71+
# The "Initializing the SDK client" section of platform-client.mdx is
72+
# where setup-time options like WithPlatformEndpoint live. Newly-added
73+
# With*-style construction options default here unless overridden above.
74+
"With*": docs/sdks/platform-client.mdx#initializing-the-sdk-client
75+
76+
# ── Policy enum aliases (PR #3408 pattern) ───────────────────────────────
77+
# Constants like policy.OperatorIn / policy.BooleanAnd added in
78+
# protocol/go/internal/policy/enums.go. Documented under the enum tables
79+
# in policy.mdx.
80+
"Operator*": docs/sdks/policy.mdx
81+
"Boolean*": docs/sdks/policy.mdx
82+
"Rule*": docs/sdks/policy.mdx
83+
"State*": docs/sdks/policy.mdx
84+
85+
# ── Proto service RPCs ───────────────────────────────────────────────────
86+
# Per-service mapping. Each service's RPCs map to its dedicated MDX.
87+
"AuthorizationService.*": docs/sdks/authorization.mdx
88+
"AttributesService.*": docs/sdks/policy.mdx
89+
"ActionsService.*": docs/sdks/policy.mdx
90+
"NamespaceService.*": docs/sdks/policy.mdx
91+
"SubjectMappingService.*": docs/sdks/policy.mdx
92+
"ResourceMappingService.*": docs/sdks/policy.mdx
93+
"RegisteredResourcesService.*": docs/sdks/policy.mdx
94+
"ObligationsService.*": docs/sdks/obligations.mdx
95+
"KeyAccessServerRegistryService.*": docs/sdks/policy.mdx
96+
"KeyManagementService.*": docs/sdks/policy.mdx
97+
"UnsafeService.*": docs/sdks/policy.mdx
98+
"EntityResolutionService.*": docs/sdks/authorization.mdx
99+
"AccessService.*": docs/sdks/tdf.mdx
100+
"WellKnownService.*": docs/sdks/platform-client.mdx
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"lib/fixtures": "0.5.0",
3-
"lib/ocrypto": "0.10.0",
3+
"lib/ocrypto": "0.12.0",
44
"lib/flattening": "0.1.3",
55
"lib/identifier": "0.4.0",
6-
"otdfctl": "0.31.0",
7-
"protocol/go": "0.30.0",
8-
"sdk": "0.20.0",
9-
"service": "0.15.0"
6+
"otdfctl": "0.32.0",
7+
"protocol/go": "0.32.0",
8+
"sdk": "0.21.0",
9+
"service": "0.16.0"
1010
}

.github/scripts/init-temp-keys.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ openssl rsa -in "$opt_output/kas-private.pem" -pubout -out "$opt_output/kas-cert
5050
openssl ecparam -name prime256v1 >ecparams.tmp
5151
openssl req -x509 -nodes -newkey ec:ecparams.tmp -subj "/CN=kas" -keyout "$opt_output/kas-ec-private.pem" -out "$opt_output/kas-ec-cert.pem" -days 365
5252

53+
# Generate hybrid post-quantum key pairs (X-Wing, P256+ML-KEM-768, P384+ML-KEM-1024)
54+
go run ./service/cmd/keygen -output "$opt_output"
55+
5356
mkdir -p keys
5457
openssl req -x509 -nodes -newkey RSA:2048 -subj "/CN=ca" -keyout keys/keycloak-ca-private.pem -out keys/keycloak-ca.pem -days 365
5558
printf "subjectAltName=DNS:localhost,IP:127.0.0.1" >keys/sanX509.conf

.github/scripts/watch.sh

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,54 @@ done
5353
file_to_watch="$1"
5454
shift
5555

56+
file_signature() {
57+
if [[ ! -e "$1" ]]; then
58+
echo "missing"
59+
return
60+
fi
61+
62+
if stat -c '%i:%s:%Y' "$1" >/dev/null 2>&1; then
63+
stat -c '%i:%s:%Y' "$1"
64+
return
65+
fi
66+
67+
stat -f '%i:%z:%m' "$1"
68+
}
69+
5670
wait_for_change_to() {
57-
if which inotifywait; then
58-
echo "[INFO] inotifywaiting to [${file_to_watch}]"
59-
inotifywait -e modify -e move -e create -e delete -e attrib -r "${file_to_watch}"
71+
if command -v inotifywait >/dev/null 2>&1; then
72+
local watch_dir
73+
local watch_name
74+
local changed_file
75+
76+
watch_dir=$(dirname "${file_to_watch}")
77+
watch_name=$(basename "${file_to_watch}")
78+
79+
echo "[INFO] inotifywaiting to [${file_to_watch}] via [${watch_dir}]"
80+
while true; do
81+
changed_file=$(inotifywait -q \
82+
-e close_write \
83+
-e moved_to \
84+
-e delete \
85+
-e attrib \
86+
--format '%f' \
87+
"${watch_dir}")
88+
89+
if [[ "${changed_file}" == "${watch_name}" ]]; then
90+
return
91+
fi
92+
done
6093
else
61-
m=$(date -r "${file_to_watch}" +%s)
94+
local m
95+
local n
96+
97+
m=$(file_signature "${file_to_watch}")
6298
echo "[INFO] stat checking [${file_to_watch}] from [${m}]"
6399
while true; do
64100
sleep 1
65-
n=$(date -r "${file_to_watch}" +%s)
66-
echo "[INFO] stat checking [${file_to_watch}] from [${m} < ${n}]"
67-
if [[ $m < $n ]]; then
101+
n=$(file_signature "${file_to_watch}")
102+
echo "[INFO] stat checking [${file_to_watch}] from [${m} != ${n}]"
103+
if [[ "${m}" != "${n}" ]]; then
68104
return
69105
fi
70106
done

.github/scripts/work-init.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ if ! cd "$ROOT_DIR"; then
3636
exit 1
3737
fi
3838

39+
# Preserve the toolchain directive from the original go.work so that CI steps
40+
# reading go-version-file: go.work (e.g. govulncheck) continue to use the
41+
# correct Go version after the workspace is regenerated.
42+
ORIG_TOOLCHAIN=$(awk '/^toolchain / {print $2; exit}' go.work 2>/dev/null)
43+
3944
echo "[INFO] Rebuilding partial go.work for [${component}]"
4045
case $component in
4146
lib/ocrypto | lib/fixtures | lib/flattening | lib/identifier | protocol/go)
4247
echo "[INFO] skipping for leaf package"
48+
exit 0
4349
;;
4450
sdk)
4551
rm -f go.work go.work.sum &&
@@ -72,3 +78,12 @@ otdfctl)
7278
exit 1
7379
;;
7480
esac
81+
82+
# Restore the toolchain directive if it was present in the original go.work.
83+
if [[ -n "${ORIG_TOOLCHAIN:-}" ]]; then
84+
if ! go work edit -toolchain="$ORIG_TOOLCHAIN"; then
85+
echo "[ERROR] unable to restore original toolchain [${ORIG_TOOLCHAIN}] in go.work"
86+
exit 1
87+
fi
88+
echo "[INFO] Restored toolchain ${ORIG_TOOLCHAIN} in go.work"
89+
fi

.github/workflows/checks.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
persist-credentials: false
5757
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5858
with:
59-
go-version-file: ${{ matrix.directory }}/go.mod
59+
go-version-file: go.work
6060
check-latest: false
6161
cache-dependency-path: |
6262
examples/go.sum
@@ -84,7 +84,8 @@ jobs:
8484
continue-on-error: true
8585
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
8686
with:
87-
go-version-input: "1.25.9"
87+
go-version-input: ""
88+
go-version-file: go.work
8889
work-dir: ${{ matrix.directory }}
8990
- if: steps.govulncheck.outcome == 'failure'
9091
run: echo "$MODULE_DIR" > "/tmp/govulncheck-failure-${JOB_INDEX}.txt"
@@ -195,7 +196,7 @@ jobs:
195196
persist-credentials: false
196197
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
197198
with:
198-
go-version-file: "service/go.mod"
199+
go-version-file: go.work
199200
check-latest: false
200201
cache-dependency-path: |
201202
service/go.sum
@@ -274,7 +275,7 @@ jobs:
274275
persist-credentials: false
275276
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
276277
with:
277-
go-version-file: "service/go.mod"
278+
go-version-file: go.work
278279
check-latest: false
279280
cache-dependency-path: |
280281
service/go.sum
@@ -523,7 +524,7 @@ jobs:
523524
persist-credentials: false
524525
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
525526
with:
526-
go-version-file: ./tests-bdd/go.mod
527+
go-version-file: go.work
527528
cache: false
528529

529530
- name: Build local platform-cukes image for testing
@@ -598,7 +599,7 @@ jobs:
598599
- uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
599600
with:
600601
github_token: ${{ github.token }}
601-
version: "1.68.2"
602+
version: "1.70.0"
602603
- uses: bufbuild/buf-lint-action@06f9dd823d873146471cfaaf108a993fe00e5325 # v1.1.1
603604
with:
604605
input: service
@@ -608,7 +609,7 @@ jobs:
608609
against: "https://github.com/opentdf/platform.git#branch=${{ github.event.pull_request.base.ref || github.base_ref || 'main' }},subdir=service"
609610
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
610611
with:
611-
go-version-file: "service/go.mod"
612+
go-version-file: go.work
612613
check-latest: false
613614
cache-dependency-path: |
614615
service/go.sum
@@ -617,7 +618,7 @@ jobs:
617618
examples/go.sum
618619
- run: cd service && go get github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
619620
- run: cd service && go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
620-
- run: cd service && go install github.com/sudorandom/protoc-gen-connect-openapi@v0.18.0
621+
- run: cd service && go install github.com/sudorandom/protoc-gen-connect-openapi@v0.25.6
621622
- run: cd service && go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0
622623
- run: make proto-generate
623624
- name: generate connect wrappers
@@ -666,7 +667,7 @@ jobs:
666667
persist-credentials: false
667668
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
668669
with:
669-
go-version-file: "service/go.mod"
670+
go-version-file: go.work
670671
check-latest: false
671672
cache: false
672673
- name: check service licenses

.github/workflows/friendly-reminders.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
persist-credentials: false
1919
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
2020
with:
21-
go-version-file: "service/go.mod"
21+
go-version-file: go.work
2222

2323
- name: Check Go Mod Tidy
2424
id: go-mod-tidy

.github/workflows/nightly-checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
persist-credentials: false
2424
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
2525
with:
26-
go-version-file: "platform/service/go.mod"
26+
go-version-file: "platform/go.work"
2727
check-latest: false
2828
cache-dependency-path: |
2929
platform/examples/go.sum

.github/workflows/release-otdfctl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2121
with:
22-
go-version-file: otdfctl/go.mod
22+
go-version-file: go.work
2323

2424
- name: Extract version from tag
2525
id: version

.github/workflows/sonarcloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: "Setup Go"
2727
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
2828
with:
29-
go-version: "1.25.9"
29+
go-version-file: go.work
3030
check-latest: false
3131
cache-dependency-path: |
3232
service/go.sum

0 commit comments

Comments
 (0)