MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / _pg_csrf_exempt

Method _pg_csrf_exempt

web/pgadmin/utils/csrf.py:22–49  ·  view source on GitHub ↗

Exempt some of the Views/blueprints from CSRF protection

(self, app)

Source from the content-addressed store, hash-verified

20 self._pg_csrf_exempt(app)
21
22 def _pg_csrf_exempt(self, app):
23 """Exempt some of the Views/blueprints from CSRF protection
24 """
25
26 exempt_views = [
27 'flask.app.<lambda>',
28 'flask.scaffold.send_static_file', # For Flask 2.*
29 'flask.blueprints.send_static_file',
30 'flask_security.views.login',
31 'flask_security.views.logout',
32 'pgadmin.tools.translations',
33 app.blueprints['redirects'],
34 'pgadmin.browser.server_groups.servers.supported_servers-js',
35 'pgadmin.tools.sqleditor.initialize_sqleditor',
36 'pgadmin.tools.datagrid.panel',
37 'pgadmin.tools.sqleditor.panel',
38 'pgadmin.tools.debugger.initialize_target',
39 'pgadmin.tools.debugger.direct_new',
40 'pgadmin.tools.schema_diff.panel',
41 'pgadmin.tools.schema_diff.ddl_compare',
42 'pgadmin.authenticate.login',
43 'pgadmin.tools.erd.panel',
44 'pgadmin.tools.psql.panel',
45 'pgadmin.preferences.get_all_cli',
46 ]
47
48 for exempt in exempt_views:
49 self.exempt(exempt)
50
51
52pgCSRFProtect = _PGCSRFProtect()

Callers 1

init_appMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected