You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The contents of the LDP covers much more than just LDP behaviour: it contains the request parsers, response writers, and many other things also re-used by non-LDP components. I would suggest renaming the folder to core instead. Completely changing the folder structures so it makes more sense is also an option, but I don't think that would create much added value.
Due to this potentially having a drastic impact on other PRs/features, the best time to do this would be right before we do a new release, so we don't have a dangling versions branch somewhere with different folder names.
The 2 examples I gave are actually in the http folder, which is in the ldp folder, but it also contains auxiliary, operations, permissions, representation, and the LDP & websocket handlers.
The suggestion to rename was made because it is the easiest.
We could indeed move some folders out of the ldp folder, but I was afraid that drastically changing the folder structure might be more confusing for people who might have already looked a bit at the code. operations and representation also get used in the IDP, so several folders would have to move.
Fair enough, might not be a bad idea to go over everything that is in the project and determine its best place now that we actually have components compared to when this started out.
Seeing as the last major PRs for 2.0.0 have been made, I had a look at this. Below is the current state of our folder structure with comments indicating the contents of those folders, followed by my suggestion of how to restructure. This is quite long, it helps to have 2 windows with both of them next to eachother.
Current:
authentication -> credentials
authorization -> permission readers/authorizers
access-checkers -> used by Acl reader
metadata -> used to add necessary metadata for WAC-Allow header
identity -> IDP
configuration -> OIDC config
interaction -> general handlers
email-password -> contains EmailPasswordUtil
handler -> email/password behaviour handlers (login, registration, etc.)
storage -> account storage
routing -> links template/handler behaviour
util -> emails + oidc interaction completer
ownership -> check WebID ownership (e.g. token)
storage -> used by OIDC library for internal session/token storage
init -> initializers
final -> finalizers
setup -> setup handler
ldp -> contains LDP handler + WebSocket protocol
auxiliary -> everything related to aux resources
http -> request/url/body/preference parser, errorhandler, responsewriter, patch
conditions -> parse conditions
metadata -> header <-> metadata parsing
response -> ReponseDescriptions (response writer inputs)
operations -> operation handlers (GET/PUT/POST/etc.)
permissions -> permissions + extractors (method -> required permissions)
representation -> Representation/Identifier/Metadata/Preferences interfaces
logging -> loggers
pods -> pod managers
generate -> everything else for generating pods (identifiers, resources, util, etc.)
variables -> used for dynamic pods
settings -> PodSettings interface: input required for generating pods
server -> base HTTP interfaces + server factories
middleware -> cors/static/etc.
util -> RouterHandler + RedirectAllHttphandler
storage -> all resource stores + conditions
accessors -> data accessors
conversion -> all converters
keyvalue -> all internal key/value storages
mapping -> file system <-> identifier mappers
patch -> patchers
routing -> rules for routing store
util -> all utility files
errors -> HTTP errors
handlers -> AsyncHandler + generic handlers
identifiers -> identifier strategies
locking -> resource lockers
templates -> template engines
Suggested change (changes are marked with *, I didn't write down the subfolders where nothing changed):
authentication
authorization
access-checkers
metadata
*permissions -> copy of ldp/permissions
*http -> currently this folder would only contain other folders
*auxiliary -> copy of ldp/auxiliary
*input -> request parsers from ldp/http
*body -> body parsers from ldp/http
*conditions -> copy of ldp/http/conditions
*metadata -> metadata readers from ldp/http/metadata
*identifier (or target?) -> target extractors from ldp/http
*preferences -> preference parsers from ldp/http
*operations -> copy of ldp/http/operations
*output -> response writers from ldp/http
*error -> error handlers from ldp/http
*metadata -> metadata writers from ldp/http/metadata
*response -> copy of ldp/http/response
*representation -> copy of ldp/representation + Patch/SparqlUpdatePatch interfaces (from ldp/http)
identity -> main idea is to not separate the email/password related parts from the rest
configuration
interaction -> contents from interaction/email-password
ownership
*routing -> from interaction/routing
*storage -> would move account storage here as well
*util -> from interaction/util
init
logging
pods
server
storage
util
Some considerations:
Does it make sense to have representation in the http folder?
If yes, perhaps move http/representation contents to http directly since it has no files
@joachimvh Happy with the above, with the exception of LDP-specific stuff.
The LDP interface is one subsystem; there might be others at a later point. Things like operations are definitely LDP-specific, and there are some others too.
Perhaps just an ldp folder under http might make sense.
Does it make sense to have representation in the http folder?
Yes for me.
If yes, perhaps move http/representation contents to http directly since it has no files
@joachimvh Happy with the above, with the exception of LDP-specific stuff. The LDP interface is one subsystem; there might be others at a later point. Things like operations are definitely LDP-specific, and there are some others too.
The operation object itself gets used everywhere though since it's the output of the RequestParser (which also gets used by the IDP and Setup handlers). The operation handlers themselves are only used by the LDP component (for now at least). Could have the Operation object in the http folder, and an http/ldp folder that contains the operation handlers.
Note to self: should probably do some changes to the identity folders to take into account that email/password might still need a separate folder so we can be login-method independent.
Activity
RubenVerborgh commentedon Aug 18, 2021
http?jvherweg commentedon Aug 18, 2021
The 2 examples I gave are actually in the
httpfolder, which is in theldpfolder, but it also containsauxiliary,operations,permissions,representation, and the LDP & websocket handlers.RubenVerborgh commentedon Aug 18, 2021
So maybe move http out of ldp?
jvherweg commentedon Aug 18, 2021
The suggestion to rename was made because it is the easiest.
We could indeed move some folders out of the
ldpfolder, but I was afraid that drastically changing the folder structure might be more confusing for people who might have already looked a bit at the code.operationsandrepresentationalso get used in the IDP, so several folders would have to move.RubenVerborgh commentedon Aug 18, 2021
No strong opinion; I just find
coreto be vague.Another naming scheme could be inspired by the spec names.
Let's perhaps spend some time on a good design; and the good news is it doesn't ripple through because of our index export.
jvherweg commentedon Aug 18, 2021
Fair enough, might not be a bad idea to go over everything that is in the project and determine its best place now that we actually have components compared to when this started out.
[-]Rename ldp folder to core[/-][+]Update project folder structure[/+]jvherweg commentedon Sep 8, 2021
#932 (review)
jvherweg commentedon Sep 23, 2021
Seeing as the last major PRs for 2.0.0 have been made, I had a look at this. Below is the current state of our folder structure with comments indicating the contents of those folders, followed by my suggestion of how to restructure. This is quite long, it helps to have 2 windows with both of them next to eachother.
Current:
Suggested change (changes are marked with
*, I didn't write down the subfolders where nothing changed):Some considerations:
representationin thehttpfolder?http/representationcontents tohttpdirectly since it has no filesstorage/representation?http/input/identifierorhttp/input/target?RubenVerborgh commentedon Oct 2, 2021
@joachimvh Happy with the above, with the exception of LDP-specific stuff.
The LDP interface is one subsystem; there might be others at a later point. Things like
operationsare definitely LDP-specific, and there are some others too.Perhaps just an
ldpfolder underhttpmight make sense.Yes for me.
I don't think that's necessary.
identifierfor me.jvherweg commentedon Oct 4, 2021
The operation object itself gets used everywhere though since it's the output of the
RequestParser(which also gets used by the IDP and Setup handlers). The operation handlers themselves are only used by the LDP component (for now at least). Could have theOperationobject in thehttpfolder, and anhttp/ldpfolder that contains the operation handlers.RubenVerborgh commentedon Oct 4, 2021
Perfect; agreed.
jvherweg commentedon Oct 7, 2021
Note to self: should probably do some changes to the identity folders to take into account that email/password might still need a separate folder so we can be login-method independent.
jvherweg commentedon Oct 12, 2021
Done in #976