[WIP] Add commit metadata from User-Agent #115
Closed
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.
This is a work-in-progress PR demonstrating the direction in which I'd like to fix #113.
To represent the attributes of the requester, an Author class (name may not fit perfectly, but it aligns with what the variable is called all around so far) is introduced. This will (in later authenticated cases) contain the user identifier, but primarily now contains the User-Agent. Unless xandikos does authentication itself, it won't contain authentication information.
To support Xanthikos' modular approach, interaction with it is centered around named access functions; for the (currently only supported?) case of a WebDav front-end on a Git back-end, an Author can be created
from_request
(extracting the User-Agent, and in future things like the user name / OpenID / certificate details). Back-ends would use dedicated formaters to place the information in whatever they take for storage. For git, both trailers and commit author information can be populated; additional fields may make sense later (eg. extracting the author time stamp's time zone into the change timestamp, if that's sent by user agents).Plan for the development of this PR is to (hereby) ask for preliminary review of the approach taken (primarily the presence and use of the Author class), and to add author argument passing-along where the chain of author=author arguments is incomplete yet.