Code Monkey home page Code Monkey logo

git-credential-helper's Introduction

Collection of Git credential helpers

This repository contains the set of Git credential helpers (gitcredentials(7)) that are part of git (or meant to be contributed in the future).

The latest discussion about some refactoring can be found here.

Currently supported git credential backends are

  • GnomeKeyring
  • Mac OS X Keychain
  • Windows Credential API

Compared to the current upstream version, the implementations in this repository are based on a generic helper implementation that provides the basic common infrastructure for new credential helpers.

Installation & Usage

$ git clone git://github.com/pah/git-credential-helper.git
$ BACKEND=gnome-keyring      # or any other backend
$ cd git-credential-helper/$BACKEND
$ make
$ cp git-credential-$BACKEND /some/dir/in/path

To use this backend, you can add it to your (global) Git configuration by setting

$ git config [--global] credential.helper $BACKEND

See gitcredentials(7) for details.

Adding a new backend using the generic helper

To implement a new backend, one needs to implement functions for each credential operation to support.

/* include generic helper */
#include <credential_helper.h>

/* ... include backend specific stuff */

/*
 * implement credential operation functions
 * e.g. for get, store, erase
 */

int my_backend_get(struct credential *cred); 

To complete the implementation, add all functions to the table credential_helper_ops:

struct credential_operation const credential_helper_ops[] =
{
	{ "get",   my_backend_get   },
	{ "store", my_backend_store },
	{ "erase", my_backend_erase },
	CREDENTIAL_OP_END
};

The Makefile in the individual backend directories can be used as a template to build new backends. Usually, it is sufficient to change the name of the +MAIN+ component and to add backend-specific compiler flags to the INCS and LIBS variables.

TODO

  • Add global init and cleanup functions to the generic helper
  • Add support for command-line options via the generic helper

License

These files are licensed under the GPL v2, or a later version at the discretion of Linus.

git-credential-helper's People

Contributors

jszakmeister avatar pah avatar peff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.