forked from indymedia/epicyon
Configurable capabilities
parent
861e46fa67
commit
bd970f2591
|
@ -9,7 +9,7 @@ __status__ = "Production"
|
||||||
import os
|
import os
|
||||||
from auth import createPassword
|
from auth import createPassword
|
||||||
|
|
||||||
def sendCapabilitiesRequest(baseDir: str,httpPrefix: str,domain: str,requestedActor: str) -> None:
|
def sendCapabilitiesRequest(baseDir: str,httpPrefix: str,domain: str,requestedActor: str,inbox="write",objects="read") -> None:
|
||||||
# This is sent to the capabilities endpoint /caps/new
|
# This is sent to the capabilities endpoint /caps/new
|
||||||
# which could be instance wide or for a particular person
|
# which could be instance wide or for a particular person
|
||||||
capId=createPassword(32)
|
capId=createPassword(32)
|
||||||
|
@ -17,22 +17,22 @@ def sendCapabilitiesRequest(baseDir: str,httpPrefix: str,domain: str,requestedAc
|
||||||
"id": httpPrefix+"://"+requestedDomain+"/caps/request/"+capId,
|
"id": httpPrefix+"://"+requestedDomain+"/caps/request/"+capId,
|
||||||
"type": "Request",
|
"type": "Request",
|
||||||
"capability": {
|
"capability": {
|
||||||
"inbox": "write",
|
"inbox": inbox,
|
||||||
"objects": "read"
|
"objects": objects
|
||||||
},
|
},
|
||||||
"actor": requestedActor
|
"actor": requestedActor
|
||||||
}
|
}
|
||||||
#TODO
|
#TODO
|
||||||
|
|
||||||
def sendCapabilitiesAccept(baseDir: str,httpPrefix: str,nickname: str,domain: str,acceptedActor: str) -> None:
|
def sendCapabilitiesAccept(baseDir: str,httpPrefix: str,nickname: str,domain: str,acceptedActor: str,inbox="write",objects="read") -> None:
|
||||||
# This gets returned to capabilities requester
|
# This gets returned to capabilities requester
|
||||||
capId=createPassword(32)
|
capId=createPassword(32)
|
||||||
capAccept = {
|
capAccept = {
|
||||||
"id": httpPrefix+"://"+domain+"/caps/"+capId,
|
"id": httpPrefix+"://"+domain+"/caps/"+capId,
|
||||||
"type": "Capability",
|
"type": "Capability",
|
||||||
"capability": {
|
"capability": {
|
||||||
"inbox": "write",
|
"inbox": inbox,
|
||||||
"objects": "read"
|
"objects": objects
|
||||||
},
|
},
|
||||||
"scope": acceptedActor,
|
"scope": acceptedActor,
|
||||||
"actor": httpPrefix+"://"+domain
|
"actor": httpPrefix+"://"+domain
|
||||||
|
|
Loading…
Reference in New Issue