Skip to content

Instantly share code, notes, and snippets.

@HerbCaudill
Last active May 2, 2024 00:45
Show Gist options
  • Save HerbCaudill/59b941a60775b47eccc9f20a40b43c78 to your computer and use it in GitHub Desktop.
Save HerbCaudill/59b941a60775b47eccc9f20a40b43c78 to your computer and use it in GitHub Desktop.
auth@next notes
type Group = {
  id: Uuid
  members: Group[]
  keys: KeysetWithSecrets
  graph:
}
export type EntityBase = {
id: EntityId
name: string
keys: Keyset
members?: Entity[]
}
export type Team = EntityBase & {
type: 'TEAM'
members: (Role | User | Server)[]
}
export type Role = EntityBase & {
type: 'ROLE'
members: (User | Server)[]
}
export type User = EntityBase & {
type: 'USER'
members: (Device | Agent)[]
}
export type Agent = EntityBase & {
type: 'AGENT'
members: never
}
export type Server = EntityBase & {
type: 'SERVER'
members: never
}
export type Device = EntityBase & {
type: 'DEVICE'
members: never
}
export type Entity = Team | Role | User | Agent | Device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment