Skip to content

feat: add UPF event and opt-in redirect rejection policy - #77

Merged
Alonza0314 merged 2 commits into
free5gc:feat/releasefrom
Intelligent-Systems-Lab:feat/smf-event-exposure-openapi
Aug 19, 2026
Merged

feat: add UPF event and opt-in redirect rejection policy#77
Alonza0314 merged 2 commits into
free5gc:feat/releasefrom
Intelligent-Systems-Lab:feat/smf-event-exposure-openapi

Conversation

@haha39

@haha39 haha39 commented Jun 20, 2026

Copy link
Copy Markdown

Summary

This PR is rebuilt on top of feat/release and uses its generator-produced smf/EvtExpos and upf/EvtExpos packages.

It adds only the remaining functionality needed by the targeted SMF Event Exposure flow:

  • the UPF_EVENT value in Smf_EvtExpos_SmfEvent;
  • a generic, opt-in redirect rejection policy in the shared OpenAPI runtime;
  • redirect-policy configuration support for upf/EvtExpos.

The generated Nupf Event Exposure models and Create/Delete operations are provided by feat/release and are not duplicated or regenerated in this PR.

Redirect behavior

Default redirect behavior remains unchanged for configurations that do not provide a redirect policy.

Callers may explicitly reject redirects with:

configuration.SetRedirectPolicy(openapi.RejectRedirects)

The policy is applied through a request-local http.Client value. It preserves the selected client's Transport, Timeout, Jar, and metrics behavior without mutating the original client, shared clients, or their transports.

With redirect rejection enabled, generated Create and Delete operations receive the original 307 or 308 response for normal response parsing. No request is sent to the redirect target, and a Create request body is not replayed.

Tests

The added tests cover:

  • the exact UPF_EVENT wire value;
  • unchanged default redirect behavior;
  • explicit HTTP client precedence;
  • Transport, Timeout, and Jar preservation;
  • original and shared-client immutability;
  • metrics behavior for rejected 307 and 308 responses;
  • upf/EvtExpos configuration opt-in;
  • Create and Delete handling for 307 and 308;
  • zero redirect-target requests and no Create-body replay;
  • concurrent default, existing-policy, and opt-in use under the race detector.

Validation

Validated locally with Go 1.26.2:

GOWORK=off GOPROXY=off go build -v ./...
GOWORK=off GOPROXY=off go test -count=1 -v ./...
GOWORK=off GOPROXY=off go test -race -count=1 . ./upf/EvtExpos
GOWORK=off GOPROXY=off go test -race -count=1 ./...

All commands passed. gofmt -d returned no output for the seven changed files, and the complete diff passed git diff --check.

The rebuilt head currently has no successful official CI result because the workflow run completed as action_required without starting any jobs.

Related

@haha39
haha39 force-pushed the feat/smf-event-exposure-openapi branch from d357875 to aa18223 Compare August 17, 2026 18:06
@haha39
haha39 changed the base branch from main to feat/release August 17, 2026 19:38
@haha39 haha39 changed the title feat: extend Nsmf_EventExposure models and add Nupf_EventExposure client feat: add UPF event and opt-in redirect rejection policy Aug 17, 2026
@Alonza0314
Alonza0314 merged commit 3ee3c7e into free5gc:feat/release Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants