<commit_before>const request = require('request-promise-native');

const mockTlsTermination = {
	'X-Forwarded-Proto': 'https',
};

module.exports = (hydraUrl) => {
	function get(flow, challenge) {
		const options = {
			uri: `${hydraUrl}/oauth2/auth/requests/${flow}/${challenge}`,
			headers: {
				...mockTlsTermination,
			},
			json: true,
		};
		return request(options);
	}

	function put(flow, action, challenge, body) {
		const options = {
			uri: `${hydraUrl}/oauth2/auth/requests/${flow}/${challenge}/${action}`,
			method: 'PUT',<commit_msg>update to new hydra http interface<commit_after>const request = require('request-promise-native');

const mockTlsTermination = {
	'X-Forwarded-Proto': 'https',
};

module.exports = (hydraUrl) => {
	function get(flow, challenge) {
		const options = {
			uri: `${hydraUrl}/oauth2/auth/requests/${flow}?${flow}_challenge=${challenge}`,
			headers: {
				...mockTlsTermination,
			},
			json: true,
		};
		return request(options);
	}

	function put(flow, action, challenge, body) {
		const options = {
			uri: `${hydraUrl}/oauth2/auth/requests/${flow}/${action}?${flow}_challenge=${challenge}`,
			method: 'PUT',
{'fraction_non_alphanumeric': 0.18636755823986195, 'fraction_numerical': 0.003451251078515962, 'mean_word_length': 4.420560747663552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '942830', 'n_tokens_mistral': 447, 'n_tokens_neox': 393, 'n_words': 70}