-
Notifications
You must be signed in to change notification settings - Fork 11
Fuel Rats API PostgreSQL and TLS transition
To improve performance, reliability, and my sanity, the decission has been made to transition the API completely from MongoDB to PostgresSQL. Since this is a move from a document based to a relations based database system, things work quite differently.
However backwards compatibility measures have been put in place to ensure that things (mostly) stay the same.
There are some changes however, to improve useability, consistency, and security. I will detail them here:
The long awaited permissions and authentication system has finally been implemented, applications will have to use OAuth2 authentication to perform any write-actions or read user information. The details of these are available on the API documentation.
For those who have already implemented OAuth in advance, a small change has been made: the username of the OAuth Client is now the id field, not the name field. name is now used purely to display your application's identity to the user, and accepts any UTF8 string.
OAuth negotiation has to be performed on HTTP, but websocket now lets you authenticate with the OAuth bearing token using the new authorization action.
Example.
{ action: 'authorization', bearer: '23b225nmn195n25z' }
.
The following changes has been made to the /rats/ endpoint and model.
- The _id field has been replaced with id
- The nicnames field has been moved to the User model
- The drilled field has been moved to the User model
- The data field is now stored as binary JSON, this means it enforces that the data inserted is valid JSON, as before it accepted any value.
- The lastModified field has been renamed to updatedAt.
- The archived field has been removed, this was used in the transition from the old paperwork and is no longer necessary.
- The gamertag field has been removed, the rat name is now stored in CMDRname regardless of platform (Why was this a thing, Trezy?).
- The rescues array and all the rescues related fields has been removed, this was only a thing because MongoDB could not do joins.
The following changes has been made to the /rescues/ endpoint and model.
- The _id field has been replaced with id
- The data field is now stored as binary JSON, this means it enforces that the data inserted is valid JSON, as before it accepted any value.
- The lastModified field has been renamed to updatedAt.
- The archived field has been removed, this was used in the transition from the old paperwork and is no longer necessary.
## Users. The following changes has been made to the /users/ endpoint and model.
- The _id field has been replaced with id
- The nicknames field has been added and is a string array.
- The drilled field has been added and is a boolean.
- The drilledDispatch field has been added and is a boolean.
- The createdAt field has been added and is an ISO8601 string.
- The updatedAt field has been added and is an ISO8601 string.
The following changes has been made to the /clients/ endpoint and model.
- The _id field has been replaced with id
- The name field now accepts any UTF8 value up to 256 characters.
- The createdAt field has been added and is an ISO8601 string.
- The updatedAt field has been added and is an ISO8601 string.