<commit_before>var validator = require('is-my-json-valid');
var debug     = require('debug')('validate');

/** Return JSON schema construct for a constant */
var constant = function(value) {
  return {enum: [value]};
};

// Schema to validate against, note that we filter additionalProperties away
// during validation. So if a property is mentioned here it must satisfy the
// requirements here, or the proxy will return 403 forbidden. If not mentioned
// here the property will be filtered away and not included in the result.
var schema = {
  type:                   'object',
  properties: {
    // Properties always allowed regardless of their value
    Hostname:             {},
    Domainname:           {},
    User:                 {},
    Memory:               {},
    MemorySwap:           {},
    CpuShares:            {},
    Cpuset:               {},
    AttachStdin:          {},
    AttachStdout:         {},
    AttachStderr:         {},
    Tty:                  {},
    OpenStdin:            {},
    StdinOnce:            {},
    Env:                  {},
    Cmd:                  {},
    Entrypoint:           {},
    Image:                {},
    WorkingDir:           {},
    NetworkDisabled:      {},
    // Undocumented properties we always allow regardless of their value
    OnBuild:              {},

    // Properties we are a bit more careful about
    MacAddress:           constant(''),
    Volumes:              constant({}),     // TODO: Allow more here
    ExposedPorts:         constant({}),     // TODO: Allow more here
    SecurityOpts:         constant(null),
    HostConfig: {
      type:               'object',
      properties: {
        // Properties to be very careful with
        Binds:            constant(null),   // TODO: Allow more here
        Links:            {}, // Allow links to other containers
        LxcConf:          constant([]),
        PortBindings:     constant({}),<commit_msg>Allow null or [] in Binds<commit_after>var validator = require('is-my-json-valid');
var debug     = require('debug')('validate');

/** Return JSON schema construct for a constant */
var constant = function(value) {
  return {enum: [value]};
};

// Schema to validate against, note that we filter additionalProperties away
// during validation. So if a property is mentioned here it must satisfy the
// requirements here, or the proxy will return 403 forbidden. If not mentioned
// here the property will be filtered away and not included in the result.
var schema = {
  type:                   'object',
  properties: {
    // Properties always allowed regardless of their value
    Hostname:             {},
    Domainname:           {},
    User:                 {},
    Memory:               {},
    MemorySwap:           {},
    CpuShares:            {},
    Cpuset:               {},
    AttachStdin:          {},
    AttachStdout:         {},
    AttachStderr:         {},
    Tty:                  {},
    OpenStdin:            {},
    StdinOnce:            {},
    Env:                  {},
    Cmd:                  {},
    Entrypoint:           {},
    Image:                {},
    WorkingDir:           {},
    NetworkDisabled:      {},
    // Undocumented properties we always allow regardless of their value
    OnBuild:              {},

    // Properties we are a bit more careful about
    MacAddress:           constant(''),
    Volumes:              constant({}),     // TODO: Allow more here
    ExposedPorts:         constant({}),     // TODO: Allow more here
    SecurityOpts:         constant(null),
    HostConfig: {
      type:               'object',
      properties: {
        // Properties to be very careful with
        Binds:            constant([null,[]]),   // TODO: Allow more here
        Links:            {}, // Allow links to other containers
        LxcConf:          constant([]),
        PortBindings:     constant({}),
{'fraction_non_alphanumeric': 0.1088348271446863, 'fraction_numerical': 0.0015364916773367477, 'mean_word_length': 1.54296875, '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': '855247', 'n_tokens_mistral': 962, 'n_tokens_neox': 929, 'n_words': 319}