Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 4 additions & 40 deletions docs/hostprovider.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
# Git Credential Manager Host Provider

Property|Value
-|-
Author(s)|Matthew John Cheetham ([@mjcheetham][mjcheetham])
Revision|1.2
Last updated|2021-01-08

## Revision Summary

- 1.0. Initial revision.
- 1.1. Replaced `GetCredentialKey` with `GetServiceName`.
- 1.2. Added new `IsSupported(HttpResponseMessage)` overload, the optional
`ICommandProvider` interface, and registration priorities.

## Abstract

Git Credential Manger, the cross-platform and cross-host Git credential
helper, can be extended to support any Git hosting service allowing seamless
authentication to secured Git repositories by implementing and registering a
"host provider".

## Table of Contents

- [1. Introduction](#1-introduction)
- [1.1. Notational Conventions](#11-notational-conventions)
- [1.2. Abbreviations](#12-abbreviations)
- [2. Implementation](#2-implementation)
- [2.1. Registration](#21-registration)
- [2.1.2. Ordering](#212-ordering)
- [2.2. Handling Requests](#22-handling-requests)
- [2.2.1. Rejecting Requests](#221-rejecting-requests)
- [2.3. Retrieving Credentials](#23-retrieving-credentials)
- [2.3.1 Authentication Prompts](#231-authentication-prompts)
- [2.4. Storing Credentials](#24-storing-credentials)
- [2.5. Erasing Credentials](#25-erasing-credentials)
- [2.6 `HostProvider` base class](#26-hostprovider-base-class)
- [2.6.1 `GetServiceName`](#261-getservicename)
- [2.6.2 `GenerateCredentialAsync`](#262-generatecredentialasync)
- [2.7. External Metadata](#27-external-metadata)
- [3. Helpers](#3-helpers)
- [3.1. Discovery](#31-discovery)
- [4. Error Handling](#4-error-handling)
- [5. Custom Commands](#5-custom-commands)
- [References](#references)

## 1. Introduction

Git Credential Manager (GCM) is a host and platform agnostic Git
credential helper application. Support for authenticating to any Git hosting
service can be added to GCM by creating a custom "host provider" and
registering it within the product. Host providers can be submitted via a pull
request on GitHub at <https://github.com/GitCredentialManager/git-credential-manager>.
request on [the Git Credential Manager repository on GitHub][gcm].

This document outlines the required and expected behaviour of a host provider,
and what is required to implement and register one.
Expand Down Expand Up @@ -85,7 +48,7 @@ provider with the application via the host provider registry.
Host providers MUST implement the `IHostProvider` interface. They can choose to
directly implement the interface they MAY derive from the `HostProvider`
abstract class (which itself implements the `IHostProvider` interface) - see
[§2.6](#26-hostprovider-base-class).
[§2.6][hostprovider-base-class].

Implementors MUST implement all interface properties and abstract methods.

Expand Down Expand Up @@ -380,5 +343,6 @@ take, but implementors SHOULD attempt to follow existing practices and styles.

1. [`System.CommandLine` API][github-dotnet-cli]

[gcm]: https://github.com/GitCredentialManager/git-credential-manager
[github-dotnet-cli]: https://github.com/dotnet/command-line-api
[mjcheetham]: https://github.com/mjcheetham
[hostprovider-base-class]: #26-hostprovider-base-class