Skip to content

Commit 667a49a

Browse files
committed
merge main
2 parents bbdbeaa + 02f4c36 commit 667a49a

Some content is hidden

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

43 files changed

+878
-1355
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,14 @@ jobs:
8787
name: Vulnerability Scan
8888
uses: ./.github/workflows/vulncheck.yml
8989
permissions:
90-
security-events: write
90+
contents: read
91+
security-events: write # for reporting vulnerabilities via code-scanning API
9192
with:
9293
target-branch: ${{ github.event.pull_request.base.ref || github.ref_name }}
9394

9495
unit-test:
9596
name: Unit Tests
9697
runs-on: ubuntu-22.04
97-
permissions:
98-
contents: write
9998
steps:
10099
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
101100
- name: Configure Go Proxy
@@ -592,7 +591,7 @@ jobs:
592591
runs-on: ubuntu-22.04
593592
needs: build-unsigned-snapshot
594593
permissions:
595-
contents: write
594+
contents: write # Needed for pushing benchmark results to github branch
596595
steps:
597596
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
598597
- name: Configure Go Proxy
@@ -634,7 +633,7 @@ jobs:
634633
name: Load Tests
635634
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'dependabot-') }}
636635
permissions:
637-
contents: write
636+
contents: write # Needed for pushing benchmark results to github branch
638637
runs-on: ubuntu-22.04
639638
needs: build-unsigned-snapshot
640639
steps:

.github/workflows/nightly-scans.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,24 @@ on:
44
- cron: '0 2 * * *' # Runs daily at 2:00 AM UTC
55
workflow_dispatch:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
scan-main:
912
name: Vulnerability Scan - Main
1013
uses: ./.github/workflows/vulncheck.yml
14+
permissions:
15+
contents: read
16+
security-events: write # for reporting vulnerabilities via code-scanning API
1117
with:
1218
target-branch: 'main'
1319

1420
scan-v2:
1521
name: Vulnerability Scan - dev-v2
1622
uses: ./.github/workflows/vulncheck.yml
23+
permissions:
24+
contents: read
25+
security-events: write # for reporting vulnerabilities via code-scanning API
1726
with:
1827
target-branch: 'dev-v2'

.github/workflows/release-branch.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jobs:
185185
runs-on: ubuntu-22.04
186186
needs: [vars,release-draft]
187187
permissions:
188-
contents: write
188+
contents: write # Needed to tag a release
189189
steps:
190190
- name: Checkout Repository
191191
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -206,8 +206,7 @@ jobs:
206206
runs-on: ubuntu-22.04-amd64
207207
needs: [vars,release-draft,tag-release]
208208
permissions:
209-
id-token: write
210-
contents: write # Needed to update a release
209+
id-token: write # Needed to get a token to upload packages to NGINX repo
211210
steps:
212211
- name: Checkout Repository
213212
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -314,7 +313,7 @@ jobs:
314313
runs-on: ubuntu-22.04
315314
needs: [vars,tag-release]
316315
permissions:
317-
pull-requests: write
316+
pull-requests: write # Needed to create pull request back into main branch
318317
steps:
319318
- name: Checkout Repository
320319
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ jobs:
5555

5656
# Upload the results to GitHub's code scanning dashboard.
5757
- name: "Upload to code-scanning"
58-
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
58+
uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
5959
with:
6060
sarif_file: results.sarif

.github/workflows/upload-release-assets.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ defaults:
2525
shell: bash
2626

2727
permissions:
28-
contents: write
28+
contents: read
2929

3030
jobs:
3131
vars:
@@ -51,6 +51,8 @@ jobs:
5151
name: Upload assets
5252
runs-on: ubuntu-22.04
5353
needs: [vars]
54+
permissions:
55+
contents: write # Needed for uploading release assets to GitHub
5456
steps:
5557
- name: Checkout Repository
5658
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

api/grpc/mpi/v1/command.pb.go

Lines changed: 219 additions & 134 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/grpc/mpi/v1/command.pb.validate.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/grpc/mpi/v1/command.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,25 @@ message UpdateDataPlaneHealthResponse {}
152152

153153
// Reports the status of an associated command. This may be in response to a ManagementPlaneRequest
154154
message DataPlaneResponse {
155+
enum RequestType {
156+
UNSPECIFIED_REQUEST = 0;
157+
CONFIG_APPLY_REQUEST = 1;
158+
CONFIG_UPLOAD_REQUEST = 2;
159+
HEALTH_REQUEST = 3;
160+
STATUS_REQUEST = 4;
161+
API_ACTION_REQUEST = 5;
162+
COMMAND_STATUS_REQUEST = 6;
163+
UPDATE_AGENT_CONFIG_REQUEST = 7;
164+
}
165+
155166
// Meta-information associated with a message
156167
mpi.v1.MessageMeta message_meta = 1;
157168
// The command response with the associated request
158169
mpi.v1.CommandResponse command_response = 2;
159170
// The instance identifier, if applicable, for this response
160171
string instance_id = 3;
172+
// The management plane request type that is being responded to
173+
RequestType request_type = 4;
161174
}
162175

163176
// A Management Plane request for information, triggers an associated rpc on the Data Plane

