anbaric-cloud-hosting 1.6.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import {SecretStore} from "anbaric-tsapi";
1
+ import {SecretStore, SystemActor} from "anbaric-tsapi";
2
2
  import {Request} from "../Request";
3
3
  import {RequestHandler} from "../RequestHandler";
4
4
 
@@ -17,13 +17,13 @@ class SecretsHandler implements RequestHandler {
17
17
  case "PUT": {
18
18
  const { value } = await request.body();
19
19
  if (typeof value !== "string") return request.reply(400, { error: "Expected a body of { value : string }" });
20
- await this.secretStore.save(name, value);
20
+ await this.secretStore.create(SystemActor.actor, name, value);
21
21
  return request.reply(204);
22
22
  }
23
23
  case "GET":
24
- return request.reply(200, { value: await this.secretStore.retrieve(name) });
24
+ return request.reply(200, { value: await this.secretStore.retrieve(name, SystemActor.actor) });
25
25
  case "DELETE":
26
- await this.secretStore.delete(name);
26
+ await this.secretStore.delete(name, SystemActor.actor);
27
27
  return request.reply(204);
28
28
  }
29
29
  request.notFound();
@@ -32,7 +32,7 @@ class SecretsHandler implements RequestHandler {
32
32
  private async handleCollection(request : Request) : Promise<void> {
33
33
  switch (request.method) {
34
34
  case "GET":
35
- return request.reply(200, await this.secretStore.list());
35
+ return request.reply(200, await this.secretStore.list(SystemActor.actor));
36
36
  }
37
37
  request.notFound();
38
38
  }