<commit_before>package com.albroco.barebonesdigest;

import java.util.EnumSet;
import java.util.Set;
import java.util.regex.Pattern;

/**
 * Represents a HTTP digest challenge, as sent from the server to the client in a {@code
 * WWW-Authenticate} HTTP header.
 *
 * <h2>Parsing the {@code WWW-Authenticate} header</h2>
 *
 * When the server receives a request that requires authorization it can respond with response
 * code 401 and include a {@code WWW-Authenticate} response header. The header includes one or more
 * challenges, some of which may be HTTP Digest challenges.
 * <p>
 * To parse a HTTP Digest challenge pass it to the {@link #parse(String)} method. Note that the
 * HTTP Digest challenge must first be extracted from the header value if the header contains
 * multiple challenges.
 *
 * <h2>Quoted and unquoted values</h2>
 *
 * Where applicable there are two getters for each directive, one for the quoted value (exactly
 * as it appears in the challenge), and one for the unquoted value (with escape sequences parsed
 * and surrounding quotes removed). Quoting is defined in
 * <a href="https://tools.ietf.org/html/rfc2616#section-2.2"> RFC 2616, Section 2.2</a>.
 *
 * <h2>Thread safety</h2>
 *
 * This class is not thread safe.
 *
 * <h2>Limitations</h2>
 *
 * All values are parsed but not all values are stored. In particular, the following is not stored:
 *
 * <ul>
 * <li>The values of the {@code realm} directive.</li>
 * <li>Unrecognized directives.</li>
 * <li>Supported "quality of protection" values except for the standard ones, "auth" and
 * "auth-int".</li>
 * </ul>
 *
 * @see <a href="https://tools.ietf.org/html/rfc2617#section-3.2.1">RFC 2617, Section 3.2.1, The
 * WWW-Authenticate Response Header</a>
 * @see <a href="https://tools.ietf.org/html/rfc2616#section-14.47">RFC 7235, Section 14.47,
 * WWW-Authenticate</a>
 */
public class DigestChallenge {
  /**
   * Enumeration of the various types of quality of protection.
   */
  public enum QualityOfProtection {
    /**
     * Indicates authentication ({@code auth}) quality of protection.
     */
    AUTH("auth"),<commit_msg>Fix typo in DigestChallenge jdoc (realm instead of domain)<commit_after>package com.albroco.barebonesdigest;

import java.util.EnumSet;
import java.util.Set;
import java.util.regex.Pattern;

/**
 * Represents a HTTP digest challenge, as sent from the server to the client in a {@code
 * WWW-Authenticate} HTTP header.
 *
 * <h2>Parsing the {@code WWW-Authenticate} header</h2>
 *
 * When the server receives a request that requires authorization it can respond with response
 * code 401 and include a {@code WWW-Authenticate} response header. The header includes one or more
 * challenges, some of which may be HTTP Digest challenges.
 * <p>
 * To parse a HTTP Digest challenge pass it to the {@link #parse(String)} method. Note that the
 * HTTP Digest challenge must first be extracted from the header value if the header contains
 * multiple challenges.
 *
 * <h2>Quoted and unquoted values</h2>
 *
 * Where applicable there are two getters for each directive, one for the quoted value (exactly
 * as it appears in the challenge), and one for the unquoted value (with escape sequences parsed
 * and surrounding quotes removed). Quoting is defined in
 * <a href="https://tools.ietf.org/html/rfc2616#section-2.2"> RFC 2616, Section 2.2</a>.
 *
 * <h2>Thread safety</h2>
 *
 * This class is not thread safe.
 *
 * <h2>Limitations</h2>
 *
 * All values are parsed but not all values are stored. In particular, the following is not stored:
 *
 * <ul>
 * <li>The values of the {@code domain} directive.</li>
 * <li>Unrecognized directives.</li>
 * <li>Supported "quality of protection" values except for the standard ones, "auth" and
 * "auth-int".</li>
 * </ul>
 *
 * @see <a href="https://tools.ietf.org/html/rfc2617#section-3.2.1">RFC 2617, Section 3.2.1, The
 * WWW-Authenticate Response Header</a>
 * @see <a href="https://tools.ietf.org/html/rfc2616#section-14.47">RFC 7235, Section 14.47,
 * WWW-Authenticate</a>
 */
public class DigestChallenge {
  /**
   * Enumeration of the various types of quality of protection.
   */
  public enum QualityOfProtection {
    /**
     * Indicates authentication ({@code auth}) quality of protection.
     */
    AUTH("auth"),
{'fraction_non_alphanumeric': 0.11572561829211386, 'fraction_numerical': 0.024731684554363042, 'mean_word_length': 3.866061293984109, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 6, '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': '5830625', 'n_tokens_mistral': 1380, 'n_tokens_neox': 1305, 'n_words': 493}