Skip to content

File API #170

@McCrea

Description

@McCrea

APIPermissions, I don't like it.
These days it does more than just permissions and that isn't really right.

I propose it be split into three APIs:

  • User API
  • Files API
  • Permissions API

They might use some common PAL components for actual storage, but the methods for reading/writing should probably be separated out properly.
This would also be a good opportunity to enhance how we use the NDB datastore in the GAE PAL; I propose the following:

  • Use keys-only queries - I've already changed PALPermissions to use these where possible. With some re-design it may be possible to replace more queries with keys-only operations. They're free (or cheaper) and faster as they only involve an index lookup, so it's worth using them where possible.
  • Use ancestors for files - we currently store a parent key for files, we should do this properly and then make use of the ancestor queries where useful - this can allow us to guarantee no stale results in certain circumstances
  • Investigate transactions - At the API layer, some operations may involve multiple read/write ops, these should be grouped into transactions if possible.

I think it would be prudent to start with the files API in order to facilitate the development of efficient hierarchical gate display. I believe there's already a branch created by @ahemagain for the users API, so that just leaves the permissions API. Once the APIs are done, we'll need to build another utility layer on top of the APIs which link them together for things which require interaction with multiple APIs (such as getting all the files a user has permission to see).
Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions