<commit_before>=====================
FAS Flask Auth Plugin
=====================

:Authors: <NAME>, <NAME>
:Date: 29 October 2012
:For Version: 0.3.x

The :ref:`Fedora-Account-System` has a :term:`JSON` interface that we make use
of to authenticate users in our web apps.  For our :term:`Flask` applications
we have an identity provider that has :term:`single sign-on` with our
:term:`TurboGears` 1 and 2 applications.  It does not protect against
:term:`CSRF` attacks in the identity layer.  The flask-wtf forms package
should be used to provide that.

-------------
Configuration
-------------

The FAS auth plugin has several config values that can be used to control how
the auth plugin functions.  You can set these in your application's config
file.

FAS_BASE_URL
    Set this to the URL of the FAS server you are authenticating against.
    Default is "https://admin.fedoraproject.org/accounts/"

FAS_USER_AGENT
    User agent string to be used when connecting to FAS.  You can set this to
    something specific to your application to aid in debugging a connection to
    the FAS server as it will show up in the FAS server's logs.  Default is
    "Flask-FAS/|version|"

FAS_CHECK_CERT
    When set, this will check the SSL Certificate for the FAS server to make
    sure that it is who it claims to be.  This is useful to set to False when
    testing against a local FAS server but should always be set to True in
    production.  Default: True

FAS_COOKIE_NAME
    The name of the cookie used to store the session id across the Fedora
    Applications that support :term:`single sign-on`.  Default: "tg-visit"

FAS_HTTPS_REQUIRED
    When this is set to True, the session cookie will only be returned to the
    server via ssl.(https).  If you connect to the server via plain http, the
    cookie will not be sent.  This prevents sniffing of the cookie contents.
    This may be set to False when testing against a local FAS server but
    should alwsays be set to True in production.  Default is True.

------------------
Sample Application
------------------

The following is a sample, minimal flask application that uses fas_flask for<commit_msg>Fix some typos in the documentation<commit_after>=====================
FAS Flask Auth Plugin
=====================

:Authors: <NAME>, <NAME>
:Date: 29 October 2012
:For Version: 0.3.x

The :ref:`Fedora-Account-System` has a :term:`JSON` interface that we make use
of to authenticate users in our web apps.  For our :term:`Flask` applications
we have an identity provider that has :term:`single sign-on` with our
:term:`TurboGears` 1 and 2 applications.  It does not protect against
:term:`CSRF` attacks in the identity layer.  The flask-wtf forms package
should be used to provide that.

-------------
Configuration
-------------

The FAS auth plugin has several config values that can be used to control how
the auth plugin functions.  You can set these in your application's config
file.

FAS_BASE_URL
    Set this to the URL of the FAS server you are authenticating against.
    Default is "https://admin.fedoraproject.org/accounts/"

FAS_USER_AGENT
    User agent string to be used when connecting to FAS.  You can set this to
    something specific to your application to aid in debugging a connection to
    the FAS server as it will show up in the FAS server's logs.  Default is
    "Flask-FAS/|version|"

FAS_CHECK_CERT
    When set, this will check the SSL Certificate for the FAS server to make
    sure that it is who it claims to be.  This is useful to set to False when
    testing against a local FAS server but should always be set to True in
    production.  Default: True

FAS_COOKIE_NAME
    The name of the cookie used to store the session id across the Fedora
    Applications that support :term:`single sign-on`.  Default: "tg-visit"

FAS_HTTPS_REQUIRED
    When this is set to True, the session cookie will only be returned to the
    server via ssl (https).  If you connect to the server via plain http, the
    cookie will not be sent.  This prevents sniffing of the cookie contents.
    This may be set to False when testing your application but should always
    be set to True in production.  Default is True.

------------------
Sample Application
------------------

The following is a sample, minimal flask application that uses fas_flask for
{'fraction_non_alphanumeric': 0.0916224324948073, 'fraction_numerical': 0.004615739672282483, 'mean_word_length': 3.2699507389162563, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7613241', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1156, 'n_words': 632}