5G-MAG / rt-5gms-application-provider

The 5GMS Application Provider interacts with the 5GMS Application Function via M1 Provisioning interface, and uses M8 interface to communicate with UE.
Other
2 stars 4 forks source link

WebUI: Use OPTIONS for policy-templates to determine if the feature is available #46

Closed davidjwbbc closed 2 months ago

davidjwbbc commented 2 months ago

Along with PR 5G-MAG/rt-5gms-application-function#162, this: Fixes #45

This provides a way for the Web management UI to interrogate the AF to see if it may accept createPolicyTemplate operations on the M1 API. The rt-5gms-application-function PR modifies the the Allow header return for the createPolicyTemplate operation path when used with the OPTIONS method to omit the POST value if the AF has not been configured for DynamicPolicies. The web management UI backend server can perform the OPTIONS request, detect the presence or lack of the POST operation and return a true or false value to the client UI to indicate whether the feature is enabled or not.

When a provisioning session is added in the client UI, it submits a request to the backend management server to detect if PolicyTemplates are enabled for that provisioning session (this allows us later to have this enabled or disabled for different ASPs or even individual provisioning sessions - for now it's just an AF wide configuration option). The backend server does the request as detailed above and returns the enabled status of PolicyTemplates. The client web UI, when constructing the provisioning session row for the page, then enables or disables the PolicyTemplates buttons as appropriate. If disabled it also leaves a "Feature not enabled" message to indicate to the user that this feature has not been enabled for this provisioning session.