-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add capabilities #231
Conversation
8b647a1
to
f7b5703
Compare
d56f73a
to
a591214
Compare
a591214
to
1777d8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of questions but nothing truly blocking. good stuff!
const isAssigningProjectCreatorRole = | ||
authCoreId === this.#projectCreatorAuthCoreId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
somewhat of a nit but initially read this as assigning a role called project creator
const isAssigningProjectCreatorRole = | |
authCoreId === this.#projectCreatorAuthCoreId | |
const isAssigningToProjectCreator = | |
authCoreId === this.#projectCreatorAuthCoreId |
coreStorage: () => new RAM(), | ||
}) | ||
const ownDeviceId = km.getIdentityKeypair().publicKey.toString('hex') | ||
console.log('deviceId', ownDeviceId.slice(0, 7)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove?
try { | ||
const roleAssignment = await this.#dataType.getByDocId(deviceId) | ||
roleId = roleAssignment.roleId | ||
} catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint doesn't complain about this being unused?
} catch (e) { | |
} catch { |
docs: mapObject(currentSchemaVersions, (key) => { | ||
return [ | ||
key, | ||
{ readOwn: true, writeOwn: true, readOthers: true, writeOthers: false }, | ||
] | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's happening here with these object mappings? hard to tell at a glance without needing to dive into the currentSchemaVersions
code
* main: (25 commits) add initial implementation of MemberApi (#232) feat: $blobs.getUrl and $blobs.create methods (#184) chore: update manager e2e tests (#237) feat: add capabilities (#231) feat: coreOwnership integration [3/3] (#230) feat: CoreOwnership class w getOwner & getCoreKey [2/3] (#229) feat: handle `coreOwnership` records in `IndexWriter` [1/3] (#214) fix: adjust storage options for MapeoManager and MapeoProject (#235) implement addProject method for MapeoManager class (#215) implement listProjects method for MapeoManager class (#208) feat: expose blobStore.writerDriveId (#219) implement wrapper client containing createProject and getProject methods (#199) add project settings functionality to MapeoProject (#187) feat: Add encode/decode for project keys [3/3] (#203) feat: update protobuf for RPC [2/3] (#202) chore: move protobuf messages into src/generated [1/3] (#201) feat: Add internal `dataType.createWithDocId()` (#192) chore: explicitly set "mode" opt for encryptionKeys column creation (#186) chore: fix linting and type checking (#183) chore: consolidate encryption key columns in projectKeys table (#181) ...
Implements #189
More complete tests are blocked by the ability to invite and sync devices, tracking that in #238
This PR adds an internal
this.#capabilities
instance to the MapeoProject instance. It's initial use will be for assigning roles (part of the invite process) and for checking capabilities for sync when syncing with other devices. Checking capabilities for reading/writing mapeo docs is post-MVP. Also need to expose in the API, tracking that in #239Post-MVP we will implement the ability have custom roles and capabilities, but hard-coding is ok for now.