Package coprs :: Package views :: Module misc
[hide private]
[frames] | no frames]

Module misc

source code

Functions [hide private]
 
fed_openidize_name(name)
Create proper Fedora OpenID name from short name.
source code
 
create_user_wrapper(username, email, timezone=None) source code
 
fed_raw_name(oidname) source code
 
krb_straighten_username(krb_remote_user) source code
 
set_empty_user() source code
 
lookup_current_user() source code
 
page_not_found(message) source code
 
access_restricted(message) source code
 
generic_error(message, code=500, title=None)
:type message: str :type err: CoprHttpException
source code
 
krb5_login(name)
Handle the Kerberos authentication.
source code
 
login(*args, **kwargs) source code
 
create_or_login(resp) source code
 
logout() source code
 
api_login_required(f) source code
 
login_required(role=0) source code
 
backend_authenticated(f) source code
 
intranet_required(f) source code
 
req_with_copr(f) source code
 
coprs_migration_report(username=None) source code
 
group_coprs_migration_report(group_name=None) source code
 
render_migration_report(coprs, user=None, group=None) source code
Variables [hide private]
  server_error_handler = partial(generic_error, code= 500, title...
  bad_request_handler = partial(generic_error, code= 400, title=...
  misc = flask.Blueprint("misc", __name__)
  __package__ = 'coprs.views'
Function Details [hide private]

fed_openidize_name(name)

source code 

Create proper Fedora OpenID name from short name.

>>> fedoraoid == fed_openidize_name(user.name)
True

set_empty_user()

source code 
Decorators:
  • @app.before_request

lookup_current_user()

source code 
Decorators:
  • @app.before_request

page_not_found(message)

source code 
Decorators:
  • @app.errorhandler(404)

access_restricted(message)

source code 
Decorators:
  • @app.errorhandler(403)

krb5_login(name)

source code 

Handle the Kerberos authentication.

Note that if we are able to get here, either the user is authenticated correctly, or apache is mis-configured and it does not perform KRB authentication at all. Note also, even if that can be considered ugly, we are reusing oid's get_next_url feature with kerberos login.

Decorators:
  • @misc.route(app.config ['KRB5_LOGIN_BASEURI']+ "/", methods= ["GET"])

login(*args, **kwargs)

source code 
Decorators:
  • @misc.route("/login/", methods= ["GET"])
  • @oid.loginhandler

create_or_login(resp)

source code 
Decorators:
  • @oid.after_login

logout()

source code 
Decorators:
  • @misc.route("/logout/")

coprs_migration_report(username=None)

source code 
Decorators:
  • @misc.route("/migration-report/")
  • @misc.route("/migration-report/")

group_coprs_migration_report(group_name=None)

source code 
Decorators:
  • @misc.route("/migration-report/g/")

Variables Details [hide private]

server_error_handler

Value:
partial(generic_error, code= 500, title= "Internal Server Error")

bad_request_handler

Value:
partial(generic_error, code= 400, title= "Bad Request")