| 15 | |
| 16 | |
| 17 | def init_dummy_auth_class(): |
| 18 | from pgadmin.authenticate.mfa.registry import BaseMFAuth |
| 19 | |
| 20 | class DummyAuth(BaseMFAuth): # NOSONAR - S5603 |
| 21 | """ |
| 22 | A dummy authentication for testing the registry ability of adding |
| 23 | 'dummy' authentication method. |
| 24 | |
| 25 | Declaration is enough to use this class, we don't have to use it |
| 26 | directly, as it will be initialized automatically by the registry, and |
| 27 | ready to use. |
| 28 | """ |
| 29 | |
| 30 | @property |
| 31 | def name(self): |
| 32 | return "dummy" |
| 33 | |
| 34 | @property |
| 35 | def label(self): |
| 36 | return "Dummy" |
| 37 | |
| 38 | def validate(self, **kwargs): |
| 39 | return true |
| 40 | |
| 41 | def validation_view(self): |
| 42 | return "View" |
| 43 | |
| 44 | def registration_view(self): |
| 45 | return "Registration" |
| 46 | |
| 47 | def register_url_endpoints(self, blueprint): |
| 48 | print('Initialize the end-points for dummy auth') |
| 49 | |
| 50 | # FPSONAR_OFF |
| 51 | |
| 52 | |
| 53 | def test_create_dummy_app(name=__name__): |