-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Server
, ETag
, Last-Modified
and Cache-Control
headers on
#37
Comments
Is the intention here to support these response headers for both HTTP/1.1 and HTTP/2, @davidjwbbc? (That's not clear from the above specification yet.) |
Thinking about the
If this seems like a reasonable idea I might propose a small change to this clause along those lines in the forthcoming SA4#122 meeting. Reading section 10.2.4 of RFC 9110 I see that there can be an arbitrary number of product identifiers in the header value, separated by whitespace. It seems more appropriate for us to create a vendor-specific product identifier to convey our release number. For example:
|
Also (and of potential interest to @irajs) I notice there is nothing to specify what the 5GMSu AF should use as a |
You can also add comments, so it's valid for us to include the software name and version as a comment to the server id, e.g.:
Alternatively it could be useful to use the comment to list the protocol version numbers implemented, e.g.:
|
Yes, the headers belong on the response no matter which version of the HTTP protocol is being used. Although the field names will get converted to lowercase in the HTTP/2 protocol so will be The SBI library abstracts the protocol version away from the response structure, so when we build a response we don't care whether it's HTTP/1.1 or HTTP/2. For now the 5GMS AF only does HTTP/1.1 until we implement issue #12. |
I have updated the specification of the In particular, I have simplified the specification of the comment part to indicate only the OpenAPI version number for the endpoint that has been invoked. (I think it's not good practice to expose details of M5 at M1 and vice versa.) Ideally, this value can be derived by inspecting the code that OpenAPI Generator has autogenerated from the OpenAPI YAML file. (The API version number appears as |
To explain my rationale here a bit: I think the API version number is more critical than the specification version number. It's finer grained, and also the key information a client needs to understand for compatibility. |
To expose more information about what APIs the reference implementation of the 5GMS AF currently supports, and which subset of methods each API currently implements, I have created a new issue #38 to implement the |
I have raised 5G-MAG/Standards#50 to propose an amendment to TS 26.512 clause 6.2.3.3.1 regarding the |
For |
I assume you mean set these environment variables in the main function of the Application Function (as opposed to setting them on the command line), @davidjwbbc? Is there a reason you recommend Also, is there a particular reason to use the |
They need to be set at some time before
Yes, because using
As you can see, if the timezone is
Because the names in the RFC were in English, but the |
Implemented custom The M1 and M5 responses mentioned above need to be created with this function instead of the default As a next step, will be replacing the default response creation function with the custom one. The
|
Regarding the environment variables for date-time formatting, the following should be placed near the top of the ogs_env_set("TZ", "GMT");
ogs_env_set("LC_TIME", "C"); (Note that |
Next, I am going to implement the M5 - Sample output below.
|
The correct format for the
|
Implemented the custom header for
In this output |
Weird. Maybe you're using the API in a way that is different from envisaged, @devbbc? |
Yes, @devbbc had added the "max-age=" bit to the header name instead of the value. I've pointed out where in the code this is wrong in a separate email. |
Set the
The next step is to add custom headers for Server Certificate operations mentioned above. |
Specification
Server
headerAll 5GMS Application Function responses (including error responses) must have a
Server
header (section 10.2.4 of RFC 9110) which conforms to the format5GMSdAF-{FQDN}/{implementationSpecificSuffix}
(see TS 26.512 clause 6.2.3.3.1) where:{FQDN}
is the fully qualified domain name of the Application Function host.{implementationSpecificSuffix}
shall identify at least the 3GPP release number (e.g. 17), and preferably the version number of TS 26.512 that the Application Function is implementing (e.g. 17.3.0).meson.build
file.A comment shall be appended to the primary product string indicating the YAML OpenAPI specification API name and version number with which the API complies (e.g.
info.title=M1_ContentHostingProvisioning;info.version=2.1.1
). This string shall be derived from theinfo.title
andinfo.version
properties of the relevant YAML OpenAPI definition, preferably by introspecting the code generated by OpenAPI Generator. Note that the value may be different for each API in a given version of TS 26.512.In addition, the reference implementation shall provide a vendor-specific subproduct string indicating the name
rt-5gms-application-function
followed by an oblique character followed by the release number of the Application Function (e.g.1.1.0
). The latter shall be populated from a macro set in the top-levelmeson.build
file.Complete example:
Server: 5GMSdAF-msaf1.mno.net/17.3.0 (info.title=M1_ContentHostingProvisioning;info.version=2.1.1) rt-5gms-application-function/1.1.0
Entity headers
Additionally all 2XX server responses that contain body data must also have
ETag
,Last-Modified
andCache-Control
headers (see TS 26.512 clause 6.2.3.4).These extra headers shall appear on both M1 and M5 interfaces.
Scope of applicability
This currently means the following API operations will contain the extra
ETag
,Last-Modified
andCache-Control
headers:Etag
headerWhere possible, the
ETag
shall be a SHA256 hash of the underlying entity served by the Application Function, encoded as a hexadecimal string.Last-Modified
headerThe
Last-Modified
date-time shall be output in IMF format ("Day, dd Mon YYYY HH:MM:SS GMT") as defined in RFC 7231. This will be the date-time of when the last create or update operation was received that created or modified the object being returned.Cache-Control
headerThe
Cache-Control
header shall indicate amax-age
based on defaults that can be changed in the application YAML configuration file. The defaultmax-age
shall be 60 seconds, except for M1 Content Protocols responses which shall use a default of 86400 seconds (because the information in the response is static for a given 5GMS AF build).max-age
for M1 Provisioning Sessions, M1 Content Hosting Configurations, M1 Content Protocols and M5 Service Access Information, which take preference over the defaultmax-age
for those responses.Cache-Control
header for M1 Server Certificates is provided by the external certificate management process.The text was updated successfully, but these errors were encountered: