Files
coder/docs/api/git.md
Kyle Carberry 6e36082b0f chore: add github.com user id association (#14045)
* chore: add github.com user id association

This will eventually be used to show an indicator in the UI
to star the repository if you've been using Coder for a while
and have not starred the repo.

If you have, we'll never show a thing!

* gen

* Fix model query

* Fix linting

* Ignore auditing github.com user id

* Add test

* Fix gh url var name

* Update migration

* Update coderd/database/dbauthz/dbauthz.go

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>

* Fix updating to when the token changes

* Fix migration

---------

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
2024-08-02 12:49:36 -04:00

5.6 KiB
Generated

Git

Get user external auths

Code samples

# Example request using curl
curl -X GET http://coder-server:8080/api/v2/external-auth \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'

GET /external-auth

Example responses

200 Response

{
  "authenticated": true,
  "created_at": "2019-08-24T14:15:22Z",
  "expires": "2019-08-24T14:15:22Z",
  "has_refresh_token": true,
  "provider_id": "string",
  "updated_at": "2019-08-24T14:15:22Z",
  "validate_error": "string"
}

Responses

Status Meaning Description Schema
200 OK OK codersdk.ExternalAuthLink

To perform this operation, you must be authenticated. Learn more.

Get external auth by ID

Code samples

# Example request using curl
curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth} \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'

GET /external-auth/{externalauth}

Parameters

Name In Type Required Description
externalauth path string(string) true Git Provider ID

Example responses

200 Response

{
  "app_install_url": "string",
  "app_installable": true,
  "authenticated": true,
  "device": true,
  "display_name": "string",
  "installations": [
    {
      "account": {
        "avatar_url": "string",
        "id": 0,
        "login": "string",
        "name": "string",
        "profile_url": "string"
      },
      "configure_url": "string",
      "id": 0
    }
  ],
  "user": {
    "avatar_url": "string",
    "id": 0,
    "login": "string",
    "name": "string",
    "profile_url": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK codersdk.ExternalAuth

To perform this operation, you must be authenticated. Learn more.

Code samples

# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/external-auth/{externalauth} \
  -H 'Coder-Session-Token: API_KEY'

DELETE /external-auth/{externalauth}

Parameters

Name In Type Required Description
externalauth path string(string) true Git Provider ID

Responses

Status Meaning Description Schema
200 OK OK

To perform this operation, you must be authenticated. Learn more.

Get external auth device by ID.

Code samples

# Example request using curl
curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth}/device \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'

GET /external-auth/{externalauth}/device

Parameters

Name In Type Required Description
externalauth path string(string) true Git Provider ID

Example responses

200 Response

{
  "device_code": "string",
  "expires_in": 0,
  "interval": 0,
  "user_code": "string",
  "verification_uri": "string"
}

Responses

Status Meaning Description Schema
200 OK OK codersdk.ExternalAuthDevice

To perform this operation, you must be authenticated. Learn more.

Post external auth device by ID

Code samples

# Example request using curl
curl -X POST http://coder-server:8080/api/v2/external-auth/{externalauth}/device \
  -H 'Coder-Session-Token: API_KEY'

POST /external-auth/{externalauth}/device

Parameters

Name In Type Required Description
externalauth path string(string) true External Provider ID

Responses

Status Meaning Description Schema
204 No Content No Content

To perform this operation, you must be authenticated. Learn more.