Skip to content

Commit f4cda1c

Browse files
committed
Merge branch 'dev-v2' into update-config-file-dep-review-v2
2 parents 148facb + f15a84c commit f4cda1c

File tree

15 files changed

+144
-67
lines changed

15 files changed

+144
-67
lines changed

.github/actions/az-sync/action.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Sync Secrets from Azure Key Vault
2+
author: s.breen
3+
description: az-sync
4+
inputs:
5+
az_client_id:
6+
description: 'Azure Client ID'
7+
required: true
8+
az_tenant_id:
9+
description: 'Azure Tenant ID'
10+
required: true
11+
az_subscription_id:
12+
description: 'Azure Subscription ID'
13+
required: true
14+
keyvault:
15+
description: 'Azure Key Vault name'
16+
required: true
17+
secrets-filter:
18+
description: 'Filter for secrets to sync (comma-separated patterns)'
19+
required: true
20+
default: '*'
21+
runs:
22+
using: "composite"
23+
steps:
24+
- name: Azure login
25+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
26+
with:
27+
client-id: ${{ inputs.az_client_id }}
28+
tenant-id: ${{ inputs.az_tenant_id }}
29+
subscription-id: ${{ inputs.az_subscription_id }}
30+
31+
- name: Sync
32+
shell: bash
33+
run: |
34+
IFS=',' read -r -a array <<< "${{ inputs.secrets-filter }}"
35+
for pattern in "${array[@]}"; do
36+
echo "Processing pattern: $pattern"
37+
for secret_name in $(az keyvault secret list --vault-name "${{ inputs.keyvault }}" --query "[?contains(name, '$pattern')].name" -o tsv); do
38+
secret_value=$(az keyvault secret show --name "$secret_name" --vault-name "${{ inputs.keyvault }}" --query value -o tsv)
39+
# check if value is multiline
40+
if [[ "$secret_value" == *$'\n'* ]]; then
41+
# Mask each line for multiline secrets
42+
while IFS= read -r line; do
43+
[[ -n "$line" ]] && echo "::add-mask::${line}"
44+
done <<< "$secret_value"
45+
46+
# Use heredoc syntax for multiline environment variables
47+
delimiter="EOF_${secret_name}_$(date +%s)"
48+
{
49+
echo "${secret_name}<<${delimiter}"
50+
echo "$secret_value"
51+
echo "$delimiter"
52+
} >> $GITHUB_ENV
53+
else
54+
echo "::add-mask::${secret_value}"
55+
echo "$secret_name=$secret_value" >> $GITHUB_ENV
56+
fi
57+
echo "Synced secret: env.$secret_name"
58+
done
59+
done
60+
61+
- name: Azure logout
62+
shell: bash
63+
run: |
64+
az logout

.github/workflows/azure-upload.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ jobs:
5151
build-args: |
5252
package_type=signed-package
5353
- name: Build Packages
54-
env:
55-
INDIGO_GPG_AGENT: ${{ secrets.INDIGO_GPG_AGENT }}
56-
NFPM_SIGNING_KEY_FILE: .key.asc
5754
run: |
58-
echo "$INDIGO_GPG_AGENT" | base64 --decode > .key.asc
5955
make clean package
6056
- name: Azure Login
6157
uses: azure/login@6b2456866fc08b011acb422a92a4aa20e2c4de32 # v2.1.0

.github/workflows/ci.yml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ jobs:
271271
name: Integration Tests - Official Plus Images
272272
needs: build-unsigned-snapshot
273273
runs-on: ubuntu-24.04
274+
permissions:
275+
id-token: write # for OIDC authentication
274276
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot/') }}
275277
strategy:
276278
fail-fast: false
@@ -303,12 +305,32 @@ jobs:
303305
with:
304306
name: nginx-agent-unsigned-snapshots
305307
path: build
308+
309+
- name: Get Secrets from Agent Key Vault
310+
uses: ./.github/actions/az-sync
311+
with:
312+
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
313+
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
314+
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
315+
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
316+
secrets-filter: 'artifactory'
317+
318+
- name: Sync Secrets from Common Key Vault
319+
uses: ./.github/actions/az-sync
320+
with:
321+
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
322+
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
323+
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
324+
keyvault: ${{ secrets.AZ_KEYVAULT_COMMON }}
325+
secrets-filter: 'docker,nginx-private-registry,nginx-pkg'
326+
306327
- name: Login to Docker Registry
307-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
328+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
308329
with:
309-
registry: ${{ secrets.TEST_REGISTRY_URL }}
310-
username: ${{ secrets.REGISTRY_USERNAME }}
311-
password: ${{ secrets.REGISTRY_PASSWORD }}
330+
registry: ${{ env.nginx-private-registry-url }}
331+
username: ${{ env.nginx-pkg-jwt }}
332+
password: "none"
333+
312334
- name: Set Start Time
313335
run: echo "START_TIME=$(date +"%Y-%m-%dT%H:%M:%S.%NZ")" >> ${GITHUB_ENV}
314336
- name: Create Directory
@@ -320,7 +342,7 @@ jobs:
320342
- name: Run Integration Tests
321343
run: |
322344
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
323-
CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.TEST_REGISTRY_URL }}" TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \
345+
CONTAINER_NGINX_IMAGE_REGISTRY="${{ env.nginx-private-registry-url }}" TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \
324346
OS_RELEASE="${{ matrix.container.release }}" IMAGE_PATH="${{ matrix.container.path }}" \
325347
make official-image-integration-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}${{matrix.container.version}}/raw_logs.log && exit "${PIPESTATUS[0]}"
326348
- name: Generate Test Results
@@ -345,10 +367,20 @@ jobs:
345367
name: Performance Tests
346368
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref_name, 'dependabot/') }}
347369
runs-on: ubuntu-22.04
370+
permissions:
371+
id-token: write # for OIDC authentication
348372
steps:
349373
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
350374
- name: Set up Docker Build
351375
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
376+
- name: Sync Secrets from Common Key Vault
377+
uses: ./.github/actions/az-sync
378+
with:
379+
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
380+
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
381+
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
382+
keyvault: ${{ secrets.AZ_KEYVAULT_COMMON }}
383+
secrets-filter: 'nginx-pkg'
352384
- name: Build Docker Image
353385
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
354386
with:
@@ -359,8 +391,8 @@ jobs:
359391
load: true
360392
no-cache: true
361393
secrets: |
362-
"nginx-crt=${{ secrets.NGINX_CRT }}"
363-
"nginx-key=${{ secrets.NGINX_KEY }}"
394+
"nginx-crt=${{ env.nginx-pkg-certificate}}"
395+
"nginx-key=${{ env.nginx-pkg-key }}"
364396
- name: Run Performance Tests
365397
run: docker run -v ${GITHUB_WORKSPACE}:/home/nginx/ --rm nginx-agent-benchmark:1.0.0
366398

@@ -394,11 +426,7 @@ jobs:
394426
build-args: |
395427
package_type=signed-package
396428
- name: Build Packages
397-
env:
398-
INDIGO_GPG_AGENT: ${{ secrets.INDIGO_GPG_AGENT }}
399-
NFPM_SIGNING_KEY_FILE: .key.asc
400429
run: |
401-
echo "$INDIGO_GPG_AGENT" | base64 --decode > .key.asc
402430
make clean package
403431
- name: Upload Artifacts
404432
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3

.github/workflows/f5-cla.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ jobs:
4747
# Do not lock PRs after a merge.
4848
lock-pullrequest-aftermerge: false
4949
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
GITHUB_TOKEN: ${{ github.token }}
5151
PERSONAL_ACCESS_TOKEN: ${{ secrets.F5_CLA_TOKEN }}

.github/workflows/label-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
with:
1919
disable-releaser: true
2020
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/release-branch.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,7 @@ jobs:
165165
package_type=signed-package
166166
167167
- name: Build Packages
168-
env:
169-
INDIGO_GPG_AGENT: ${{ secrets.INDIGO_GPG_AGENT }}
170-
NFPM_SIGNING_KEY_FILE: .key.asc
171168
run: |
172-
echo "$INDIGO_GPG_AGENT" | base64 --decode > .key.asc
173169
make clean package
174170
175171
- name: Get Id Token
@@ -184,7 +180,7 @@ jobs:
184180
- name: Publish Release Packages
185181
if: ${{ inputs.publishPackages == true }}
186182
env:
187-
TOKEN: ${{ steps.idtoken.outputs.id_token }}
183+
TOKEN: ${{ github.token }}
188184
UPLOAD_URL: "https://up-ap.nginx.com"
189185
run: |
190186
make release

.nfpm.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,8 @@ overrides:
3939
depends:
4040
- apt-transport-https
4141
deb:
42-
signature:
43-
method: dpkg-sig
44-
key_file: ".key.asc"
4542
rpm:
46-
signature:
47-
key_file: ".key.asc"
4843
apk:
49-
signature:
50-
key_file: ".key.rsa"
5144
scripts:
5245
postupgrade: "./scripts/packages/postupgrade.sh"
5346
scripts:

Makefile.packaging

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $(GITHUB_PACKAGES_DIR):
4141
$(AZURE_PACKAGES_DIR):
4242
@mkdir -p $(AZURE_PACKAGES_DIR)
4343

44-
package: gpg-key $(PACKAGES_DIR) $(GITHUB_PACKAGES_DIR) $(AZURE_PACKAGES_DIR) #### Create final packages for all supported distros
44+
package: $(PACKAGES_DIR) $(GITHUB_PACKAGES_DIR) $(AZURE_PACKAGES_DIR) #### Create final packages for all supported distros
4545
# Create deb packages
4646

4747
@for arch in $(DEB_ARCHS); do \

docs/proto/proto.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
- [AgentConnectStatus.StatusCode](#f5-nginx-agent-sdk-AgentConnectStatus-StatusCode)
1919
- [AgentLogging.Level](#f5-nginx-agent-sdk-AgentLogging-Level)
2020

21-
- [command_svc.proto](#command_svc-proto)
22-
- [Commander](#f5-nginx-agent-sdk-Commander)
23-
2421
- [command.proto](#command-proto)
2522
- [AgentActivityStatus](#f5-nginx-agent-sdk-AgentActivityStatus)
2623
- [ChunkedResourceChunk](#f5-nginx-agent-sdk-ChunkedResourceChunk)
@@ -42,6 +39,9 @@
4239
- [NginxConfigStatus.Status](#f5-nginx-agent-sdk-NginxConfigStatus-Status)
4340
- [UploadStatus.TransferStatus](#f5-nginx-agent-sdk-UploadStatus-TransferStatus)
4441

42+
- [command_svc.proto](#command_svc-proto)
43+
- [Commander](#f5-nginx-agent-sdk-Commander)
44+
4545
- [common.proto](#common-proto)
4646
- [CertificateDates](#f5-nginx-agent-sdk-CertificateDates)
4747
- [CertificateName](#f5-nginx-agent-sdk-CertificateName)
@@ -341,34 +341,6 @@ Log level enum
341341

342342

343343

344-
<a name="command_svc-proto"></a>
345-
<p align="right"><a href="#top">Top</a></p>
346-
347-
## command_svc.proto
348-
349-
350-
351-
352-
353-
354-
355-
356-
357-
<a name="f5-nginx-agent-sdk-Commander"></a>
358-
359-
### Commander
360-
Represents a service used to sent command messages between the management server and the agent.
361-
362-
| Method Name | Request Type | Response Type | Description |
363-
| ----------- | ------------ | ------------- | ------------|
364-
| CommandChannel | [Command](#f5-nginx-agent-sdk-Command) stream | [Command](#f5-nginx-agent-sdk-Command) stream | A Bidirectional streaming RPC established by the agent and is kept open |
365-
| Download | [DownloadRequest](#f5-nginx-agent-sdk-DownloadRequest) | [DataChunk](#f5-nginx-agent-sdk-DataChunk) stream | A streaming RPC established by the agent and is used to download resources associated with commands The download stream will be kept open for the duration of the data transfer and will be closed when its done. The transfer is a stream of chunks as follows: header -&gt; data chunk 1 -&gt; data chunk N. Each data chunk is of a size smaller than the maximum gRPC payload |
366-
| Upload | [DataChunk](#f5-nginx-agent-sdk-DataChunk) stream | [UploadStatus](#f5-nginx-agent-sdk-UploadStatus) | A streaming RPC established by the agent and is used to upload resources associated with commands |
367-
368-
369-
370-
371-
372344
<a name="command-proto"></a>
373345
<p align="right"><a href="#top">Top</a></p>
374346

@@ -680,6 +652,34 @@ Transfer status enum
680652

681653

682654

655+
<a name="command_svc-proto"></a>
656+
<p align="right"><a href="#top">Top</a></p>
657+
658+
## command_svc.proto
659+
660+
661+
662+
663+
664+
665+
666+
667+
668+
<a name="f5-nginx-agent-sdk-Commander"></a>
669+
670+
### Commander
671+
Represents a service used to sent command messages between the management server and the agent.
672+
673+
| Method Name | Request Type | Response Type | Description |
674+
| ----------- | ------------ | ------------- | ------------|
675+
| CommandChannel | [Command](#f5-nginx-agent-sdk-Command) stream | [Command](#f5-nginx-agent-sdk-Command) stream | A Bidirectional streaming RPC established by the agent and is kept open |
676+
| Download | [DownloadRequest](#f5-nginx-agent-sdk-DownloadRequest) | [DataChunk](#f5-nginx-agent-sdk-DataChunk) stream | A streaming RPC established by the agent and is used to download resources associated with commands The download stream will be kept open for the duration of the data transfer and will be closed when its done. The transfer is a stream of chunks as follows: header -&gt; data chunk 1 -&gt; data chunk N. Each data chunk is of a size smaller than the maximum gRPC payload |
677+
| Upload | [DataChunk](#f5-nginx-agent-sdk-DataChunk) stream | [UploadStatus](#f5-nginx-agent-sdk-UploadStatus) | A streaming RPC established by the agent and is used to upload resources associated with commands |
678+
679+
680+
681+
682+
683683
<a name="common-proto"></a>
684684
<p align="right"><a href="#top">Top</a></p>
685685

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/nginx/agent/v2
22

33
go 1.24.2
44

5-
toolchain go1.24.11
5+
toolchain go1.24.12
66

77
require (
88
github.com/cenkalti/backoff/v4 v4.2.1 // indirect

0 commit comments

Comments
 (0)