Code Monkey home page Code Monkey logo

api's Issues

Create command to revoke tokens

Different options should be implemented:

  • Revoke all tokens.
  • Revoke all tokens of a specific user or group.
  • Revoke all tokens created before/after a specific date.
  • Revoke all tokens with no expire date.
  • Revoke all tokens with an expire date.

Revoking tokens must include:

  • Marking the token as revoked.
    • Todo: How? Setting token.isRevoked to true? Or token.status to revoked?
      • State ACTIVE: Token works normally.
      • State REVOKED: Token is manually deactivated but not deleted.
      • State EXPIRED: Currently unused state for tokens which are expired.
  • Revoked tokens must be removed from Redis.

Feature tests:

  • Iterate over all options.
    • Check that existing tokens work.
    • Check that those tokens can be revoked.
    • Check that revoked tokens no longer work.

Example generation:

  • One case should be automatically generated.

Documentation:

  • Command should be documented.

Related work:

  • When tokens are initially put into Redis, their lifetime should be limited to min( (now + 30min) , tokenValidUntilTimestamp ).

Basic search operation via Elasticsearch

Todos:

  • Optimize search queries for performance while still keeping security in mind.
    Likely involves serializing groups and users with search access into the Elastic Search documents, which will need to be kept in sync.
    • Normalize groups and users.
    • Always check for access while executing search queries.
    • Synchronize changed access to other Elastic Search documents automatically. Likely via RabbitMQ Queue?

HTTP DELETE /<uuid> - DeleteElementController

  • Orphaned children should be automatically reconnected with the deleted element's parents.
  • Other relations, e.g. HAS_READ_ACCESS, should not be automatically reconnected, as this could lead to edge cases. This point might be revisited in the future.

Backup commands

Todos:

  • Command for listing backups.
  • Command for creating backups.
  • Command for loading backups.
  • Command for purging the existing databases.
  • Add API version to backup, so that incompatibility to future versions can be handled gracefully.
  • Add backup explorer tool?

Docker image

Todos:

  • Building Docker images automatically on release.
  • Publishing Docker images automatically to Docker Hub on release.

Env variable rework

Todos:

  • Rework existing env variables.
  • Use Dockerfile env variables as much as possible.
  • Create new env variables for currently hardcoded elements like the Neo4j, MongoDB and Elastic Search auth values.

HTTP GET /token - GetTokenController

Should GET /token return all tokens as a paginated response, or just the currently used token? If the later, under which endpoint should the other feature be available?

  • Implement endpoint.
  • Add feature tests.
  • Document feature.

Question: What should be returned in the case of an id conflict?

When the user tries to create an element with a user specified UUID, which already exists in the database, then the request must fail.

However this failing requests returns metadata in the form of "there exists another element with the same UUID, even if I have no access to it".

This shouldn't be a problem when completely random UUIDs are used, however if the user uses incrementing UUIDs - which in itself is a bad design choice - then meta data leaks might happen.

The question now is, if there is a better alternative.

Returned token elements should never contain the hash or token

When token data elements are returned, they should never contain their hash (internal use only) and plain text tokens (only manually added in the reference dataset to enhance user onboarding).

  • Add feature test to automatically detect if problematic fields are returned.
  • Disable fields from output in controller.
  • Check if other data types / fields should be included too.
    • Should this be user configurable? Part of a future schema process?

Documentation

Todos:

  • Add API request and response examples.
  • Add automated (?) API documentation, e.g. with Swagger?

CI/CD improvements

  • composer test:unit
  • composer test:mutant
  • composer test:leak
  • composer cs:list
  • composer psalm
  • composer phpstan
  • composer yml:lint
  • composer markdown:lint
  • Upstream update checker for Alpine Linux
  • composer outdated
  • composer test:feature
    • with different Neo4j versions etc.
    • export final database backup?
  • when docker image is built, add it to the release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.