1. Stefan Saasen
  2. git


Junio C Hamano  committed dd3d071 Merge

Merge branch 'mm/api-credentials-doc'

* mm/api-credentials-doc:
api-credentials.txt: add "see also" section
api-credentials.txt: mention credential.helper explicitly
api-credentials.txt: show the big picture first
doc: fix xref link from api docs to manual pages

  • Participants
  • Parent commits 1b829ee, 04ab6ae
  • Branches master

Comments (0)

Files changed (3)

File Documentation/technical/api-config.txt

View file
  • Ignore whitespace
 The config API gives callers a way to access git configuration files
-(and files which have the same syntax). See linkgit:git-config[1] for a
+(and files which have the same syntax). See linkgit:../git-config[1] for a
 discussion of the config file syntax.
 General Usage

File Documentation/technical/api-credentials.txt

View file
  • Ignore whitespace
 world can take many forms, in this document the word "credential" always
 refers to a username and password pair).
+This document describes two interfaces: the C API that the credential
+subsystem provides to the rest of git, and the protocol that git uses to
+communicate with system-specific "credential helpers". If you are
+writing git code that wants to look up or prompt for credentials, see
+the section "C API" below. If you want to write your own helper, see
+the section on "Credential Helpers" below.
+Typical setup
+| git code (C)          |--- to server requiring --->
+|                       |        authentication
+| C credential API      |--- prompt ---> User
+	^      |
+	| pipe |
+	|      v
+| git credential helper |
+The git code (typically a remote-helper) will call the C API to obtain
+credential data like a login/password pair (credential_fill). The
+API will itself call a remote helper (e.g. "git credential-cache" or
+"git credential-store") that may retrieve credential data from a
+store. If the credential helper cannot find the information, the C API
+will prompt the user. Then, the caller of the API takes care of
+contacting the server, and does the actual authentication.
+The credential C API is meant to be called by git code which needs to
+acquire or store a credential. It is centered around an object
+representing a single credential and provides three basic operations:
+fill (acquire credentials by calling helpers and/or prompting the user),
+approve (mark a credential as successfully used so that it can be stored
+for later use), and reject (mark a credential as unsuccessful so that it
+can be erased from any persistent storage).
 Data Structures
 `struct credential`::
 	Parse a URL into broken-down credential fields.
 The example below shows how the functions of the credential API could be
 used to login to a fictitious "foo" service on a remote host:
 longer than a single git process; e.g., credentials may be stored
 in-memory for a few minutes, or indefinitely on disk).
-Each helper is specified by a single string. The string is transformed
-by git into a command to be executed using these rules:
+Each helper is specified by a single string in the configuration
+variable `credential.helper` (and others, see linkgit:../git-config[1]).
+The string is transformed by git into a command to be executed using
+these rules:
   1. If the helper string begins with "!", it is considered a shell
      snippet, and everything after the "!" becomes the command.
 If a helper receives any other operation, it should silently ignore the
 request. This leaves room for future operations to be added (older
 helpers will just ignore the new requests).
+See also
+linkgit:../git-config[5] (See configuration variables `credential.*`)

File Documentation/technical/api-merge.txt

View file
  • Ignore whitespace
 	ancestors in a recursive merge.
 	If a helper program is specified by the
 	`[merge "<driver>"] recursive` configuration, it will
-	be used (see linkgit:gitattributes[5]).
+	be used (see linkgit:../gitattributes[5]).
 	Resolve local conflicts automatically in favor