feat: extend Nsmf_EventExposure models and add Nupf_EventExposure client#77
Open
haha39 wants to merge 3 commits into
Open
feat: extend Nsmf_EventExposure models and add Nupf_EventExposure client#77haha39 wants to merge 3 commits into
haha39 wants to merge 3 commits into
Conversation
This was referenced Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the existing Nsmf_EventExposure models with fields needed to
represent the targeted UPF event subscription flow and adds Nupf_EventExposure
models and client operations for creating and deleting subscriptions.
It also adds an optional per-configuration redirect policy to the shared
runtime and enables Nupf_EventExposure configurations to select reject-all
behavior without changing the default behavior of other APIs.
Motivation
The current module provides Nsmf_EventExposure support but does not include the
Nsmf UPF-event forwarding fields or a Nupf_EventExposure client. These additions
are needed for an SMF to create the corresponding subscription on the selected
UPF.
Changes
UPF_EVENTtoSmfEvent.SmfEventExposureEventSubscriptionwith:upfEventsbundlingAllowedbundleIdbundledEventNotifyUrisubscription paths.
ServiceName_NUPF_EE.POST /ee-subscriptionsDELETE /ee-subscriptions/{subscriptionId}responses.
subscriptionwrapper.IpAddr,Snssai,ProblemDetails, andRedirectResponse.RedirectPolicy,RedirectPolicyProvider, andRejectRedirectsruntime API.keeping their default policy nil.
preserving the selected client's Transport, Timeout, and Jar, as well as
existing metrics hook behavior.
Specification Scope
This is a targeted addition based on:
It does not perform a broad Rel-19 regeneration or modify unrelated APIs.
Existing Nsmf_EventExposure behavior remains backward-compatible.
OpenAPI Generator v7.12.0 output was used as a wire-shape reference. Raw
generator output is not included in this PR. The final package layout and shared
model reuse follow the existing free5gc/openapi structure.
The
Upf*prefix follows nearby service-specific naming patterns and avoidscollisions in the shared
modelspackage. The exact naming remains open tomaintainer feedback.
BundleIduses*uint32to preserve the distinction between omission and"bundleId": 0, represent the complete TS 29.571 Uint32 range, and rejectnegative or above-range JSON values.
Redirect Behavior
Configurations that do not provide a redirect policy, or provide a nil policy,
retain the existing redirect behavior. This includes the default
Nupf_EventExposure configuration.
With Go's default HTTP redirect policy, replayable Create POST requests
receiving
307or308are followed and the final response is returned.Callers can explicitly configure Nupf_EventExposure with:
The shared runtime then uses a request-local
http.Clientvalue that preservesthe selected client's Transport, Timeout, and Jar, as well as existing metrics
hook behavior, while replacing only
CheckRedirect. It does not mutate theoriginal client, shared clients, or their transports.
With redirect rejection enabled, Create and Delete receive the original
307/308response and return aGenericOpenAPIErrorwhose model exposesRedirectResponse,Location, and3gpp-Sbi-Target-Nf-Id. No request is sentto the redirect target, and the Create body is not replayed.
The runtime hook is general-purpose. In this PR, the generated-style opt-in
setter is exposed only by the Nupf_EventExposure configuration.
Intentional Omissions
The following areas are outside this focused change:
CreatedEventSubscription.reportListNotificationItemand its dependent report schema graphflowDescsCreate/Delete subscription flow
Tests
Added focused model and client tests covering:
subscriptionwrapperIpAddrserializationBundleIdserialization at0and4294967295BundleIdJSON values below0or above4294967295bundlingAllowed: falseexisting metrics hook behavior
307/308rejectionLocationand3gpp-Sbi-Target-Nf-IdheadersValidation
Validation environment:
Formatting and diff checks:
gofmt -lagainst all changed Go files returned no output.git diff --checkpassed.Build and test commands:
Focused race validation:
Related Issue
Related to #75.
Thank you for reviewing this contribution.