Blame include/git2/cred_helpers.h

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