@frockbot/plugin-credentials 0.3.1 → 0.3.3

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.
Files changed (2) hide show
  1. package/package.json +3 -2
  2. package/src/user.ts +24 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frockbot/plugin-credentials",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -18,7 +18,8 @@
18
18
  "typecheck": "tsc --noEmit -p tsconfig.json"
19
19
  },
20
20
  "dependencies": {
21
- "@frockbot/connection-core": "0.3.1",
21
+ "@frockbot/connection-core": "0.3.3",
22
+ "@frockbot/kernel-contracts": "0.3.3",
22
23
  "cordis": "4.0.0-rc.8"
23
24
  },
24
25
  "devDependencies": {
package/src/user.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  sealCredentialV1,
9
9
  } from "@frockbot/connection-core";
10
10
  import type { Plugin } from "cordis";
11
+ import { defineUserBackendContribution } from "@frockbot/kernel-contracts/contributions";
11
12
  export {
12
13
  createCredentialRuntimePlugin,
13
14
  CredentialLeaseRuntime,
@@ -1140,3 +1141,26 @@ export function createCredentialUserBackendPlugin(
1140
1141
  ): Plugin {
1141
1142
  return () => lifecycle.mount(createCredentialUserBackendContribution(host));
1142
1143
  }
1144
+
1145
+ /**
1146
+ * What an application hands this Contribution: the User's encrypted credential store, under the
1147
+ * Package's own key so one wide host object can satisfy every Package's slice
1148
+ * without their fields colliding.
1149
+ */
1150
+ export interface CredentialsUserApplicationHostV1 {
1151
+ credentials: CredentialUserBackendHost;
1152
+ }
1153
+
1154
+ /**
1155
+ * The manifest's `user` entry, resolved by specifier. The
1156
+ * application looks this descriptor up in its Contribution table; it never
1157
+ * branches on which Package it belongs to.
1158
+ */
1159
+ export const userContribution = defineUserBackendContribution<
1160
+ CredentialsUserApplicationHostV1,
1161
+ CredentialUserBackendContribution
1162
+ >({
1163
+ specifier: "@frockbot/plugin-credentials/user",
1164
+ create: (host, lifecycle) =>
1165
+ createCredentialUserBackendPlugin(host.credentials, lifecycle),
1166
+ });