Skip to content

GHE compatibility: API client #1182

Closed

Description

@mislav

The important thing to address when working towards GHE compatibility #273 is the fact that our current API client will always assume a github.com host.

Off the top of my head, here is what would be involved in making our API client more flexible:

  • change context.AuthToken() accessor to take a hostname argument and find a token specifically for that hostname (or kick off the authentication flow)
  • initialize every api.Client instance with a hostname
  • in api.* functions that make HTTP requests, ensure that REST requests get routed to https://<hostname>/api/v3/<endpoint> and GraphQL requests to https://<hostname>/api/graphql for non-github.com hostnames
  • verify compatibility in pkg/cmd/api/http.go as well

Activity

  1. added
    enhancement
    on Jun 12, 2020
  2. self-assigned this
    on Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions