Blame include/git2/cred_helpers.h

Packit ae9e2a
/*
Packit ae9e2a
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit ae9e2a
 *
Packit ae9e2a
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit ae9e2a
 * a Linking Exception. For full terms see the included COPYING file.
Packit ae9e2a
 */
Packit ae9e2a
#ifndef INCLUDE_git_cred_helpers_h__
Packit ae9e2a
#define INCLUDE_git_cred_helpers_h__
Packit ae9e2a
Packit ae9e2a
#include "transport.h"
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * @file git2/cred_helpers.h
Packit ae9e2a
 * @brief Utility functions for credential management
Packit ae9e2a
 * @defgroup git_cred_helpers credential management helpers
Packit ae9e2a
 * @ingroup Git
Packit ae9e2a
 * @{
Packit ae9e2a
 */
Packit ae9e2a
GIT_BEGIN_DECL
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * Payload for git_cred_stock_userpass_plaintext.
Packit ae9e2a
 */
Packit ae9e2a
typedef struct git_cred_userpass_payload {
Packit ae9e2a
	const char *username;
Packit ae9e2a
	const char *password;
Packit ae9e2a
} git_cred_userpass_payload;
Packit ae9e2a
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * Stock callback usable as a git_cred_acquire_cb.  This calls
Packit ae9e2a
 * git_cred_userpass_plaintext_new unless the protocol has not specified
Packit ae9e2a
 * `GIT_CREDTYPE_USERPASS_PLAINTEXT` as an allowed type.
Packit ae9e2a
 *
Packit ae9e2a
 * @param cred The newly created credential object.
Packit ae9e2a
 * @param url The resource for which we are demanding a credential.
Packit ae9e2a
 * @param user_from_url The username that was embedded in a "user\@host"
Packit ae9e2a
 *                          remote url, or NULL if not included.
Packit ae9e2a
 * @param allowed_types A bitmask stating which cred types are OK to return.
Packit ae9e2a
 * @param payload The payload provided when specifying this callback.  (This is
Packit ae9e2a
 *        interpreted as a `git_cred_userpass_payload*`.)
Packit ae9e2a
 */
Packit ae9e2a
GIT_EXTERN(int) git_cred_userpass(
Packit ae9e2a
		git_cred **cred,
Packit ae9e2a
		const char *url,
Packit ae9e2a
		const char *user_from_url,
Packit ae9e2a
		unsigned int allowed_types,
Packit ae9e2a
		void *payload);
Packit ae9e2a
Packit ae9e2a
Packit ae9e2a
/** @} */
Packit ae9e2a
GIT_END_DECL
Packit ae9e2a
#endif