"Fossies" - the Fresh Open Source Software Archive

Member "mod_auth_gssapi-1.6.3/tests/t_basic_k5_two_users.py" (15 May 2020, 818 Bytes) of package /linux/www/apache_httpd_modules/mod_auth_gssapi-1.6.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "t_basic_k5_two_users.py": 1.6.2_vs_1.6.3.

    1 #!/usr/bin/env python
    2 # Copyright (C) 2015 - mod_auth_gssapi contributors, see COPYING for license.
    3 
    4 import os
    5 
    6 import requests
    7 
    8 
    9 if __name__ == '__main__':
   10     s = requests.Session()
   11 
   12     url = 'http://%s:%s@%s/basic_auth_krb5/' % \
   13           (os.environ['MAG_USER_NAME'],
   14            os.environ['MAG_USER_PASSWORD'],
   15            os.environ['NSS_WRAPPER_HOSTNAME'])
   16     r = s.get(url)
   17     if r.status_code != 200:
   18         raise ValueError('Basic Auth Failed')
   19 
   20     url = 'http://%s:%s@%s/basic_auth_krb5/' % \
   21           (os.environ['MAG_USER_NAME_2'],
   22            os.environ['MAG_USER_PASSWORD_2'],
   23            os.environ['NSS_WRAPPER_HOSTNAME'])
   24     r2 = s.get(url)
   25     if r2.status_code != 200:
   26         raise ValueError('Basic Auth failed')
   27 
   28     if r.text == r2.text:
   29         raise ValueError('Basic Auth fatal error')