<commit_before>/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_git_transport_h__
#define INCLUDE_git_transport_h__

#include "indexer.h"
#include "net.h"
#include "types.h"

/**
 * @file git2/transport.h
 * @brief Git transport interfaces and functions
 * @defgroup git_transport interfaces and functions
 * @ingroup Git
 * @{
 */
GIT_BEGIN_DECL

/*
 *** Begin interface for credentials acquisition ***
 */

typedef enum {
	/* git_cred_userpass_plaintext */
	GIT_CREDTYPE_USERPASS_PLAINTEXT = 1,
} git_credtype_t;

/* The base structure for all credential types */
typedef struct git_cred {
	git_credtype_t credtype;
	void (*free)(
		struct git_cred *cred);
} git_cred;

/* A plaintext username and password */
typedef struct git_cred_userpass_plaintext {
	git_cred parent;
	char *username;
	char *password;
} git_cred_userpass_plaintext;

/**
 * Creates a new plain-text username and password credential object.
 *
 * @param out The newly created credential object.
 * @param username The username of the credential.
 * @param password The password of the credential.
 */
GIT_EXTERN(int) git_cred_userpass_plaintext_new(
	git_cred **out,
	const char *username,
	const char *password);

/**
 * Signature of a function which acquires a credential object.
 *
 * @param cred The newly created credential object.
 * @param url The resource for which we are demanding a credential.
 * @param allowed_types A bitmask stating which cred types are OK to return.
 * @param payload The payload provided when specifying this callback.
 */
typedef int (*git_cred_acquire_cb)(
	git_cred **cred,
	const char *url,
	unsigned int allowed_types,
	void *payload);

/*<commit_msg>Some doc improvements<commit_after>/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_git_transport_h__
#define INCLUDE_git_transport_h__

#include "indexer.h"
#include "net.h"
#include "types.h"

/**
 * @file git2/transport.h
 * @brief Git transport interfaces and functions
 * @defgroup git_transport interfaces and functions
 * @ingroup Git
 * @{
 */
GIT_BEGIN_DECL

/*
 *** Begin interface for credentials acquisition ***
 */

typedef enum {
	/* git_cred_userpass_plaintext */
	GIT_CREDTYPE_USERPASS_PLAINTEXT = 1,
} git_credtype_t;

/* The base structure for all credential types */
typedef struct git_cred {
	git_credtype_t credtype;
	void (*free)(
		struct git_cred *cred);
} git_cred;

/* A plaintext username and password */
typedef struct git_cred_userpass_plaintext {
	git_cred parent;
	char *username;
	char *password;
} git_cred_userpass_plaintext;

/**
 * Creates a new plain-text username and password credential object.
 * The supplied credential parameter will be internally duplicated.
 *
 * @param out The newly created credential object.
 * @param username The username of the credential.
 * @param password The password of the credential.
 * @return 0 for success or an error code for failure
 */
GIT_EXTERN(int) git_cred_userpass_plaintext_new(
	git_cred **out,
	const char *username,
	const char *password);

/**
 * Signature of a function which acquires a credential object.
 *
 * @param cred The newly created credential object.
 * @param url The resource for which we are demanding a credential.
 * @param allowed_types A bitmask stating which cred types are OK to return.
 * @param payload The payload provided when specifying this callback.
 * @return 0 for success or an error code for failure
 */
typedef int (*git_cred_acquire_cb)(
	git_cred **cred,
	const char *url,
	unsigned int allowed_types,
	void *payload);

/*
{'fraction_non_alphanumeric': 0.08419421487603305, 'fraction_numerical': 0.0030991735537190084, 'mean_word_length': 4.454929577464789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1969563', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1154, 'n_words': 438}