Skip to content

[oauth integration]: support for git repos hosted sourcehut instances #11796

@ajhalili2006

Description

@ajhalili2006

Is your feature request related to a problem? Please describe

Pushing Git objects and Mercurial revisions are currently limited to SSH-only setup and Sourcehut doesn't support
Basic authentication for push (and pull access for private repos), and since ~/.ssh directory doesn't presist between
restarts, one could write some scripts to presist these keys as base64-encoded tar.gz binary in user-wide variables.

Describe the behaviour you'd like

Adding OAuth integration support for sourcehut via their OAuth2 and meta.sr.ht GraphQL API for adding SSH keys.
The SSH key should be generated during the workspace creation and stored as a persistent SSH key in /workspace/.gitpod
directory between restarts and accessible through the plain SSH agent (this can be reused across shell sessions via
keychain).

Proposed OAuth2 scopes

meta.sr.ht/PROFILE:RO meta.sr.ht/SSH_KEYS:RW git.sr.ht/REPOSITORIES git.sr.ht/OBJECTS todo.sr.ht/TRACKERS todo.sr.ht/TICKETS:RW lists.sr.ht/PATCHES:RW lists.sr.ht/LISTS lists.sr.ht/EMAILS

Explaination for each scope:

  • meta.sr.ht/PROFILE:RO - read-only access to your sourcehut profile
  • meta.sr.ht/SSH_KEYS:RW - write access to ypur account's SSH keys for adding per-workspace SSH keys
    when opening git.sr.ht repos through regular gitpod.io/# URLs.
  • git.sr.ht/REPOSITORIES git.sr.ht/OBJECTS - fetch repsotiory data and objects for prebuilds, currently
    only lists repositories owned by authenticated user, but in the future this might include repos you can
    access through ACLs configured by the repository owner.
  • todo.sr.ht/TRACKERS todo.sr.ht/TICKETS:RW - managing tickets from sourcehut's ticket tracking service
  • lists.sr.ht/PATCHES lists.sr.ht/LISTS lists.sr.ht/EMAILS - for reviewing and applying patches from mailing lists

OAuth2 page preview

An screenshot of OAuth2 authorization page from meta.sr.ht, click on image to see it IRL

Documentation

Describe alternatives you've considered

I'm currently working on an DrupalPod-style project (minus the browser extension) for git.sr.ht repos
at https://git.sr.ht/~ajhalili2006-experiments/hutpod (mirror on GitLab for prebuilds)
with the mentioned workarounds for the SSH keys, although it's currently a work in progress right now.

Additional context

For context about sourcehut: Sourcehut is an code forge, written in Python with some parts in Golang, licensed under AGPL, and technically each feature is separated into its own repository. While this feature suggestion is for adding OAuth2 support to automate per-workspace SSH key setup, it should be optional since you can send improvements as an email patch to be applied through Git.
(Most of sourcehut features are accessible without an account, usually through email.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions