-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This implements the first draft of types as specified by the backend implementations: - urbit/urbit#6493 - master...tinnus-napbus:landscape:tinnus/userspace-permissions Based on out-of-band conversation with @tinnus-napbus, there is possibly some changes coming to this interface. (to be addressed in a follow up commit).
- Loading branch information
1 parent
2d6e599
commit def2f66
Showing
5 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './lib'; | ||
export * from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
|
||
type PermType = "super" | "watch" | "write" | "reads" | "press"; | ||
|
||
type Vane = 'ames' | 'behn' | 'clay' | 'dill' | 'eyre' | 'gall' | 'iris' | 'jael' | 'khan'; | ||
|
||
type Tail = { | ||
jump?: boolean; | ||
care?: string | null; | ||
desk?: string | null; | ||
dude?: string | null; | ||
path?: string | null; | ||
ship?: string | null; | ||
spur?: string | null; | ||
vane?: string | null; | ||
} | null; | ||
|
||
|
||
interface Perm { | ||
name: PermType; | ||
vane: Vane | null; | ||
tail: Tail; | ||
} | ||
|
||
export type Seal = Perm[]; | ||
|
||
/** | ||
* A passport-formatted permission | ||
*/ | ||
interface PassportPerm { | ||
kind: { | ||
nom: string; | ||
pes: { | ||
desc: string; | ||
// TODO: per tinnus, "have" is meant to say whether the app already has all / any of / none of the perms in question but currently it doesn't, it just always says nil. | ||
have: "nil"; | ||
pers: Perm[]; | ||
warn: string | null; | ||
}[] | ||
} | ||
} | ||
|
||
interface AppPerm { | ||
pes: { | ||
node: { | ||
desc: string; | ||
have: "nil"; | ||
pers: Perm[]; | ||
}[] | ||
}; | ||
app: string; | ||
} | ||
|
||
/** | ||
* Per lib/perms.hoon, Passport is intended for consumption by permission | ||
* management frontends. | ||
*/ | ||
export interface Passport { | ||
/** | ||
* Categorized perms | ||
*/ | ||
rad: PassportPerm[]; | ||
/** | ||
* Dangerous perms | ||
*/ | ||
sys: PassportPerm[]; | ||
/** | ||
* All apps perms | ||
*/ | ||
any: PassportPerm[]; | ||
/** | ||
* Unknown app perms | ||
*/ | ||
new: PassportPerm[]; | ||
/** | ||
* Specific app perms | ||
*/ | ||
app: AppPerm[]; | ||
} |