MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / add_external_user

Method add_external_user

web/setup.py:345–368  ·  view source on GitHub ↗

Add external user, other than Internal like Ldap, Ouath2, Kerberos, Webserver.

(username: str,
                          auth_source: AuthExtTypes = AuthExtTypes.oauth2,
                          email: Optional[str] = None,
                          admin: Annotated[Optional[bool],
                                           typer.Option("--admin")] = False,
                          role: Optional[str] = None,
                          active: Annotated[Optional[bool],
                                            typer.Option(
                                                "--active/--inactive")] = True,
                          console: Optional[bool] = True,
                          json: Optional[bool] = False,
                          sqlite_path: Optional[str] = None,
                          )

Source from the content-addressed store, hash-verified

343 @app.command()
344 @update_sqlite_path
345 def add_external_user(username: str,
346 auth_source: AuthExtTypes = AuthExtTypes.oauth2,
347 email: Optional[str] = None,
348 admin: Annotated[Optional[bool],
349 typer.Option("--admin")] = False,
350 role: Optional[str] = None,
351 active: Annotated[Optional[bool],
352 typer.Option(
353 "--active/--inactive")] = True,
354 console: Optional[bool] = True,
355 json: Optional[bool] = False,
356 sqlite_path: Optional[str] = None,
357 ):
358 """Add external user, other than Internal like
359 Ldap, Ouath2, Kerberos, Webserver. """
360
361 data = {
362 'username': username,
363 'email': email,
364 'role': 'Administrator' if admin else role,
365 'active': active,
366 'auth_source': auth_source
367 }
368 ManageUsers.create_user(data, console, json)
369
370 @app.command()
371 @update_sqlite_path

Callers

nothing calls this directly

Calls 1

create_userMethod · 0.80

Tested by

no test coverage detected