OpenQuizz
Une application de gestion des contenus pédagogiques
|
Functions | |
def | parse_resources (resources) |
def | get_regexp_pattern (regexp) |
def | get_cors_origins (options, request_origin) |
def | get_allow_headers (options, acl_request_headers) |
def | get_cors_headers (options, request_headers, request_method) |
def | set_cors_headers (resp, options) |
def | probably_regex (maybe_regex) |
def | re_fix (reg) |
def | try_match_any (inst, patterns) |
def | try_match (request_origin, maybe_regex) |
def | get_cors_options (appInstance, *dicts) |
def | get_app_kwarg_dict (appInstance=None) |
def | flexible_str (obj) |
def | serialize_option (options_dict, key, upper=False) |
def | ensure_iterable (inst) |
def | sanitize_regex_param (param) |
def | serialize_options (opts) |
Variables | |
LOG | |
ACL_ORIGIN | |
ACL_METHODS | |
ACL_ALLOW_HEADERS | |
ACL_EXPOSE_HEADERS | |
ACL_CREDENTIALS | |
ACL_MAX_AGE | |
ACL_REQUEST_METHOD | |
ACL_REQUEST_HEADERS | |
ALL_METHODS | |
CONFIG_OPTIONS | |
FLASK_CORS_EVALUATED | |
RegexObject | |
DEFAULT_OPTIONS | |
origins | |
methods = ALL_METHODS, | |
string | allow_headers = '*', |
expose_headers = None, | |
bool | supports_credentials = False, |
max_age = None, | |
bool | send_wildcard = False, |
bool | automatic_options = True, |
bool | vary_header = True, |
string | resources = r'/*', |
bool | intercept_exceptions = True, |
bool | always_send = True) |
def flask_cors.core.ensure_iterable | ( | inst | ) |
Wraps scalars or string types as a list, or returns the iterable instance.
def flask_cors.core.flexible_str | ( | obj | ) |
A more flexible str function which intelligently handles stringifying strings, lists and other iterables. The results are lexographically sorted to ensure generated responses are consistent when iterables such as Set are used.
def flask_cors.core.get_allow_headers | ( | options, | |
acl_request_headers | |||
) |
def flask_cors.core.get_app_kwarg_dict | ( | appInstance = None | ) |
Returns the dictionary of CORS specific app configurations.
def flask_cors.core.get_cors_headers | ( | options, | |
request_headers, | |||
request_method | |||
) |
def flask_cors.core.get_cors_options | ( | appInstance, | |
* | dicts | ||
) |
Compute CORS options for an application by combining the DEFAULT_OPTIONS, the app's configuration-specified options and any dictionaries passed. The last specified option wins.
def flask_cors.core.get_cors_origins | ( | options, | |
request_origin | |||
) |
def flask_cors.core.get_regexp_pattern | ( | regexp | ) |
Helper that returns regexp pattern from given value. :param regexp: regular expression to stringify :type regexp: _sre.SRE_Pattern or str :returns: string representation of given regexp pattern :rtype: str
def flask_cors.core.parse_resources | ( | resources | ) |
def flask_cors.core.probably_regex | ( | maybe_regex | ) |
def flask_cors.core.re_fix | ( | reg | ) |
Replace the invalid regex r'*' with the valid, wildcard regex r'/.*' to enable the CORS app extension to have a more user friendly api.
def flask_cors.core.sanitize_regex_param | ( | param | ) |
def flask_cors.core.serialize_option | ( | options_dict, | |
key, | |||
upper = False |
|||
) |
def flask_cors.core.serialize_options | ( | opts | ) |
A helper method to serialize and processes the options dictionary.
def flask_cors.core.set_cors_headers | ( | resp, | |
options | |||
) |
Performs the actual evaluation of Flas-CORS options and actually modifies the response object. This function is used both in the decorator and the after_request callback
def flask_cors.core.try_match | ( | request_origin, | |
maybe_regex | |||
) |
Safely attempts to match a pattern or string to a request origin.
def flask_cors.core.try_match_any | ( | inst, | |
patterns | |||
) |
ACL_ALLOW_HEADERS |
ACL_CREDENTIALS |
ACL_EXPOSE_HEADERS |
ACL_MAX_AGE |
ACL_METHODS |
ACL_ORIGIN |
ACL_REQUEST_HEADERS |
ACL_REQUEST_METHOD |
ALL_METHODS |
string allow_headers = '*', |
bool always_send = True) |
bool automatic_options = True, |
CONFIG_OPTIONS |
DEFAULT_OPTIONS |
expose_headers = None, |
FLASK_CORS_EVALUATED |
bool intercept_exceptions = True, |
LOG |
max_age = None, |
methods = ALL_METHODS, |
origins |
RegexObject |
string resources = r'/*', |
bool send_wildcard = False, |
bool supports_credentials = False, |
bool vary_header = True, |