Overview

The Entities Manager stores per-user, per-game information about the user. This, in combination with inventory service, and keycloak, should be able to store/manage the full user state for any application. 

Specifically:

Keycloak - Account information, username, login, roles
Inventory Service - Anything that can be assigned to a user, ie achievements, items, cards, etc...
Entities Manager - Manages user "entities", which can be summed up to be individual user settings, think things like notification settings, alert settings, controller settings, etc...

This service provides a CRUD interface over http that allows clients to store and retrieve information about themselves on a per-game basis.

Entity Types:

Entity: Read-Write user information

Read-Write entities are entities that can be freely changed by the owning user, and possibly other special accounts like admins, game owners, and service accounts as long as they provide their token however, so the information here should be limited to things like their game settings, and any customizations to their games they wish to make.

Example uses:

  • Host settings such as controller mappings, graphics settings, etc..
  • Player settings such as controller layout, default orientation, notifications, etc...

Entity: Read-Only user information

Read-only entities, As the name implies, are entities that can be retrieved by the user, but cannot be modified by the user. Instead, modifications are limited to admins, game owners, and service accounts. Information that is stored here should be entities that should be read-able to the specific user, but only modifiable by a trusted source. 

Example uses:

  • Host/Player achievements (can also be handled via inventory service)
  • Host/Player metrics (exp, total number of monsters killed, games played, etc...)

Entity: Game information

Game entities, are a special type of Read-Only entity that is not scoped to a specific user. Instead they can be queried, and returned by any user. This is useful for things like setting up dynamic game elements that should only be controlled the the game developers.

Example uses:

  • Global notifications
  • Setting up regular in-game events without re-compiling code
  • Global version tracker and/or force update features

Permissions Matrix

The following table displays what user types have access to which entities

game user_r user_rw
Admin rw rw rw
Service rw rw rw
Owner rw rw rw
User r r rw
  • Admin/Service accounts have unrestricted access to all entities
  • Owner's are limited to entities that they "own", this is determined by their JWT token, specifically the "licenses" claim
  • User's can read any game entity
  • All user entities are private. A user cannot read another user's entity.

Notes

Each entity has a size limit, this limit is determined by the underlying database, but the global instance of entity manager, which is assumed to be the one that is most used, is based on the item size of a DynamoDB table. More specifically, each entity cannot be bigger than 400KB. See https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html#limits-items for more information.