<commit_before>/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

/*
 * Copyright (c) 2015, Joyent, Inc.
 */

var drc = require('docker-registry-client');
var fmt = require('util').format;
var restify = require('restify');

var common = require('../common');
var errors = require('../errors');



/**
 * // JSSTYLED
 * http://docs.docker.com/reference/api/docker_remote_api_v1.18/#check-auth-configuration
 * POST /auth
 *
 * However, those docs don't accurately describe fully how `docker login`
 * uses the endpoint.
 *
 * Status Codes:
 *  401     Results in `docker login` removing those creds from ~/.dockercfg
 *  err     Any other error status code (<200, >=400) is returned.
 *  other   Any other status code (>=200, <400) is treated as success.
 *
 * Body:
 *  On successful status codes, a JSON body is parsed and any "Status" field
 *  string value will be printed.
 *<commit_msg>(doc) update comment to correct docker config file location for recent versions<commit_after>/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

/*
 * Copyright (c) 2015, Joyent, Inc.
 */

var drc = require('docker-registry-client');
var fmt = require('util').format;
var restify = require('restify');

var common = require('../common');
var errors = require('../errors');



/**
 * // JSSTYLED
 * http://docs.docker.com/reference/api/docker_remote_api_v1.18/#check-auth-configuration
 * POST /auth
 *
 * However, those docs don't accurately describe fully how `docker login`
 * uses the endpoint.
 *
 * Status Codes:
 *  401     Results in `docker login` removing those creds from
 *          ~/.docker/config.json
 *  err     Any other error status code (<200, >=400) is returned.
 *  other   Any other status code (>=200, <400) is treated as success.
 *
 * Body:
 *  On successful status codes, a JSON body is parsed and any "Status" field
 *  string value will be printed.
 *
{'fraction_non_alphanumeric': 0.12848651120256058, 'fraction_numerical': 0.02377686328303612, 'mean_word_length': 3.298624754420432, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4853724', 'n_tokens_mistral': 709, 'n_tokens_neox': 645, 'n_words': 259}