docs/proto/protos.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
- [UpdateHTTPUpstreamServers](#mpi-v1-UpdateHTTPUpstreamServers)
8686
- [UpdateStreamServers](#mpi-v1-UpdateStreamServers)
8787

88+
- [DataPlaneResponse.RequestType](#mpi-v1-DataPlaneResponse-RequestType)
8889
- [InstanceHealth.InstanceHealthStatus](#mpi-v1-InstanceHealth-InstanceHealthStatus)
8990
- [InstanceMeta.InstanceType](#mpi-v1-InstanceMeta-InstanceType)
9091
- [Log.LogLevel](#mpi-v1-Log-LogLevel)
@@ -862,6 +863,7 @@ Reports the status of an associated command. This may be in response to a Manage
862863
| message_meta | [MessageMeta](#mpi-v1-MessageMeta) | | Meta-information associated with a message |
863864
| command_response | [CommandResponse](#mpi-v1-CommandResponse) | | The command response with the associated request |
864865
| instance_id | [string](#string) | | The instance identifier, if applicable, for this response |
866+
| request_type | [DataPlaneResponse.RequestType](#mpi-v1-DataPlaneResponse-RequestType) | | The management plane request type that is being responded to |
865867

866868

867869

@@ -1326,6 +1328,24 @@ Update Upstream Stream Servers for an instance
13261328

13271329

13281330

1331+
<a name="mpi-v1-DataPlaneResponse-RequestType"></a>
1332+
1333+
### DataPlaneResponse.RequestType
1334+
1335+
1336+
| Name | Number | Description |
1337+
| ---- | ------ | ----------- |
1338+
| UNSPECIFIED_REQUEST | 0 | |
1339+
| CONFIG_APPLY_REQUEST | 1 | |
1340+
| CONFIG_UPLOAD_REQUEST | 2 | |
1341+
| HEALTH_REQUEST | 3 | |
1342+
| STATUS_REQUEST | 4 | |
1343+
| API_ACTION_REQUEST | 5 | |
1344+
| COMMAND_STATUS_REQUEST | 6 | |
1345+
| UPDATE_AGENT_CONFIG_REQUEST | 7 | |
1346+
1347+
1348+
13291349
<a name="mpi-v1-InstanceHealth-InstanceHealthStatus"></a>
13301350

13311351
### InstanceHealth.InstanceHealthStatus

internal/bus/message_pipe.go

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,13 @@ func (p *MessagePipe) Reconfigure(ctx context.Context, agentConfig *mpi.AgentCon
206206

207207
// If the agent update was received from a create connection request no data plane response needs to be sent
208208
if topic == AgentConfigUpdateTopic {
209-
response := p.createDataPlaneResponse(correlationID, mpi.CommandResponse_COMMAND_STATUS_FAILURE,
210-
"Failed to update agent config", reconfigureError.Error())
209+
response := p.createDataPlaneResponse(
210+
correlationID,
211+
mpi.CommandResponse_COMMAND_STATUS_FAILURE,
212+
mpi.DataPlaneResponse_UPDATE_AGENT_CONFIG_REQUEST,
213+
"Failed to update agent config",
214+
reconfigureError.Error(),
215+
)
211216
p.bus.Publish(DataPlaneResponseTopic, ctx, &Message{Topic: DataPlaneResponseTopic, Data: response})
212217
}
213218

@@ -222,8 +227,13 @@ func (p *MessagePipe) Reconfigure(ctx context.Context, agentConfig *mpi.AgentCon
222227

223228
slog.InfoContext(ctx, "Finished reconfiguring plugins", "plugins", p.plugins)
224229
if topic == AgentConfigUpdateTopic {
225-
response := p.createDataPlaneResponse(correlationID, mpi.CommandResponse_COMMAND_STATUS_OK,
226-
"Successfully updated agent config", "")
230+
response := p.createDataPlaneResponse(
231+
correlationID,
232+
mpi.CommandResponse_COMMAND_STATUS_OK,
233+
mpi.DataPlaneResponse_UPDATE_AGENT_CONFIG_REQUEST,
234+
"Successfully updated agent config",
235+
"",
236+
)
227237
p.bus.Publish(DataPlaneResponseTopic, ctx, &Message{Topic: DataPlaneResponseTopic, Data: response})
228238
}
229239
}
@@ -339,7 +349,10 @@ func (p *MessagePipe) initPlugins(ctx context.Context) {
339349
}
340350
}
341351

342-
func (p *MessagePipe) createDataPlaneResponse(correlationID string, status mpi.CommandResponse_CommandStatus,
352+
func (p *MessagePipe) createDataPlaneResponse(
353+
correlationID string,
354+
status mpi.CommandResponse_CommandStatus,
355+
requestType mpi.DataPlaneResponse_RequestType,
343356
message, err string,
344357
) *mpi.DataPlaneResponse {
345358
return &mpi.DataPlaneResponse{
@@ -353,6 +366,7 @@ func (p *MessagePipe) createDataPlaneResponse(correlationID string, status mpi.C
353366
Message: message,
354367
Error: err,
355368
},
369+
RequestType: requestType,
356370
}
357371
}
358372

0 commit comments

Comments
 (0)