Skip to content

Update project folder structure #920

Closed

Description

@jvherweg

See #898 (comment)

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.

Activity

  1. added this to the v1.1.0 milestone on Aug 18, 2021
  2. RubenVerborgh commented on Aug 18, 2021

    @RubenVerborgh
    Member

    http?

  3. jvherweg commented on Aug 18, 2021

    @jvherweg
    MemberAuthor

    http?

    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.

  4. RubenVerborgh commented on Aug 18, 2021

    @RubenVerborgh
    Member

    So maybe move http out of ldp?

  5. jvherweg commented on Aug 18, 2021

    @jvherweg
    MemberAuthor

    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.

  6. RubenVerborgh commented on Aug 18, 2021

    @RubenVerborgh
    Member

    No strong opinion; I just find core to be vague.

    Another naming scheme could be inspired by the spec names.

    Completely changing the folder structures so it makes more sense is also an option

    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.

  7. jvherweg commented on Aug 18, 2021

    @jvherweg
    MemberAuthor

    Let's perhaps spend some time on a good design;

    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.

  8. changed the title [-]Rename ldp folder to core[/-] [+]Update project folder structure[/+] on Aug 18, 2021
  9. jvherweg commented on Sep 8, 2021

    @jvherweg
    MemberAuthor

    #932 (review)

    Given the new BaseHttpHandler, we might want to move some stuff out of ldp into server (and perhaps name it http).

  10. jvherweg commented on Sep 23, 2021

    @jvherweg
    MemberAuthor

    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
    • If no, perhaps move to storage/representation?
    • http/input/identifier or http/input/target?
  11. RubenVerborgh commented on Oct 2, 2021

    @RubenVerborgh
    Member

    @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

    I don't think that's necessary.

    • http/input/identifier or http/input/target?

    identifier for me.

  12. jvherweg commented on Oct 4, 2021

    @jvherweg
    MemberAuthor

    @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.

  13. RubenVerborgh commented on Oct 4, 2021

    @RubenVerborgh
    Member

    Perfect; agreed.

  14. jvherweg commented on Oct 7, 2021

    @jvherweg
    MemberAuthor

    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.

  15. linked a pull request that will close this issuerefactor: Restructure source code folder #976on Oct 8, 2021
  16. jvherweg commented on Oct 12, 2021

    @jvherweg
    MemberAuthor

    Done in #976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions