Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions lexicons/com/sds/repo/grantAccess.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,32 @@
},
"permissions": {
"type": "object",
"description": "Repository access permissions",
"required": ["read", "write"],
"description": "Repository access permissions aligned with OAuth's granular action model",
"required": ["read", "create", "update", "delete"],
"properties": {
"read": {
"type": "boolean",
"description": "Permission to read repository content."
},
"write": {
"create": {
"type": "boolean",
"description": "Permission to write/modify repository content."
"description": "Permission to create new records in the repository."
},
"update": {
"type": "boolean",
"description": "Permission to update existing records in the repository."
},
"delete": {
"type": "boolean",
"description": "Permission to delete records from the repository."
},
"admin": {
"type": "boolean",
"description": "Administrative permissions (manage collaborators, etc.)."
},
"owner": {
"type": "boolean",
"description": "Owner permissions (full control including ownership transfer)."
}
}
},
Expand Down
59 changes: 59 additions & 0 deletions lexicons/com/sds/repo/transferOwnership.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"lexicon": 1,
"id": "com.sds.repo.transferOwnership",
"defs": {
"main": {
"type": "procedure",
"description": "Transfer repository ownership to another user. Only the current owner can perform this operation.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["repo", "newOwnerDid"],
"properties": {
"repo": {
"type": "string",
"format": "at-identifier",
"description": "The handle or DID of the repository."
},
"newOwnerDid": {
"type": "string",
"format": "did",
"description": "The DID of the new owner."
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["success", "previousOwner", "newOwner", "transferredAt"],
"properties": {
"success": {
"type": "boolean"
},
"previousOwner": {
"type": "string",
"format": "did"
},
"newOwner": {
"type": "string",
"format": "did"
},
"transferredAt": {
"type": "string",
"format": "datetime"
}
}
}
},
"errors": [
{
"name": "Unauthorized",
"description": "Only the repository owner can transfer ownership."
}
]
}
}
}
4 changes: 3 additions & 1 deletion packages/dev-env/src/network-with-sds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export class TestNetworkWithSds extends TestNetworkNoAppView {
await lexiconAuthorityProfile.migrateTo(sds)
await lexiconAuthorityProfile.createRecords()

console.log(`Lexicon authority ${lexiconAuthorityProfile.did} migrated to both PDS and SDS servers`)
console.log(
`Lexicon authority ${lexiconAuthorityProfile.did} migrated to both PDS and SDS servers`,
)
console.log(`PDS URL: ${pds.url}, SDS URL: ${sds.url}`)

await ozone.addAdminDid(ozoneServiceProfile.did)
Expand Down
5 changes: 4 additions & 1 deletion packages/dev-env/src/service-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export class ServiceProfile {
return this.client.assertDid
}

async migrateTo(newPds: TestPds | any, options: ServiceMigrationOptions = {}) {
async migrateTo(
newPds: TestPds | any,
options: ServiceMigrationOptions = {},
) {
const newClient = newPds.getClient()

const newPdsDesc = await newClient.com.atproto.server.describeServer()
Expand Down
Loading
Loading