D. Berge
84510e8dc9
Add proper logging
2025-08-13 15:42:49 +02:00
D. Berge
a5ebff077d
Fix authentication middleware erroring on IPv6
2025-08-13 11:50:20 +02:00
D. Berge
c173610e87
Simplify middleware
2025-08-11 22:19:51 +02:00
D. Berge
301e5c0731
Set headers only on 304
2025-08-11 22:06:51 +02:00
D. Berge
48d9f45fe0
Clean up debug messages
2025-08-11 22:06:20 +02:00
D. Berge
c0b52a8245
Be more aggressive about what gets compressed
2025-08-11 12:42:48 +02:00
D. Berge
aabcc74891
Add compression to some endpoints.
...
Consideration will be given to adding (conditional) compression
to all endpoints.
2025-08-11 01:53:50 +02:00
D. Berge
acdf118a67
Add new /vessel/track endpoints.
...
This is a variation on /navdata but returns data more suitable
for plotting vessel tracks on the map.
2025-08-10 21:39:35 +02:00
D. Berge
ae8e5d4ef6
Do not use cookies for backend authentication
2025-08-09 12:43:17 +02:00
D. Berge
07874ffe0b
Filter missing values out of JSON data for binary packing
2025-08-08 12:15:39 +02:00
D. Berge
a15c97078b
Fix typo in access middleware
2025-08-07 10:41:29 +02:00
D. Berge
be5c6f1fa3
Fix user authentication.
...
* Use X-JWT header for sending authentication info
both from server to client and from client to server.
* Send token in body of login response.
* Also use Set-Cookie: JWT=… so that calls that are
not issued directly by Dougal (e.g. Deck.gl layers
with a URL `data` property) work without having to
jump through hoops.
Closes #321
2025-08-06 10:21:37 +02:00
D. Berge
c376896ea6
Also serve preplot source/sail points as binary.
...
This commit adds the ability to pack preplot points in Dougal
binary format. Sail line points take udv=0 and source line points
take udv=1 – udv=2 remains sequence data.
Endpoints for retrieving the data in JSON, GeoJSON and binary
formats have also been added. Data may be retrieved as a single
line or for a whole project.
2025-08-03 11:17:31 +02:00
D. Berge
ad013ea642
Add additional formats for sequence list endpoint.
...
The original and default "Accept: application/json" will return
a sequence summary.
"Accept: application/geo+json" will return a GeoJSON of the
entire project.
"Accept: application/vnd.aaltronav.dougal+octet-stream" will
return the entire project in Dougal's binary format.
2025-08-01 17:07:37 +02:00
D. Berge
4be99370e6
Change the MIME type of binary responses
2025-08-01 16:50:32 +02:00
D. Berge
e464f5f887
Refactor code handling binary sequence requests.
...
Instead of the user giving the recipe for the payload, it now
only handles predefined payload configurations. Those are
denoted by the `type` query parameter. The only valid value
as of this commit is `type=2`.
Look at lib/binary/bundle.js for the definition of a type 2
bundle.
2025-08-01 16:47:50 +02:00
D. Berge
3bb78040b0
Set correct Content-Type
2025-07-28 10:06:21 +02:00
D. Berge
808c9987af
Add binary format middleware for sequence data.
...
It responds to the MIME type:
application/dougal-map-sequence+octet-stream
2025-07-26 19:05:00 +02:00
D. Berge
a58cce8565
Add /version/history endpoint to API.
...
Retrieves Git tag annotations.
2025-07-26 10:58:42 +02:00
D. Berge
5487a3a49b
Catch JWT expiration.
...
Closes #321
2025-07-26 10:56:23 +02:00
D. Berge
0b3711b759
Fix typo
2025-07-25 20:08:08 +02:00
D. Berge
48e1369088
Fix host based authentication
2025-07-25 14:03:43 +02:00
D. Berge
3ea82cb660
Fix reading of credentials for issuing JWT
2025-07-24 23:03:05 +02:00
D. Berge
84c1385f88
Refactor class User (clean up)
2025-07-24 23:02:30 +02:00
D. Berge
e47020a21e
Add /user endpoints to API
2025-07-24 19:23:43 +02:00
D. Berge
b8f58ac67c
Add FIXME
2025-07-24 19:20:58 +02:00
D. Berge
b3e27ed1b9
Refactor auth.authentify.
...
We now get the user's details directly from the JWT token.
2025-07-24 19:15:36 +02:00
D. Berge
f5441d186f
Refactor auth.access middleware.
...
It users @dougal/user and @dougal/organisations classes.
2025-07-24 19:14:19 +02:00
D. Berge
01d1691def
Fix login endpoint (checkValidCredentials is now async)
2025-07-24 19:09:39 +02:00
D. Berge
2657c42dcc
Fix export statement
2025-07-13 11:13:31 +02:00
D. Berge
d6fb7404b1
Adapt version.get middleware to new permissions approach
2025-07-13 00:07:52 +02:00
D. Berge
8188766a81
Refactor access to info table.
...
To adapt to new permissions system.
2025-07-13 00:07:05 +02:00
D. Berge
b7ae657137
Add auth.operations middleware.
...
Adds an array of allowed operations on given context to the request
under `req.user.operations`.
2025-07-13 00:02:48 +02:00
D. Berge
7c6d3fe5ee
Check permissions against vessel if not on a project endpoint
2025-07-12 16:49:10 +02:00
D. Berge
55855d66e9
Remove dead code
2025-07-12 12:14:12 +02:00
D. Berge
ca4a14ffd9
Use new orgs based method for authorisation
2025-07-11 22:48:44 +02:00
D. Berge
6b6f545b9f
Filter list of projects to only those readable by user
2025-07-11 22:47:32 +02:00
D. Berge
addbe2d572
Refactor user authentication code to use database
2025-07-11 22:46:47 +02:00
D. Berge
712b20c596
Add API endpoint to retrieve line name properties.
...
This will be needed by the configuration GUI.
2025-07-09 16:38:41 +02:00
D. Berge
af0df23cc4
Add diagnostics API endpoint.
...
Only available with write access and above.
Reports used and available filesystem sizes and database space
usage.
2024-05-08 16:27:32 +02:00
D. Berge
efe64f0a8c
Implement PUT method for project configuration endpoint.
...
In short:
POST creates a new project
PUT overwrites a project configuration with a new one
PATCH merges the request body with the existing configuration
2024-05-01 10:40:04 +02:00
D. Berge
d2f94dbb88
Refactor JWT token verification
2024-05-01 10:05:48 +02:00
D. Berge
1056122fff
Fix missing parenthesis
2024-04-28 18:37:30 +02:00
D. Berge
9bd0aca18f
Add debugging statements to ETag middleware
2023-11-04 10:45:50 +01:00
D. Berge
60932300c1
Ensure that project is defined.
...
Which would not be in the case of the `project` event unless we
look at the `new` and `old` properties.
2023-11-04 10:45:50 +01:00
D. Berge
12307b7ae6
Refactor ETag watcher to use path-to-regexp.
...
Simplifies the code and makes it easier to look at.
2023-11-04 10:45:50 +01:00
D. Berge
7076b51a25
Add auth.access.role(roles) higher order middleware
2023-11-03 21:22:02 +01:00
D. Berge
4a18cb8a81
Remove useless code
2023-11-02 23:51:05 +01:00
D. Berge
c615727acf
Don't require authentication for the /version endpoint.
...
It will still hide the `db` and `os` values from non-admins though.
2023-11-02 23:48:46 +01:00
D. Berge
620d5ccf47
Add /version API endpoint
2023-11-02 19:48:30 +01:00