Get the authenticated source object from the registry
(type)
| 325 | |
| 326 | |
| 327 | def get_auth_sources(type): |
| 328 | """Get the authenticated source object from the registry""" |
| 329 | |
| 330 | auth_sources = getattr(current_app, '_pgadmin_auth_sources', None) |
| 331 | |
| 332 | if auth_sources is None or not isinstance(auth_sources, dict): |
| 333 | auth_sources = dict() |
| 334 | |
| 335 | if type in auth_sources: |
| 336 | return auth_sources[type] |
| 337 | |
| 338 | auth_source = AuthSourceRegistry.get(type) |
| 339 | |
| 340 | if auth_source is not None: |
| 341 | auth_sources[type] = auth_source |
| 342 | setattr(current_app, '_pgadmin_auth_sources', auth_sources) |
| 343 | |
| 344 | return auth_source |
| 345 | |
| 346 | |
| 347 | def init_app(app): |
no test coverage detected