feat: migrate project secrets and user-scoped colors
This commit is contained in:
1 parent
dcfdb3d7af
commit
0e450d53de
9 files changed
+263
-7
No files matched your search
@@ -44,7 +44,7 @@ coreConfig.onUpdate((info) => authClient.setBaseUrl(info.authGuardUrl));
|
||||
|
||||
// in your own route for PUT /api/core-services/internal:
|
||||
app.put('/api/core-services/internal', (req, res) => {
|
||||
if (req.get('X-Internal-Auth') !== process.env.INTERNAL_SERVICE_SECRET) {
|
||||
if (req.get('X-Internal-Auth') !== process.env.SECRET) {
|
||||
return res.status(401).json({ error: 'internal service authentication required' });
|
||||
}
|
||||
const info = coreConfig.set(req.body);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* Framework-agnostic: this module has no HTTP server of its own. A service
|
||||
* wires the actual `PUT /api/core-services/internal` route in its own
|
||||
* framework (Express, plain `http`, ...), gated behind its own
|
||||
* INTERNAL_SERVICE_SECRET check the same way its other internal-service
|
||||
* SECRET check the same way its other internal-service
|
||||
* routes already are, decodes the JSON body with `Info.fromJSON`, and calls
|
||||
* `store.set(info)` - see `Store.set`'s doc comment for a minimal Express
|
||||
* example.
|
||||
@@ -118,7 +118,7 @@ export class Store {
|
||||
* the other value. Returns the resulting Info. Minimal Express usage:
|
||||
*
|
||||
* app.put('/api/core-services/internal', (req, res) => {
|
||||
* if (req.get('X-Internal-Auth') !== process.env.INTERNAL_SERVICE_SECRET) {
|
||||
* if (req.get('X-Internal-Auth') !== process.env.SECRET) {
|
||||
* return res.status(401).json({ error: 'internal service authentication required' });
|
||||
* }
|
||||
* const info = coreConfigStore.set(Info.fromJSON(req.body));
|
||||
|
||||
Reference in new issue
Block a user