@evomap/evolver-adapter-public 2.0.23 → 2.0.25

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 { linkSync } from 'node:fs';
1
+ import { linkSync, renameSync } from 'node:fs';
2
2
  import type { hub } from '@evomap/evolver-core';
3
3
  export interface CredentialStoreOptions {
4
4
  /**
@@ -15,6 +15,8 @@ export interface CredentialStoreOptions {
15
15
  windowsParentStateReader?: (path: string) => readonly PathSecurityState[];
16
16
  /** Injectable filesystem primitive for deterministic no-clobber publication tests. */
17
17
  linkFile?: typeof linkSync;
18
+ /** Injectable filesystem primitive for deterministic atomic replacement tests. */
19
+ renameFile?: typeof renameSync;
18
20
  }
19
21
  export interface WindowsCredentialAclOps {
20
22
  assertTrustedParent(path: string, strictCreate: boolean): void;
@@ -44,6 +46,7 @@ export declare class CredentialStore {
44
46
  private readonly darwinAclReader;
45
47
  private readonly windowsParentStateReader;
46
48
  private readonly linkFile;
49
+ private readonly renameFile;
47
50
  private securedDirectoryState;
48
51
  private securedCredentialState;
49
52
  private readonly securedAncestorStates;
@@ -19,6 +19,7 @@ export class CredentialStore {
19
19
  darwinAclReader;
20
20
  windowsParentStateReader;
21
21
  linkFile;
22
+ renameFile;
22
23
  // ctime detects in-place ACL drift while dev/ino detects entry replacement.
23
24
  securedDirectoryState = null;
24
25
  securedCredentialState = null;
@@ -33,6 +34,7 @@ export class CredentialStore {
33
34
  this.darwinAclReader = options.darwinAclReader ?? readDarwinAcl;
34
35
  this.windowsParentStateReader = options.windowsParentStateReader ?? parentSecurityStates;
35
36
  this.linkFile = options.linkFile ?? linkSync;
37
+ this.renameFile = options.renameFile ?? renameSync;
36
38
  }
37
39
  load() {
38
40
  if (!this.prepareDirectory(false))
@@ -153,7 +155,7 @@ export class CredentialStore {
153
155
  this.assertDirectoryIdentity(directory, directoryIdentity);
154
156
  if (replaceExisting) {
155
157
  this.assertSafeDestination();
156
- renameSync(temporaryPath, this.path);
158
+ this.renameFile(temporaryPath, this.path);
157
159
  }
158
160
  else if (!this.publishIfAbsent(temporaryPath)) {
159
161
  const incumbentFd = this.openCredentialFile();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evomap/evolver-adapter-public",
3
- "version": "2.0.23",
3
+ "version": "2.0.25",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@evomap/atp-sdk": "^0.1.0",
20
- "@evomap/evolver-core": "2.0.23",
20
+ "@evomap/evolver-core": "2.0.25",
21
21
  "undici": "^6.27.0"
22
22
  },
23
23
  "optionalDependencies": {