Validates that the defined secrets exist
439750
def validate_secrets
      validate_each :secrets do |s|
        secret = self.grid.grid_secrets.find_by(name: s[:secret])
        unless secret
          [:not_found, "Secret #{s[:secret]} does not exist"]
        else
          nil
        end
      end
    end
610161
def _validate_information(self):
        """"""

        needed_variables = ["ModuleName", "ModuleVersion", "APIVersion"]

        for var in needed_variables:
            if var not in self.variables:
                raise DataError("Needed variable was not defined in mib file.", variable=var)

        # Make sure ModuleName is <= 6 characters
        if len(self.variables["ModuleName"]) > 6:
            raise DataError("ModuleName too long, must be 6 or fewer characters.",
                            module_name=self.variables["ModuleName"])

        if not isinstance(self.variables["ModuleVersion"], str):
            raise ValueError("ModuleVersion ('%s') must be a string of the form X.Y.Z" %
                             str(self.variables['ModuleVersion']))

        if not isinstance(self.variables["APIVersion"], str):
            raise ValueError("APIVersion ('%s') must be a string of the form X.Y" % str(self.variables['APIVersion']))

        self.variables['ModuleVersion'] = self._convert_module_version(self.variables["ModuleVersion"])
        self.variables['APIVersion'] = self._convert_api_version(self.variables["APIVersion"])
        self.variables["ModuleName"] = self.variables["ModuleName"].ljust(6)

        self.valid = True
137762
def validate(self, r):
        '''
        
        '''
        if self.show_invalid:
            r.valid = True
        elif r.valid:
            if not r.description:
                r.valid = False

            if r.size and (r.size + r.offset) > r.file.size:
                r.valid = False

            if r.jump and (r.jump + r.offset) > r.file.size:
                r.valid = False

            if hasattr(r, "location") and (r.location != r.offset):
                r.valid = False

        if r.valid:
            # Don't keep displaying signatures that repeat a bunch of times
            # (e.g., JFFS2 nodes)
            if r.id == self.one_of_many:
                r.display = False
            elif r.many:
                self.one_of_many = r.id
            else:
                self.one_of_many = None
275249
def validate(self):
        
        if (self.scheme is None or self.scheme != '') \
          and (self.host is None or self.host == ''):
            return False
        return True
894916
def validate_settings(settings):
    
    from django.core.exceptions import ImproperlyConfigured
    if settings.SECRET_KEY == '':
        msg = 'settings.SECRET_KEY cannot be blank! Check your local settings'
        if not settings.DEBUG:
            raise ImproperlyConfigured(msg)

    if getattr(settings, 'SESSION_COOKIE_SECURE', None) is None:
        msg = ('settings.SESSION_COOKIE_SECURE should be set to True; '
               'otherwise, your session ids can be intercepted over HTTP!')
        if not settings.DEBUG:
            raise ImproperlyConfigured(msg)

    hmac = getattr(settings, 'HMAC_KEYS', {})
    if not len(hmac.keys()):
        msg = 'settings.HMAC_KEYS cannot be empty! Check your local settings'
        if not settings.DEBUG:
            raise ImproperlyConfigured(msg)
386398
function verifyOthers() {
      if ( !isTypeString(options.commit) ) {
        errorOption('commit', options.commit);
      }
      if ( !isTypeString(options.tag) ) {
        errorOption('tag', options.tag);
      }
    }
536970
def is_secret_known(
        end_state: NettingChannelEndState,
        secrethash: SecretHash,
) -> bool:
    """"""
    return (
        secrethash in end_state.secrethashes_to_unlockedlocks or
        secrethash in end_state.secrethashes_to_onchain_unlockedlocks
    )
949405
def validate(self):
        """"""
        missing = []
        for k, v in self._map.items():
            attr = getattr(self, k, False)
            if not attr or attr == CONFIG_PLACEHOLDER:
                missing.append(v)
        if missing:
            return "Missing or invalid config values: {}".format(
                ", ".join(sorted(missing))
            )
816881
def _verify_validates(self, spec, path):
        """"""
        validates = spec['validates']

        if isinstance(validates, list):
            for validator in validates:
                self._verify_validator(validator, path)
        else:
            self._verify_validator(validates, path)
58457
def secretfile_args(parser):
    """"""
    parser.add_argument('--secrets',
                        dest='secrets',
                        help='Path where secrets are stored',
                        default=os.path.join(os.getcwd(), ".secrets"))
    parser.add_argument('--policies',
                        dest='policies',
                        help='Path where policies are stored',
                        default=os.path.join(os.getcwd(), "vault", ""))
    parser.add_argument('--secretfile',
                        dest='secretfile',
                        help='Secretfile to use',
                        default=os.path.join(os.getcwd(), "Secretfile"))
    parser.add_argument('--tags',
                        dest='tags',
                        help='Tags of things to seed',
                        default=[],
                        type=str,
                        action='append')
    parser.add_argument('--include',
                        dest='include',
                        help='Specify paths to include',
                        default=[],
                        type=str,
                        action='append')
    parser.add_argument('--exclude',
                        dest='exclude',
                        help='Specify paths to exclude',
                        default=[],
                        type=str,
                        action='append')
1086598
function validateParamsPresent(expectedKeys, params) {
  params = params || {};
  var paramKeys = _.keys(params);
  return _.first(_.difference(expectedKeys, _.intersection(paramKeys, expectedKeys)));
}
885314
def _redact_secret(
        data: Union[Dict, List],
) -> Union[Dict, List]:
    

    if isinstance(data, dict):
        stack = [data]
    else:
        stack = []

    while stack:
        current = stack.pop()

        if 'secret' in current:
            current['secret'] = '<redacted>'
        else:
            stack.extend(
                value
                for value in current.values()
                if isinstance(value, dict)
            )

    return data
1151365
def Validate(self):
    """"""
    ValidateMultiple(self.probe, "Method has invalid probes")
    Validate(self.target, "Method has invalid target")
    Validate(self.hint, "Method has invalid hint")
952855
function validate () {
    if (exec('npm whoami') !== 'angular') {
      err('You must be authenticated with npm as "angular" to perform a release.');
    } else if (exec('git rev-parse --abbrev-ref HEAD') !== 'staging') {
      err('Releases can only performed from "staging" at this time.');
    } else {
      return true;
    }
    function err (msg) {
      const str = 'Error: ' + msg;
      log(str.red);
    }
  }
198380
def postproc(self):
        """"""
        secrets_files = [
            "/etc/openstack_deploy/user_secrets.yml",
            "/etc/rpc_deploy/user_secrets.yml"
        ]
        regexp = r"(?m)^\s*#*([\w_]*:\s*).*"
        for secrets_file in secrets_files:
            self.do_path_regex_sub(
                secrets_file,
                regexp,
                r"\1*********")
1342514
def validate(self):
        
        errors = []
        for param in self.required_params:
            if (not hasattr(self, param) or getattr(self, param) is None):
                errors.append("missing %s parameter" % (param))
        if (len(errors) > 0):
            raise IIIFInfoError("Bad data for info.json: " + ", ".join(errors))
        return True
334109
def ensure_secret():
    """"""
    home_dir = os.environ['HOME']
    file_name = home_dir + "/.ipcamweb"
    if os.path.exists(file_name):
        with open(file_name, "r") as s_file:
            secret = s_file.readline()
    else:
        secret = os.urandom(24)
        with open(file_name, "w") as s_file:
            secret = s_file.write(secret+"\n")
    return secret