Skip to content

Commit

Permalink
update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
trungnotchung committed Dec 19, 2024
1 parent 52fa68f commit 5055de9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/blueprints/src/AccessControl/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type ACL,
ActionType,
type DRP,
type IACL,
type ResolveConflictsType,
SemanticsType,
type Vertex,
Expand All @@ -12,7 +12,7 @@ export enum AccessControlConflictResolution {
RevokeWins = 1,
}

export class AccessControl implements ACL, DRP {
export class ACL implements IACL, DRP {
operations: string[] = ["grant", "revoke"];
semanticsType = SemanticsType.pair;
peerKeyStore = new Map<string, string>();
Expand Down
8 changes: 4 additions & 4 deletions packages/blueprints/src/AddWinsSetWithACL/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import {
type ACL,
ActionType,
type DRP,
type IACL,
type ResolveConflictsType,
SemanticsType,
type Vertex,
} from "@ts-drp/object";
import { AccessControl } from "../AccessControl/index.js";
import { ACL } from "../AccessControl/index.js";

export class AddWinsSetWithACL<T> implements DRP {
operations: string[] = ["add", "remove"];
state: Map<T, boolean>;
acl?: ACL & DRP;
acl?: IACL & DRP;
semanticsType = SemanticsType.pair;

constructor(admins?: Map<string, string>) {
if (admins) {
this.acl = new AccessControl(admins);
this.acl = new ACL(admins);
}
this.state = new Map<T, boolean>();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/object/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ObjectSet } from "./utils/objectSet.js";
export * as ObjectPb from "./proto/drp/object/v1/object_pb.js";
export * from "./hashgraph/index.js";

export interface ACL {
export interface IACL {
isWriter: (peerId: string) => boolean;
isAdmin: (peerId: string) => boolean;
grant: (peerId: string, publicKey: string) => void;
Expand All @@ -26,7 +26,7 @@ export interface DRP {
operations: string[];
semanticsType: SemanticsType;
resolveConflicts: (vertices: Vertex[]) => ResolveConflictsType;
acl?: ACL & DRP;
acl?: IACL & DRP;
// biome-ignore lint: attributes can be anything
[key: string]: any;
}
Expand Down

0 comments on commit 5055de9

Please sign in to comment.