#21 API for making a foreign(or local) collaborator

Open
opened 1 year ago by Houkime · 0 comments
Houkime commented 1 year ago

Right now, my collaborator demo at https://notabug.org/Houkime/mcfi uses the following scheme (it is a reduced one which omits OAuth):

Let's assume that alice@ServerA.com is wishing to add bob@ServerB.com as a collaborator for her project AwesomeRepo

Step 1 (C2S request to add a collaborator):

POST at ServerA.com/users/alice/AsesomeRepo/collaborators/new

  {
     'collaborator':   'bob@ServerB.com',
  }

Result: 204 Successful operation

Step 2 (S2S request to lookup a bob's public key to grant him access):

GET at ServerB.com/users/bob

Response

      {
            '@context':  [
                "https://www.w3.org/ns/activitystreams",
                "https://forgefed.peers.community/ns"
            ],
            'type':      'Person',
            'id':        'ServerB/users/bob',
            'name':      'bob',
            'preferredUsername': 'bob',
            'summary':   '',
            'inbox':     'ServerB.com/users/bob/inbox'
            'outbox':    'ServerB.com/users/bob/outbox'
            'followers': 'ServerB.com/users/bob/followers'
            'following': 'ServerB.com/users/bob/following'
            'publicKey': 'ssh-rsa AABBBADSOQdasjasjdi123ead...'
        }

And that's it. Key is then imported and registered as a valid collaborator for AwesomeRepo. And it works as can be seen in https://peertube.social/videos/watch/e65e0c70-d165-4c64-8518-3578d3d392d9 after the cryptic cartoon.

However, it probably should be wrapped into some form of Activity, esp. so that bob can be notified of the fact that he is now indeed a collaborator.

Right now, my collaborator demo at https://notabug.org/Houkime/mcfi uses the following scheme (it is a reduced one which omits OAuth): Let's assume that alice@ServerA.com is wishing to add bob@ServerB.com as a collaborator for her project AwesomeRepo ### Step 1 (C2S request to add a collaborator): `POST at ServerA.com/users/alice/AsesomeRepo/collaborators/new` ``` { 'collaborator': 'bob@ServerB.com', } ``` `Result: 204 Successful operation` ### Step 2 (S2S request to lookup a bob's public key to grant him access): `GET at ServerB.com/users/bob` `Response` ``` { '@context': [ "https://www.w3.org/ns/activitystreams", "https://forgefed.peers.community/ns" ], 'type': 'Person', 'id': 'ServerB/users/bob', 'name': 'bob', 'preferredUsername': 'bob', 'summary': '', 'inbox': 'ServerB.com/users/bob/inbox' 'outbox': 'ServerB.com/users/bob/outbox' 'followers': 'ServerB.com/users/bob/followers' 'following': 'ServerB.com/users/bob/following' 'publicKey': 'ssh-rsa AABBBADSOQdasjasjdi123ead...' } ``` And that's it. Key is then imported and registered as a valid collaborator for AwesomeRepo. And it works as can be seen in https://peertube.social/videos/watch/e65e0c70-d165-4c64-8518-3578d3d392d9 after the cryptic cartoon. However, it probably should be wrapped into some form of Activity, esp. so that bob can be notified of the fact that he is now indeed a collaborator.
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.