Add form authentication info to docs

Validate the value of the auth-type parameter and remove the
'unexpected value' fallback.

Change-Id: Idbc70251e27ea760c03df585df3ca6b469c4e163
This commit is contained in:
James E. Blair 2016-04-29 20:32:28 -05:00
parent ccc5baaf9e
commit e5f37b6796
3 changed files with 5 additions and 9 deletions

View File

@ -73,9 +73,8 @@ line.
in the Gerrit web interface. in the Gerrit web interface.
**auth-type** **auth-type**
Authentication type required by the Gerrit server. Can be 'basic' Authentication type required by the Gerrit server. Can be 'basic',
or 'digest'. Defaults to 'digest' if not set or set to an 'digest', or 'form'. Defaults to 'digest'.
unexpected value.
**git-root (required)** **git-root (required)**
A location where Gertty should store its git repositories. These A location where Gertty should store its git repositories. These

View File

@ -23,8 +23,8 @@ servers:
# username: CHANGEME # username: CHANGEME
# Your password in Gerrit (Settings -> HTTP Password). [required] # Your password in Gerrit (Settings -> HTTP Password). [required]
# password: CHANGEME # password: CHANGEME
# Authentication type required by the Gerrit server. Can be 'basic', 'digest' or # Authentication type required by the Gerrit server. Can be 'basic',
# 'form'. Defaults to 'digest' if not set or set to an unexpected value. # 'digest', or 'form'. Defaults to 'digest'.
# auth-type: digest # auth-type: digest
# A location where Gertty should store its git repositories. These # A location where Gertty should store its git repositories. These
# can be the same git repositories where you do your own work -- # can be the same git repositories where you do your own work --

View File

@ -49,7 +49,7 @@ class ConfigSchema(object):
'git-url': str, 'git-url': str,
'log-file': str, 'log-file': str,
'socket': str, 'socket': str,
'auth-type': str, 'auth-type': v.Any('basic', 'digest', 'form'),
} }
servers = [server] servers = [server]
@ -165,9 +165,6 @@ class Config(object):
"Permissions are: {}".format(self.path, oct(mode))) "Permissions are: {}".format(self.path, oct(mode)))
exit(1) exit(1)
self.auth_type = server.get('auth-type', 'digest') self.auth_type = server.get('auth-type', 'digest')
auth_types = ['digest', 'basic', 'form']
if self.auth_type not in auth_types:
self.auth_type = 'digest'
self.verify_ssl = server.get('verify-ssl', True) self.verify_ssl = server.get('verify-ssl', True)
if not self.verify_ssl: if not self.verify_ssl:
os.environ['GIT_SSL_NO_VERIFY']='true' os.environ['GIT_SSL_NO_VERIFY']='true'