EVOLUTION-MANAGER
Edit File: credential_api.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Retrieve and store git HTTPS credentials</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for credential_api {credentials}"><tr><td>credential_api {credentials}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Retrieve and store git HTTPS credentials</h2> <h3>Description</h3> <p>Low-level wrappers for the <a href="https://git-scm.com/docs/git-credential">git-credential</a> command line tool. Try the user-friendly <a href="http_credentials.html">git_credential_ask</a> and <a href="http_credentials.html">git_credential_update</a> functions first. </p> <h3>Usage</h3> <pre> credential_fill(cred, verbose = TRUE) credential_approve(cred, verbose = TRUE) credential_reject(cred, verbose = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>cred</code></td> <td> <p>named list with at least fields <code>protocol</code> and <code>host</code> and optionally also <code>path</code>, <code>username</code> ,<code>password</code>.</p> </td></tr> <tr valign="top"><td><code>verbose</code></td> <td> <p>emit some useful output about what is happening</p> </td></tr> </table> <h3>Details</h3> <p>The <a href="credential_api.html">credential_fill</a> function looks up credentials for a given host, and if none exists it will attempt to prompt the user for new credentials. Upon success it returns a list with the same <code>protocol</code> and <code>host</code> fields as the <code>cred</code> input, and additional <code>username</code> and <code>password</code> fields. </p> <p>After you have tried to authenticate the provided credentials, you can report back if the credentials were valid or not. Call <a href="credential_api.html">credential_approve</a> and <a href="credential_api.html">credential_reject</a> with the <code>cred</code> that was returned by <a href="credential_api.html">credential_fill</a> in order to validate or invalidate a credential from the store. </p> <p>Because git credential interacts with the system password manager, the appearance of the prompts vary by OS and R frontend. Note that <a href="credential_api.html">credential_fill</a> should only be used interactively, because it may require the user to enter credentials or unlock the system keychain. On the other hand <a href="credential_api.html">credential_approve</a> and <a href="credential_api.html">credential_reject</a> are non-interactive and could be used to save or delete credentials in a scripted program. However note that some credential helpers (e.g. on Windows) have additional security restrictions that limit use of <a href="credential_api.html">credential_approve</a> and <a href="credential_api.html">credential_reject</a> to credentials that were actually entered by the user via <a href="credential_api.html">credential_fill</a>. Here it is not possible at all to update the credential store without user interaction. </p> <h3>Examples</h3> <pre> # Insert example cred example <- list(protocol = "https", host = "example.org", username = "test", password = "secret") credential_approve(example) # Retrieve it from the store cred <- credential_fill(list(protocol = "https", host = "example.org", path = "/foo")) print(cred) # Delete it credential_reject(cred) </pre> <hr /><div style="text-align: center;">[Package <em>credentials</em> version 1.3.2 <a href="00Index.html">Index</a>]</div> </body></html>