mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 15:49:33 -05:00
feat(verifiedpermissions): add full service emulation (#3128)
* feat(verifiedpermissions): add full service emulation * fix(verifiedpermissions): harden OIDC and schema validation * test(verifiedpermissions): add service layer coverage * fix(verifiedpermissions): support native Cedar runtime * fix(verifiedpermissions): package Cedar native FFI * fix(verifiedpermissions): register Cedar deserializers for native * fix(verifiedpermissions): bound JWKS refreshes * fix(verifiedpermissions): avoid Cedar entity reflection * fix(verifiedpermissions): register Cedar native reflection * fix(verifiedpermissions): refresh rotated OIDC keys safely * fix(verifiedpermissions): retry failed JWKS refreshes * refactor(verifiedpermissions): isolate Cedar in sidecar * fix(verifiedpermissions): harden Cedar sidecar runtime * fix(verifiedpermissions): build cedar sidecar in compatibility CI * fix(verifiedpermissions): remove stale cedar jni config * fix(verifiedpermissions): recover cedar sidecar * fix(verifiedpermissions): bound OIDC document responses * fix(verifiedpermissions): start cedar sidecar in native sdk CI
This commit is contained in:
1 parent
7a7531a6b9
commit
2d51259120
41 files changed
+4800
-4
No files matched your search
@@ -42,6 +42,12 @@ on:
|
||||
jvm-digest-ref:
|
||||
description: Immutable JVM image reference
|
||||
value: ${{ jobs.publish.outputs.jvm-digest-ref }}
|
||||
cedar-ref:
|
||||
description: Commit-tagged Cedar sidecar image reference
|
||||
value: ${{ jobs.publish.outputs.cedar-ref }}
|
||||
cedar-digest-ref:
|
||||
description: Immutable Cedar sidecar image reference
|
||||
value: ${{ jobs.publish.outputs.cedar-digest-ref }}
|
||||
native-ref:
|
||||
description: Commit-tagged native image reference when publish-native is true
|
||||
value: ${{ jobs.publish.outputs.native-ref }}
|
||||
@@ -259,6 +265,8 @@ jobs:
|
||||
compat-digest-ref: ${{ steps.provenance.outputs.compat-digest-ref }}
|
||||
jvm-ref: ${{ steps.provenance.outputs.jvm-ref }}
|
||||
jvm-digest-ref: ${{ steps.provenance.outputs.jvm-digest-ref }}
|
||||
cedar-ref: ${{ steps.provenance.outputs.cedar-ref }}
|
||||
cedar-digest-ref: ${{ steps.provenance.outputs.cedar-digest-ref }}
|
||||
native-ref: ${{ steps.provenance.outputs.native-ref }}
|
||||
native-digest-ref: ${{ steps.provenance.outputs.native-digest-ref }}
|
||||
|
||||
@@ -334,6 +342,29 @@ jobs:
|
||||
cache-from: type=gha,scope=floci-jvm
|
||||
cache-to: type=gha,scope=floci-jvm,mode=max
|
||||
|
||||
- name: Build and publish Cedar sidecar image
|
||||
id: cedar
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||
env:
|
||||
SOURCE_DATE_EPOCH: ${{ steps.metadata.outputs.source-date-epoch }}
|
||||
with:
|
||||
context: .
|
||||
file: sidecars/cedar/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ needs.prepare.outputs.image }}:${{ needs.prepare.outputs.image-tag }}-cedar
|
||||
labels: |
|
||||
org.opencontainers.image.version=${{ needs.prepare.outputs.product-version }}
|
||||
org.opencontainers.image.revision=${{ needs.prepare.outputs.source-sha }}
|
||||
org.opencontainers.image.vcs-ref=${{ needs.prepare.outputs.source-sha }}
|
||||
org.opencontainers.image.created=${{ steps.metadata.outputs.created }}
|
||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||
version=${{ needs.prepare.outputs.product-version }}
|
||||
build-date=${{ steps.metadata.outputs.created }}
|
||||
vcs-ref=${{ needs.prepare.outputs.source-sha }}
|
||||
cache-from: type=gha,scope=floci-cedar
|
||||
cache-to: type=gha,scope=floci-cedar,mode=max
|
||||
|
||||
- name: Build and publish native image
|
||||
id: native
|
||||
if: inputs.publish-native
|
||||
@@ -390,6 +421,7 @@ jobs:
|
||||
- name: Record image provenance
|
||||
id: provenance
|
||||
env:
|
||||
CEDAR_DIGEST: ${{ steps.cedar.outputs.digest }}
|
||||
COMPAT_DIGEST: ${{ steps.compat.outputs.digest }}
|
||||
CREATED: ${{ steps.metadata.outputs.created }}
|
||||
IMAGE: ${{ needs.prepare.outputs.image }}
|
||||
@@ -408,6 +440,8 @@ jobs:
|
||||
run: |
|
||||
jvm_ref="$IMAGE:$IMAGE_TAG"
|
||||
jvm_digest_ref="$IMAGE@$JVM_DIGEST"
|
||||
cedar_ref="$IMAGE:$IMAGE_TAG-cedar"
|
||||
cedar_digest_ref="$IMAGE@$CEDAR_DIGEST"
|
||||
native_ref="$IMAGE:$IMAGE_TAG-native"
|
||||
compat_ref="$IMAGE:$IMAGE_TAG-native-compat"
|
||||
native_digest_ref="$IMAGE@$NATIVE_DIGEST"
|
||||
@@ -427,7 +461,10 @@ jobs:
|
||||
--arg jvmRef "$jvm_ref" \
|
||||
--arg jvmDigest "$JVM_DIGEST" \
|
||||
--arg jvmDigestRef "$jvm_digest_ref" \
|
||||
'{source: {sha: $sourceSha, requestedRef: $requestedSourceRef, repository: $repository}, workflow: {runId: $runId, attempt: $runAttempt, url: $runUrl}, created: $created, imageTag: $imageTag, productVersion: $productVersion, images: {jvm: {ref: $jvmRef, digest: $jvmDigest, digestRef: $jvmDigestRef, dockerfile: "docker/Dockerfile"}}, platforms: ["linux/amd64", "linux/arm64"]}' \
|
||||
--arg cedarRef "$cedar_ref" \
|
||||
--arg cedarDigest "$CEDAR_DIGEST" \
|
||||
--arg cedarDigestRef "$cedar_digest_ref" \
|
||||
'{source: {sha: $sourceSha, requestedRef: $requestedSourceRef, repository: $repository}, workflow: {runId: $runId, attempt: $runAttempt, url: $runUrl}, created: $created, imageTag: $imageTag, productVersion: $productVersion, images: {jvm: {ref: $jvmRef, digest: $jvmDigest, digestRef: $jvmDigestRef, dockerfile: "docker/Dockerfile"}, cedar: {ref: $cedarRef, digest: $cedarDigest, digestRef: $cedarDigestRef, dockerfile: "sidecars/cedar/Dockerfile"}}, platforms: ["linux/amd64", "linux/arm64"]}' \
|
||||
> floci-image-provenance.json
|
||||
|
||||
if [[ "$PUBLISH_NATIVE" == "true" ]]; then
|
||||
@@ -447,6 +484,8 @@ jobs:
|
||||
{
|
||||
echo "jvm-ref=$jvm_ref"
|
||||
echo "jvm-digest-ref=$jvm_digest_ref"
|
||||
echo "cedar-ref=$cedar_ref"
|
||||
echo "cedar-digest-ref=$cedar_digest_ref"
|
||||
if [[ "$PUBLISH_NATIVE" == "true" ]]; then
|
||||
echo "native-ref=$native_ref"
|
||||
echo "native-digest-ref=$native_digest_ref"
|
||||
@@ -464,6 +503,7 @@ jobs:
|
||||
echo "| Image tag | Immutable digest reference |"
|
||||
echo "| --- | --- |"
|
||||
echo "| \`$jvm_ref\` | \`$jvm_digest_ref\` |"
|
||||
echo "| \`$cedar_ref\` | \`$cedar_digest_ref\` |"
|
||||
if [[ "$PUBLISH_NATIVE" == "true" ]]; then
|
||||
echo "| \`$native_ref\` | \`$native_digest_ref\` |"
|
||||
echo "| \`$compat_ref\` | \`$compat_digest_ref\` |"
|
||||
|
||||
@@ -4,6 +4,7 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'sidecars/cedar/**'
|
||||
- 'pom.xml'
|
||||
- 'docker/Dockerfile.native-package'
|
||||
- 'docker/Dockerfile.compat'
|
||||
@@ -124,6 +125,7 @@ jobs:
|
||||
with:
|
||||
sparse-checkout: |
|
||||
compatibility-tests
|
||||
sidecars/cedar
|
||||
.github/ci
|
||||
|
||||
- name: Compare compat-terraform and compat-opentofu resource lists
|
||||
@@ -298,6 +300,10 @@ jobs:
|
||||
- name: Start floci
|
||||
run: |
|
||||
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
|
||||
EXTRA_ENV=""
|
||||
if [ "${{ matrix.test }}" = "sdk-test-java" ]; then
|
||||
EXTRA_ENV="-e FLOCI_SERVICES_VERIFIEDPERMISSIONS_CEDAR_URL=http://floci-cedar:8180"
|
||||
fi
|
||||
docker run -d --name floci --network compat-net \
|
||||
-p 4566:4566 \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
@@ -307,6 +313,7 @@ jobs:
|
||||
-e FLOCI_HOSTNAME=floci \
|
||||
-e FLOCI_SERVICES_IOT_MQTT_ENABLED=true \
|
||||
-e FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ENABLED=true \
|
||||
$EXTRA_ENV \
|
||||
-e FLOCI_TLS_ENABLED=true \
|
||||
-e FLOCI_SERVICES_EC2_MOCK=true \
|
||||
-e FLOCI_SERVICES_REDSHIFT_ENDPOINT_HOST=floci \
|
||||
@@ -341,8 +348,24 @@ jobs:
|
||||
with:
|
||||
sparse-checkout: |
|
||||
compatibility-tests
|
||||
sidecars/cedar
|
||||
.github/ci
|
||||
|
||||
- name: Build and start Cedar sidecar
|
||||
if: matrix.test == 'sdk-test-java'
|
||||
run: |
|
||||
docker build -f sidecars/cedar/Dockerfile -t floci-cedar:test .
|
||||
docker run -d --name floci-cedar --network compat-net -p 18180:8180 floci-cedar:test
|
||||
for _ in $(seq 1 60); do
|
||||
if curl --fail --silent http://127.0.0.1:18180/health >/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
echo "::error::Cedar sidecar did not become healthy"
|
||||
docker logs floci-cedar
|
||||
exit 1
|
||||
|
||||
- uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
||||
|
||||
- name: Build test image
|
||||
|
||||
@@ -8,6 +8,7 @@ name: Nightly
|
||||
#
|
||||
# Published tags:
|
||||
# Native: floci/floci:nightly floci/floci:nightly-mmddyyyy
|
||||
# Cedar: floci/floci:nightly-cedar floci/floci:nightly-mmddyyyy-cedar
|
||||
# Compat: floci/floci:nightly-compat floci/floci:nightly-mmddyyyy-compat
|
||||
#
|
||||
# Required secrets: DOCKERHUB_USERNAME, DOCKERHUB_TOKEN, AWS_ROLE_ARN
|
||||
@@ -232,6 +233,30 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Build and push Cedar sidecar nightly image
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||
env:
|
||||
SOURCE_DATE_EPOCH: ${{ steps.source_date.outputs.epoch }}
|
||||
with:
|
||||
context: .
|
||||
file: sidecars/cedar/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
floci/floci:nightly-cedar
|
||||
floci/floci:nightly-${{ needs.prepare.outputs.version }}-cedar
|
||||
public.ecr.aws/floci/floci:nightly-cedar
|
||||
public.ecr.aws/floci/floci:nightly-${{ needs.prepare.outputs.version }}-cedar
|
||||
labels: |
|
||||
org.opencontainers.image.version=nightly-${{ needs.prepare.outputs.version }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
org.opencontainers.image.created=${{ steps.created.outputs.created }}
|
||||
version=nightly-${{ needs.prepare.outputs.version }}
|
||||
build-date=${{ steps.created.outputs.created }}
|
||||
vcs-ref=${{ github.sha }}
|
||||
cache-from: type=gha,scope=floci-cedar
|
||||
cache-to: type=gha,scope=floci-cedar,mode=max
|
||||
|
||||
- name: Build and push compat nightly image
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||
env:
|
||||
|
||||
@@ -7,6 +7,8 @@ name: Release
|
||||
# Published tags:
|
||||
# Native: floci/floci:1.2.3 floci/floci:latest
|
||||
# public.ecr.aws/floci/floci:1.2.3 public.ecr.aws/floci/floci:latest
|
||||
# Cedar: floci/floci:1.2.3-cedar floci/floci:latest-cedar
|
||||
# public.ecr.aws/floci/floci:1.2.3-cedar public.ecr.aws/floci/floci:latest-cedar
|
||||
# Compat: floci/floci:1.2.3-compat floci/floci:latest-compat
|
||||
# public.ecr.aws/floci/floci:1.2.3-compat public.ecr.aws/floci/floci:latest-compat
|
||||
#
|
||||
@@ -182,6 +184,32 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Build and push Cedar sidecar multi-arch image
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||
env:
|
||||
SOURCE_DATE_EPOCH: ${{ steps.source_date.outputs.epoch }}
|
||||
with:
|
||||
context: .
|
||||
file: sidecars/cedar/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
provenance: mode=max
|
||||
sbom: true
|
||||
tags: |
|
||||
floci/floci:${{ steps.version.outputs.version }}-cedar
|
||||
floci/floci:latest-cedar
|
||||
public.ecr.aws/floci/floci:${{ steps.version.outputs.version }}-cedar
|
||||
public.ecr.aws/floci/floci:latest-cedar
|
||||
labels: |
|
||||
org.opencontainers.image.version=${{ steps.version.outputs.version }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
org.opencontainers.image.created=${{ steps.created.outputs.created }}
|
||||
version=${{ steps.version.outputs.version }}
|
||||
build-date=${{ steps.created.outputs.created }}
|
||||
vcs-ref=${{ github.sha }}
|
||||
cache-from: type=gha,scope=floci-cedar
|
||||
cache-to: type=gha,scope=floci-cedar,mode=max
|
||||
|
||||
- name: Build and push compat multi-arch image
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||
env:
|
||||
|
||||
Reference in new issue
Block a user