mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 14:14:22 +01:00
rpc-acl: fix function calls
Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
const ACL = require('../acl')
|
const ACL = require('../acl')
|
||||||
|
|
||||||
async getACLHandler (publicKey, req) {
|
async function getACLHandler (publicKey, req) {
|
||||||
const { repoName, userId } = await this.parseACLRequest(publicKey, req)
|
const { repoName, userId } = await this.parseACLRequest(publicKey, req)
|
||||||
return Buffer.from(JSON.stringify(ACL.getACL(repoName)))
|
return Buffer.from(JSON.stringify(ACL.getACL(repoName)))
|
||||||
}
|
}
|
||||||
|
|
||||||
async addACLHandler (publicKey, req) {
|
async function addACLHandler (publicKey, req) {
|
||||||
const { repoName, userId, acl } = await this.parseACLRequest(publicKey, req)
|
const { repoName, userId, acl } = await this.parseACLRequest(publicKey, req)
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
@@ -14,17 +14,16 @@ async addACLHandler (publicKey, req) {
|
|||||||
return Buffer.from('ACL updated')
|
return Buffer.from('ACL updated')
|
||||||
}
|
}
|
||||||
|
|
||||||
async delACLHandler (publicKey, req) {
|
async function delACLHandler (publicKey, req) {
|
||||||
const { repoName, userId, acl } = await this.parseACLRequest(publicKey, req)
|
const { repoName, userId, acl } = await this.parseACLRequest(publicKey, req)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async chgACLHandler (publicKey, req) {
|
async function chgACLHandler (publicKey, req) {
|
||||||
const { repoName, userId, acl } = await this.parseACLRequest(publicKey, req)
|
const { repoName, userId, acl } = await this.parseACLRequest(publicKey, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function parseACLRequest(publicKey, req) {
|
||||||
async parseACLRequest(publicKey, req) {
|
|
||||||
if (!req) throw new Error('Request is empty')
|
if (!req) throw new Error('Request is empty')
|
||||||
const request = JSON.parse(req.toString())
|
const request = JSON.parse(req.toString())
|
||||||
const userId = await this.authenticate(publicKey, request)
|
const userId = await this.authenticate(publicKey, request)
|
||||||
|
|||||||
Reference in New Issue
Block a user