示例#1
0
def validate_settings_config(config, context):
    if config.HasField('mp_server'):
        if not validation.is_valid_secure_url(config.mp_server):
            context.error(
                'mp_server must start with "https://" or "http://localhost"')
示例#2
0
def _validate_url(ctx, value):
  if not value:
    ctx.error('is not set')
  elif not validation.is_valid_secure_url(value):
    ctx.error('must start with "https://" or "http://localhost"')