@adonis-agora/authkit-server 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +158 -0
- package/build/assets/grafana/authkit-dashboard.json +118 -0
- package/build/commands/clients_create.d.ts +27 -0
- package/build/commands/clients_create.js +121 -0
- package/build/commands/commands.json +292 -0
- package/build/commands/configure.d.ts +2 -0
- package/build/commands/configure.js +45 -0
- package/build/commands/doctor.d.ts +10 -0
- package/build/commands/doctor.js +113 -0
- package/build/commands/eject.d.ts +11 -0
- package/build/commands/eject.js +96 -0
- package/build/commands/expire_scan.d.ts +28 -0
- package/build/commands/expire_scan.js +92 -0
- package/build/commands/import_users.d.ts +17 -0
- package/build/commands/import_users.js +80 -0
- package/build/commands/keys_rotate.d.ts +21 -0
- package/build/commands/keys_rotate.js +126 -0
- package/build/commands/main.d.ts +12 -0
- package/build/commands/main.js +38 -0
- package/build/commands/settings_get.d.ts +18 -0
- package/build/commands/settings_get.js +43 -0
- package/build/commands/settings_list.d.ts +17 -0
- package/build/commands/settings_list.js +39 -0
- package/build/commands/settings_set.d.ts +20 -0
- package/build/commands/settings_set.js +55 -0
- package/build/commands/settings_unset.d.ts +18 -0
- package/build/commands/settings_unset.js +46 -0
- package/build/commands/ui_preset.d.ts +4 -0
- package/build/commands/ui_preset.js +32 -0
- package/build/database/migrations/make_authkit_oidc_table.d.ts +6 -0
- package/build/database/migrations/make_authkit_oidc_table.js +19 -0
- package/build/host/ui/admin.html +29 -0
- package/build/host/views/account/apps.edge +59 -0
- package/build/host/views/account/confirm.edge +70 -0
- package/build/host/views/account/email-confirmed.edge +16 -0
- package/build/host/views/account/login.edge +33 -0
- package/build/host/views/account/mfa.edge +152 -0
- package/build/host/views/account/orgs.edge +58 -0
- package/build/host/views/account/security.edge +215 -0
- package/build/host/views/account/tokens.edge +75 -0
- package/build/host/views/consent.edge +20 -0
- package/build/host/views/forgot.edge +43 -0
- package/build/host/views/login.edge +251 -0
- package/build/host/views/maintenance.edge +32 -0
- package/build/host/views/mfa-challenge.edge +107 -0
- package/build/host/views/otp-unlock.edge +40 -0
- package/build/host/views/partials/styles.edge +2 -0
- package/build/host/views/reset.edge +30 -0
- package/build/host/views/signup.edge +62 -0
- package/build/host/views/verify-email.edge +17 -0
- package/build/index.d.ts +115 -0
- package/build/index.js +76 -0
- package/build/password/common_passwords.txt +10000 -0
- package/build/providers/authkit_server_provider.d.ts +27 -0
- package/build/providers/authkit_server_provider.js +242 -0
- package/build/src/accounts/account_store.d.ts +578 -0
- package/build/src/accounts/account_store.js +60 -0
- package/build/src/accounts/lucid_account_store.d.ts +156 -0
- package/build/src/accounts/lucid_account_store.js +294 -0
- package/build/src/accounts/lucid_store/core.d.ts +9 -0
- package/build/src/accounts/lucid_store/core.js +306 -0
- package/build/src/accounts/lucid_store/mfa.d.ts +15 -0
- package/build/src/accounts/lucid_store/mfa.js +108 -0
- package/build/src/accounts/lucid_store/organizations.d.ts +13 -0
- package/build/src/accounts/lucid_store/organizations.js +294 -0
- package/build/src/accounts/lucid_store/password_hygiene.d.ts +20 -0
- package/build/src/accounts/lucid_store/password_hygiene.js +130 -0
- package/build/src/accounts/lucid_store/provider_identity.d.ts +8 -0
- package/build/src/accounts/lucid_store/provider_identity.js +59 -0
- package/build/src/accounts/lucid_store/shared.d.ts +113 -0
- package/build/src/accounts/lucid_store/shared.js +130 -0
- package/build/src/accounts/lucid_store/status_profile.d.ts +34 -0
- package/build/src/accounts/lucid_store/status_profile.js +100 -0
- package/build/src/accounts/lucid_store/webauthn.d.ts +8 -0
- package/build/src/accounts/lucid_store/webauthn.js +140 -0
- package/build/src/accounts/lucid_stores.d.ts +45 -0
- package/build/src/accounts/lucid_stores.js +30 -0
- package/build/src/adapters/adapter_contract.d.ts +37 -0
- package/build/src/adapters/adapter_contract.js +1 -0
- package/build/src/adapters/database_adapter.d.ts +21 -0
- package/build/src/adapters/database_adapter.js +79 -0
- package/build/src/adapters/factory.d.ts +30 -0
- package/build/src/adapters/factory.js +43 -0
- package/build/src/adapters/redis_adapter.d.ts +24 -0
- package/build/src/adapters/redis_adapter.js +122 -0
- package/build/src/audit/audit_sink.d.ts +63 -0
- package/build/src/audit/audit_sink.js +1 -0
- package/build/src/audit/lucid_audit_sink.d.ts +10 -0
- package/build/src/audit/lucid_audit_sink.js +99 -0
- package/build/src/commands/expire_scan_command.d.ts +60 -0
- package/build/src/commands/expire_scan_command.js +229 -0
- package/build/src/commands/import_clients.d.ts +40 -0
- package/build/src/commands/import_clients.js +79 -0
- package/build/src/commands/import_users.d.ts +51 -0
- package/build/src/commands/import_users.js +94 -0
- package/build/src/commands/resolve_config.d.ts +13 -0
- package/build/src/commands/resolve_config.js +18 -0
- package/build/src/commands/settings_commands.d.ts +47 -0
- package/build/src/commands/settings_commands.js +270 -0
- package/build/src/controllers/oidc_callback_controller.d.ts +22 -0
- package/build/src/controllers/oidc_callback_controller.js +33 -0
- package/build/src/define_config.d.ts +772 -0
- package/build/src/define_config.js +351 -0
- package/build/src/doctor/checks.d.ts +197 -0
- package/build/src/doctor/checks.js +858 -0
- package/build/src/events/dispatcher.d.ts +45 -0
- package/build/src/events/dispatcher.js +117 -0
- package/build/src/host/account_api/account_api_controller.d.ts +245 -0
- package/build/src/host/account_api/account_api_controller.js +827 -0
- package/build/src/host/account_deletion_ops.d.ts +80 -0
- package/build/src/host/account_deletion_ops.js +118 -0
- package/build/src/host/account_deletion_service.d.ts +63 -0
- package/build/src/host/account_deletion_service.js +133 -0
- package/build/src/host/account_export_service.d.ts +76 -0
- package/build/src/host/account_export_service.js +140 -0
- package/build/src/host/account_home.d.ts +11 -0
- package/build/src/host/account_home.js +11 -0
- package/build/src/host/account_lockout.d.ts +86 -0
- package/build/src/host/account_lockout.js +185 -0
- package/build/src/host/active_org_cookie.d.ts +28 -0
- package/build/src/host/active_org_cookie.js +47 -0
- package/build/src/host/admin_api/admin_api_guard.d.ts +16 -0
- package/build/src/host/admin_api/admin_api_guard.js +59 -0
- package/build/src/host/admin_api/admin_orgs_service.d.ts +125 -0
- package/build/src/host/admin_api/admin_orgs_service.js +324 -0
- package/build/src/host/admin_api/admin_users_service.d.ts +163 -0
- package/build/src/host/admin_api/admin_users_service.js +308 -0
- package/build/src/host/admin_api/api_clients_controller.d.ts +54 -0
- package/build/src/host/admin_api/api_clients_controller.js +89 -0
- package/build/src/host/admin_api/api_keys_controller.d.ts +19 -0
- package/build/src/host/admin_api/api_keys_controller.js +36 -0
- package/build/src/host/admin_api/api_misc_controller.d.ts +19 -0
- package/build/src/host/admin_api/api_misc_controller.js +44 -0
- package/build/src/host/admin_api/api_orgs_controller.d.ts +108 -0
- package/build/src/host/admin_api/api_orgs_controller.js +189 -0
- package/build/src/host/admin_api/api_settings_controller.d.ts +55 -0
- package/build/src/host/admin_api/api_settings_controller.js +134 -0
- package/build/src/host/admin_api/api_users_controller.d.ts +108 -0
- package/build/src/host/admin_api/api_users_controller.js +187 -0
- package/build/src/host/admin_api/dto.d.ts +131 -0
- package/build/src/host/admin_api/dto.js +122 -0
- package/build/src/host/admin_api/token_verify_service.d.ts +34 -0
- package/build/src/host/admin_api/token_verify_service.js +74 -0
- package/build/src/host/admin_clients_service.d.ts +88 -0
- package/build/src/host/admin_clients_service.js +181 -0
- package/build/src/host/admin_console/admin_shell_controller.d.ts +27 -0
- package/build/src/host/admin_console/admin_shell_controller.js +167 -0
- package/build/src/host/admin_console/console_audit_controller.d.ts +17 -0
- package/build/src/host/admin_console/console_audit_controller.js +25 -0
- package/build/src/host/admin_console/console_clients_controller.d.ts +53 -0
- package/build/src/host/admin_console/console_clients_controller.js +102 -0
- package/build/src/host/admin_console/console_impersonation_controller.d.ts +23 -0
- package/build/src/host/admin_console/console_impersonation_controller.js +45 -0
- package/build/src/host/admin_console/console_keys_controller.d.ts +24 -0
- package/build/src/host/admin_console/console_keys_controller.js +41 -0
- package/build/src/host/admin_console/console_orgs_controller.d.ts +96 -0
- package/build/src/host/admin_console/console_orgs_controller.js +238 -0
- package/build/src/host/admin_console/console_overview_controller.d.ts +27 -0
- package/build/src/host/admin_console/console_overview_controller.js +44 -0
- package/build/src/host/admin_console/console_roles_controller.d.ts +31 -0
- package/build/src/host/admin_console/console_roles_controller.js +108 -0
- package/build/src/host/admin_console/console_sessions_controller.d.ts +91 -0
- package/build/src/host/admin_console/console_sessions_controller.js +125 -0
- package/build/src/host/admin_console/console_settings_controller.d.ts +47 -0
- package/build/src/host/admin_console/console_settings_controller.js +115 -0
- package/build/src/host/admin_console/console_users_controller.d.ts +110 -0
- package/build/src/host/admin_console/console_users_controller.js +212 -0
- package/build/src/host/admin_prefix.d.ts +50 -0
- package/build/src/host/admin_prefix.js +77 -0
- package/build/src/host/admin_sessions_service.d.ts +119 -0
- package/build/src/host/admin_sessions_service.js +284 -0
- package/build/src/host/admin_stats_service.d.ts +44 -0
- package/build/src/host/admin_stats_service.js +130 -0
- package/build/src/host/admin_validators.d.ts +247 -0
- package/build/src/host/admin_validators.js +197 -0
- package/build/src/host/augmentations.d.ts +12 -0
- package/build/src/host/augmentations.js +1 -0
- package/build/src/host/auth_host_config.d.ts +22 -0
- package/build/src/host/auth_host_config.js +13 -0
- package/build/src/host/avatar_storage.d.ts +68 -0
- package/build/src/host/avatar_storage.js +166 -0
- package/build/src/host/bot_protection.d.ts +187 -0
- package/build/src/host/bot_protection.js +132 -0
- package/build/src/host/branding.d.ts +19 -0
- package/build/src/host/branding.js +8 -0
- package/build/src/host/config_locks.d.ts +38 -0
- package/build/src/host/config_locks.js +70 -0
- package/build/src/host/console_session.d.ts +27 -0
- package/build/src/host/console_session.js +36 -0
- package/build/src/host/controllers/account_apps_controller.d.ts +15 -0
- package/build/src/host/controllers/account_apps_controller.js +61 -0
- package/build/src/host/controllers/account_confirm_controller.d.ts +24 -0
- package/build/src/host/controllers/account_confirm_controller.js +144 -0
- package/build/src/host/controllers/account_mfa_controller.d.ts +28 -0
- package/build/src/host/controllers/account_mfa_controller.js +208 -0
- package/build/src/host/controllers/account_orgs_controller.d.ts +80 -0
- package/build/src/host/controllers/account_orgs_controller.js +401 -0
- package/build/src/host/controllers/account_security_controller.d.ts +43 -0
- package/build/src/host/controllers/account_security_controller.js +546 -0
- package/build/src/host/controllers/account_session_controller.d.ts +21 -0
- package/build/src/host/controllers/account_session_controller.js +113 -0
- package/build/src/host/controllers/account_tokens_controller.d.ts +7 -0
- package/build/src/host/controllers/account_tokens_controller.js +67 -0
- package/build/src/host/controllers/interaction_controller.d.ts +125 -0
- package/build/src/host/controllers/interaction_controller.js +981 -0
- package/build/src/host/controllers/pat_introspection_controller.d.ts +22 -0
- package/build/src/host/controllers/pat_introspection_controller.js +46 -0
- package/build/src/host/controllers/registration_controller.d.ts +18 -0
- package/build/src/host/controllers/registration_controller.js +382 -0
- package/build/src/host/controllers/social_controller.d.ts +8 -0
- package/build/src/host/controllers/social_controller.js +89 -0
- package/build/src/host/csrf.d.ts +29 -0
- package/build/src/host/csrf.js +14 -0
- package/build/src/host/default_mailer.d.ts +112 -0
- package/build/src/host/default_mailer.js +417 -0
- package/build/src/host/durable/account_deletion_workflow.d.ts +48 -0
- package/build/src/host/durable/account_deletion_workflow.js +86 -0
- package/build/src/host/durable/account_export_workflow.d.ts +68 -0
- package/build/src/host/durable/account_export_workflow.js +93 -0
- package/build/src/host/durable/index.d.ts +68 -0
- package/build/src/host/durable/index.js +77 -0
- package/build/src/host/email_templates.d.ts +39 -0
- package/build/src/host/email_templates.js +69 -0
- package/build/src/host/geo.d.ts +22 -0
- package/build/src/host/geo.js +39 -0
- package/build/src/host/i18n.d.ts +1416 -0
- package/build/src/host/i18n.js +1583 -0
- package/build/src/host/impersonation.d.ts +25 -0
- package/build/src/host/impersonation.js +31 -0
- package/build/src/host/key_rotation.d.ts +14 -0
- package/build/src/host/key_rotation.js +27 -0
- package/build/src/host/key_rotation_actions.d.ts +42 -0
- package/build/src/host/key_rotation_actions.js +27 -0
- package/build/src/host/login_attempt.d.ts +98 -0
- package/build/src/host/login_attempt.js +211 -0
- package/build/src/host/login_notify.d.ts +27 -0
- package/build/src/host/login_notify.js +142 -0
- package/build/src/host/middleware/account_auth.d.ts +7 -0
- package/build/src/host/middleware/account_auth.js +11 -0
- package/build/src/host/otp_lockout.d.ts +103 -0
- package/build/src/host/otp_lockout.js +221 -0
- package/build/src/host/rate_limit.d.ts +39 -0
- package/build/src/host/rate_limit.js +94 -0
- package/build/src/host/register_auth_host.d.ts +97 -0
- package/build/src/host/register_auth_host.js +466 -0
- package/build/src/host/renderers/edge_renderer.d.ts +12 -0
- package/build/src/host/renderers/edge_renderer.js +38 -0
- package/build/src/host/renderers/inertia_renderer.d.ts +70 -0
- package/build/src/host/renderers/inertia_renderer.js +54 -0
- package/build/src/host/runtime_settings.d.ts +181 -0
- package/build/src/host/runtime_settings.js +307 -0
- package/build/src/host/runtime_toggles.d.ts +807 -0
- package/build/src/host/runtime_toggles.js +784 -0
- package/build/src/host/security_notice_service.d.ts +36 -0
- package/build/src/host/security_notice_service.js +87 -0
- package/build/src/host/session_context.d.ts +23 -0
- package/build/src/host/session_context.js +89 -0
- package/build/src/host/sudo_mode.d.ts +56 -0
- package/build/src/host/sudo_mode.js +99 -0
- package/build/src/host/svg_chart.d.ts +15 -0
- package/build/src/host/svg_chart.js +45 -0
- package/build/src/host/trusted_device.d.ts +61 -0
- package/build/src/host/trusted_device.js +65 -0
- package/build/src/host/ui-dist/assets/index-CRWcmsex.js +137 -0
- package/build/src/host/ui-dist/assets/index-DTSmD4RU.css +1 -0
- package/build/src/host/ui-dist/index.html +17 -0
- package/build/src/host/user_agent.d.ts +18 -0
- package/build/src/host/user_agent.js +50 -0
- package/build/src/host/validators.d.ts +127 -0
- package/build/src/host/validators.js +53 -0
- package/build/src/keys/jwks_manager.d.ts +6 -0
- package/build/src/keys/jwks_manager.js +11 -0
- package/build/src/keys/keystore.d.ts +52 -0
- package/build/src/keys/keystore.js +68 -0
- package/build/src/keys/keystore_codec.d.ts +20 -0
- package/build/src/keys/keystore_codec.js +42 -0
- package/build/src/keys/keystore_crypto.d.ts +9 -0
- package/build/src/keys/keystore_crypto.js +27 -0
- package/build/src/keys/keystore_manager.d.ts +43 -0
- package/build/src/keys/keystore_manager.js +104 -0
- package/build/src/keys/keystore_vault.d.ts +113 -0
- package/build/src/keys/keystore_vault.js +265 -0
- package/build/src/mixins/json_column.d.ts +33 -0
- package/build/src/mixins/json_column.js +38 -0
- package/build/src/mixins/with_audit_log.d.ts +19 -0
- package/build/src/mixins/with_audit_log.js +39 -0
- package/build/src/mixins/with_auth_user.d.ts +24 -0
- package/build/src/mixins/with_auth_user.js +46 -0
- package/build/src/mixins/with_credentials.d.ts +20 -0
- package/build/src/mixins/with_credentials.js +29 -0
- package/build/src/mixins/with_mfa.d.ts +35 -0
- package/build/src/mixins/with_mfa.js +21 -0
- package/build/src/mixins/with_personal_access_token.d.ts +19 -0
- package/build/src/mixins/with_personal_access_token.js +42 -0
- package/build/src/mixins/with_provider_identity.d.ts +20 -0
- package/build/src/mixins/with_provider_identity.js +32 -0
- package/build/src/mixins/with_webauthn_credential.d.ts +37 -0
- package/build/src/mixins/with_webauthn_credential.js +46 -0
- package/build/src/observability/diagnostics_bridge.d.ts +6 -0
- package/build/src/observability/diagnostics_bridge.js +27 -0
- package/build/src/observability/metrics_controller.d.ts +5 -0
- package/build/src/observability/metrics_controller.js +24 -0
- package/build/src/observability/metrics_service.d.ts +2 -0
- package/build/src/observability/metrics_service.js +7 -0
- package/build/src/observability/otel_recorder.d.ts +10 -0
- package/build/src/observability/otel_recorder.js +59 -0
- package/build/src/observability/telescope/data_providers.d.ts +24 -0
- package/build/src/observability/telescope/data_providers.js +235 -0
- package/build/src/observability/telescope/extension.d.ts +29 -0
- package/build/src/observability/telescope/extension.js +167 -0
- package/build/src/observability/telescope/index.d.ts +8 -0
- package/build/src/observability/telescope/index.js +8 -0
- package/build/src/observability/wire_provider_events.d.ts +12 -0
- package/build/src/observability/wire_provider_events.js +30 -0
- package/build/src/password/common_passwords.d.ts +31 -0
- package/build/src/password/common_passwords.js +73 -0
- package/build/src/password/password_manager.d.ts +163 -0
- package/build/src/password/password_manager.js +191 -0
- package/build/src/password/policy.d.ts +71 -0
- package/build/src/password/policy.js +55 -0
- package/build/src/password/pwned.d.ts +36 -0
- package/build/src/password/pwned.js +52 -0
- package/build/src/pat/lucid_pat_store.d.ts +6 -0
- package/build/src/pat/lucid_pat_store.js +62 -0
- package/build/src/pat/pat_store.d.ts +31 -0
- package/build/src/pat/pat_store.js +1 -0
- package/build/src/pat/pat_tokens.d.ts +4 -0
- package/build/src/pat/pat_tokens.js +9 -0
- package/build/src/provider/build_provider.d.ts +45 -0
- package/build/src/provider/build_provider.js +219 -0
- package/build/src/provider/device_sources.d.ts +6 -0
- package/build/src/provider/device_sources.js +65 -0
- package/build/src/provider/interaction_actions.d.ts +36 -0
- package/build/src/provider/interaction_actions.js +55 -0
- package/build/src/provider/key_rotation_scheduler.d.ts +28 -0
- package/build/src/provider/key_rotation_scheduler.js +40 -0
- package/build/src/provider/keystore_reload.d.ts +21 -0
- package/build/src/provider/keystore_reload.js +39 -0
- package/build/src/provider/logout_sources.d.ts +13 -0
- package/build/src/provider/logout_sources.js +64 -0
- package/build/src/provider/oidc_service.d.ts +81 -0
- package/build/src/provider/oidc_service.js +254 -0
- package/build/src/provider/single_flight_lock.d.ts +18 -0
- package/build/src/provider/single_flight_lock.js +31 -0
- package/build/src/provider/token_exchange.d.ts +21 -0
- package/build/src/provider/token_exchange.js +124 -0
- package/build/src/register_routes.d.ts +16 -0
- package/build/src/register_routes.js +21 -0
- package/build/src/schema/ensure.d.ts +41 -0
- package/build/src/schema/ensure.js +262 -0
- package/build/stubs/config/authkit.stub +20 -0
- package/build/stubs/config/authkit_react.stub +52 -0
- package/build/stubs/main.d.ts +1 -0
- package/build/stubs/main.js +2 -0
- package/build/stubs/models/auth_user.stub +22 -0
- package/build/stubs/ui/edge/views/consent.edge +13 -0
- package/build/stubs/ui/edge/views/login.edge +19 -0
- package/build/stubs/ui/react/components/auth_shell.tsx +67 -0
- package/build/stubs/ui/react/pages/account/login.tsx +56 -0
- package/build/stubs/ui/react/pages/account/mfa.tsx +132 -0
- package/build/stubs/ui/react/pages/account/tokens.tsx +88 -0
- package/build/stubs/ui/react/pages/consent.tsx +39 -0
- package/build/stubs/ui/react/pages/forgot.tsx +44 -0
- package/build/stubs/ui/react/pages/login.tsx +171 -0
- package/build/stubs/ui/react/pages/mfa-challenge.tsx +72 -0
- package/build/stubs/ui/react/pages/reset.tsx +58 -0
- package/build/stubs/ui/react/pages/signup.tsx +78 -0
- package/build/stubs/ui/react/pages/verify-email.tsx +24 -0
- package/build/types.d.ts +7 -0
- package/build/types.js +1 -0
- package/package.json +147 -0
- package/stubs/config/authkit.stub +20 -0
- package/stubs/config/authkit_react.stub +52 -0
- package/stubs/main.ts +2 -0
- package/stubs/models/auth_user.stub +22 -0
- package/stubs/ui/edge/views/consent.edge +13 -0
- package/stubs/ui/edge/views/login.edge +19 -0
- package/stubs/ui/react/components/auth_shell.tsx +67 -0
- package/stubs/ui/react/pages/account/login.tsx +56 -0
- package/stubs/ui/react/pages/account/mfa.tsx +132 -0
- package/stubs/ui/react/pages/account/tokens.tsx +88 -0
- package/stubs/ui/react/pages/consent.tsx +39 -0
- package/stubs/ui/react/pages/forgot.tsx +44 -0
- package/stubs/ui/react/pages/login.tsx +171 -0
- package/stubs/ui/react/pages/mfa-challenge.tsx +72 -0
- package/stubs/ui/react/pages/reset.tsx +58 -0
- package/stubs/ui/react/pages/signup.tsx +78 -0
- package/stubs/ui/react/pages/verify-email.tsx +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Davi de Carvalho
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# @adonis-agora/authkit-server
|
|
2
|
+
|
|
3
|
+
OpenID Connect / OAuth2 Authorization Server (Identity Provider) for AdonisJS — an idiomatic
|
|
4
|
+
wrapper around [`oidc-provider`](https://github.com/panva/node-oidc-provider).
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
|
|
8
|
+
- **OIDC / OAuth2 AS** — authorization code + PKCE, refresh tokens (rotated), token exchange,
|
|
9
|
+
discovery, JWKS (managed + rotatable), revocation, introspection.
|
|
10
|
+
- **MFA** — TOTP, WebAuthn passkeys, recovery codes, trusted-device skip.
|
|
11
|
+
- **Passwordless** — magic-link email login and passkey-first login.
|
|
12
|
+
- **Protocol extensions** — Device Flow (RFC 8628), DPoP (RFC 9449), PAR (RFC 9126), step-up
|
|
13
|
+
auth via `acr_values`, Dynamic Client Registration (RFC 7591/7592).
|
|
14
|
+
- **Admin console** — user CRUD (+ disable), client CRUD, sessions, audit log (opt-in,
|
|
15
|
+
role-gated).
|
|
16
|
+
- **Account console** — self-service apps/consent, security (password/email/sessions),
|
|
17
|
+
profile.
|
|
18
|
+
- **Tokens & federation** — Personal Access Tokens, admin impersonation, back-channel logout,
|
|
19
|
+
RP-initiated logout.
|
|
20
|
+
- **Hardening** — progressive account lockout, per-IP rate-limiting, audit logging with an
|
|
21
|
+
events/webhook fan-out, new-login email alerts.
|
|
22
|
+
- **Operability** — i18n (English default, pt-BR built in), OpenTelemetry metrics, the
|
|
23
|
+
`authkit:doctor` and `authkit:rotate-keys` commands.
|
|
24
|
+
|
|
25
|
+
> The remaining sections are in Portuguese pending a full translation pass.
|
|
26
|
+
|
|
27
|
+
## Instalação
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node ace add @adonis-agora/authkit-server
|
|
31
|
+
# ou: pnpm add @adonis-agora/authkit-server && node ace configure @adonis-agora/authkit-server
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
O `configure` publica `config/authkit_server.ts`, o model `app/models/auth_user.ts`,
|
|
35
|
+
o controller de interactions (`app/controllers/auth_interaction_controller.ts`) e
|
|
36
|
+
registra o provider.
|
|
37
|
+
|
|
38
|
+
## Montar as rotas OIDC
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
// start/routes.ts
|
|
42
|
+
import router from '@adonisjs/core/services/router'
|
|
43
|
+
import { registerOidcRoutes } from '@adonis-agora/authkit-server'
|
|
44
|
+
|
|
45
|
+
registerOidcRoutes(router) // monta em /oidc por padrão
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Defina `AUTHKIT_ISSUER` apontando para `<host>/oidc` (o issuer deve terminar no mount path).
|
|
49
|
+
|
|
50
|
+
## Rotas de interaction (login/consentimento)
|
|
51
|
+
|
|
52
|
+
O `oidc-provider` redireciona o usuário não autenticado para `interactions.url`
|
|
53
|
+
(`/auth/interaction/:uid`). Essas telas são **suas** (o `configure` ejeta
|
|
54
|
+
`app/controllers/auth_interaction_controller.ts`). Registre as rotas que apontam para ele:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// start/routes.ts
|
|
58
|
+
import AuthInteractionController from '#controllers/auth_interaction_controller'
|
|
59
|
+
|
|
60
|
+
router.get('/auth/interaction/:uid', [AuthInteractionController, 'show'])
|
|
61
|
+
router.post('/auth/interaction/:uid/login', [AuthInteractionController, 'login'])
|
|
62
|
+
router.post('/auth/interaction/:uid/consent', [AuthInteractionController, 'consent'])
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Sem essas rotas o fluxo de autorização cai num 404 ao chegar na tela de login.
|
|
66
|
+
|
|
67
|
+
## UI de login/consent (configurável)
|
|
68
|
+
|
|
69
|
+
O `configure` ejeta as telas de interaction a partir de um preset escolhido:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
node ace configure @adonis-agora/authkit-server --ui=edge
|
|
73
|
+
# valores: edge | react | headless — se omitir, o configure pergunta
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Cada preset publica:
|
|
77
|
+
|
|
78
|
+
- **`headless`** — apenas o controller (`app/controllers/auth_interaction_controller.ts`).
|
|
79
|
+
`show` devolve JSON (`{ uid, prompt, params }`) e `login`/`consent` respondem JSON/erro.
|
|
80
|
+
Você constrói o front como quiser.
|
|
81
|
+
- **`edge`** — controller + views Edge (`resources/views/authkit/login.edge` e
|
|
82
|
+
`consent.edge`). `show` renderiza a view de acordo com o prompt.
|
|
83
|
+
- **`react`** — controller + páginas Inertia/React (`inertia/pages/authkit/login.tsx` e
|
|
84
|
+
`consent.tsx`). `show` faz `inertia.render`. Exige `@adonisjs/inertia` + Vite + React no
|
|
85
|
+
app — o `configure` valida essa stack antes de publicar o preset.
|
|
86
|
+
|
|
87
|
+
Em todos os presets o controller ejetado é **casca**: a lógica vive em
|
|
88
|
+
`service.interactions` (resolvido via `containerResolver.make('authkit.server')`), que expõe
|
|
89
|
+
`details(ctx)`, `login(ctx, { email, password })` e `consent(ctx)`. Você edita só a parte de
|
|
90
|
+
render/redirect.
|
|
91
|
+
|
|
92
|
+
Quem decide se as credenciais valem é o `verifyCredentials` do `config/authkit_server.ts`
|
|
93
|
+
— é o que o `service.interactions.login` chama. O default consulta o `AuthUser` por e-mail e
|
|
94
|
+
usa `verifyPassword`; sobrescreva para plugar sua própria base de usuários.
|
|
95
|
+
|
|
96
|
+
As 3 rotas que o consumidor registra são as mesmas da seção anterior:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import AuthInteractionController from '#controllers/auth_interaction_controller'
|
|
100
|
+
|
|
101
|
+
router.get('/auth/interaction/:uid', [AuthInteractionController, 'show'])
|
|
102
|
+
router.post('/auth/interaction/:uid/login', [AuthInteractionController, 'login'])
|
|
103
|
+
router.post('/auth/interaction/:uid/consent', [AuthInteractionController, 'consent'])
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Persistência
|
|
107
|
+
|
|
108
|
+
Escolha o backend no `config/authkit_server.ts`:
|
|
109
|
+
- `adapters.redis({ connection })` — requer `@adonisjs/redis` configurado.
|
|
110
|
+
- `adapters.database({ connection? })` — Lucid; rode a migração `authkit_oidc_payloads`.
|
|
111
|
+
|
|
112
|
+
## Observabilidade
|
|
113
|
+
|
|
114
|
+
A lib agrega métricas de auth (logins, tokens, refresh, grants revogados, duração/erros
|
|
115
|
+
de resolve) e as expõe de forma opt-in.
|
|
116
|
+
|
|
117
|
+
### Configuração
|
|
118
|
+
|
|
119
|
+
No `config/authkit_server.ts`, use a chave `observability`:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
observability: {
|
|
123
|
+
metrics: true, // habilita a coleta/agregação de métricas
|
|
124
|
+
jsonRoutes: true, // libera a rota JSON de snapshot
|
|
125
|
+
dashboard: true, // libera o dashboard HTML embutido
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Rotas
|
|
130
|
+
|
|
131
|
+
Passe as flags em `registerOidcRoutes` no `start/routes.ts`:
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
import { registerOidcRoutes } from '@adonis-agora/authkit-server'
|
|
135
|
+
|
|
136
|
+
registerOidcRoutes(router, { metrics: true, dashboard: true })
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- `GET /authkit/metrics` — snapshot agregado em JSON (`{ counters, histograms, updatedAt }`).
|
|
140
|
+
- `GET /authkit/dashboard` — dashboard HTML embutido (auto-refresh a cada 5s, sem
|
|
141
|
+
dependência do Edge do consumidor).
|
|
142
|
+
|
|
143
|
+
### OpenTelemetry
|
|
144
|
+
|
|
145
|
+
As métricas são emitidas via OpenTelemetry **quando** `@opentelemetry/api` e `@adonisjs/otel`
|
|
146
|
+
estão instalados. Sem esses pacotes a emissão é no-op — a agregação em memória (e as rotas
|
|
147
|
+
JSON/HTML) continua funcionando normalmente.
|
|
148
|
+
|
|
149
|
+
### Grafana
|
|
150
|
+
|
|
151
|
+
O arquivo `assets/grafana/authkit-dashboard.json` pode ser importado diretamente no Grafana
|
|
152
|
+
(Dashboards → Import). Ele usa nomes de métrica no padrão OTel→Prometheus (pontos viram
|
|
153
|
+
underscores e counters ganham `_total`), portanto requer um exporter Prometheus no pipeline
|
|
154
|
+
OTel para que as séries existam.
|
|
155
|
+
|
|
156
|
+
## Notas
|
|
157
|
+
- Access tokens são opacos; ID tokens são JWT (assinados pelo JWKS gerido).
|
|
158
|
+
- PKCE (S256) é obrigatório; refresh tokens são rotacionados.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "AuthKit",
|
|
3
|
+
"uid": "authkit",
|
|
4
|
+
"schemaVersion": 39,
|
|
5
|
+
"version": 1,
|
|
6
|
+
"editable": true,
|
|
7
|
+
"graphTooltip": 0,
|
|
8
|
+
"time": { "from": "now-6h", "to": "now" },
|
|
9
|
+
"refresh": "30s",
|
|
10
|
+
"tags": ["authkit", "oidc", "auth"],
|
|
11
|
+
"templating": {
|
|
12
|
+
"list": [
|
|
13
|
+
{
|
|
14
|
+
"name": "datasource",
|
|
15
|
+
"label": "Datasource",
|
|
16
|
+
"type": "datasource",
|
|
17
|
+
"query": "prometheus",
|
|
18
|
+
"current": {},
|
|
19
|
+
"hide": 0,
|
|
20
|
+
"refresh": 1
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"panels": [
|
|
25
|
+
{
|
|
26
|
+
"id": 1,
|
|
27
|
+
"title": "Login (sucesso vs falha)",
|
|
28
|
+
"type": "timeseries",
|
|
29
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
30
|
+
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 },
|
|
31
|
+
"fieldConfig": { "defaults": { "unit": "ops" }, "overrides": [] },
|
|
32
|
+
"targets": [
|
|
33
|
+
{
|
|
34
|
+
"refId": "A",
|
|
35
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
36
|
+
"expr": "rate(authkit_login_success_total[5m])",
|
|
37
|
+
"legendFormat": "success"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"refId": "B",
|
|
41
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
42
|
+
"expr": "rate(authkit_login_failure_total[5m])",
|
|
43
|
+
"legendFormat": "failure"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": 2,
|
|
49
|
+
"title": "Tokens emitidos vs refresh rotacionados",
|
|
50
|
+
"type": "timeseries",
|
|
51
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
52
|
+
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 },
|
|
53
|
+
"fieldConfig": { "defaults": { "unit": "ops" }, "overrides": [] },
|
|
54
|
+
"targets": [
|
|
55
|
+
{
|
|
56
|
+
"refId": "A",
|
|
57
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
58
|
+
"expr": "rate(authkit_token_issued_total[5m])",
|
|
59
|
+
"legendFormat": "issued"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"refId": "B",
|
|
63
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
64
|
+
"expr": "rate(authkit_refresh_rotated_total[5m])",
|
|
65
|
+
"legendFormat": "refresh rotated"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": 3,
|
|
71
|
+
"title": "Grants revogados (total)",
|
|
72
|
+
"type": "stat",
|
|
73
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
74
|
+
"gridPos": { "h": 8, "w": 8, "x": 0, "y": 8 },
|
|
75
|
+
"fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] },
|
|
76
|
+
"targets": [
|
|
77
|
+
{
|
|
78
|
+
"refId": "A",
|
|
79
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
80
|
+
"expr": "sum(authkit_grant_revoked_total)",
|
|
81
|
+
"legendFormat": "revoked"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": 4,
|
|
87
|
+
"title": "Resolve duration (p95)",
|
|
88
|
+
"type": "timeseries",
|
|
89
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
90
|
+
"gridPos": { "h": 8, "w": 8, "x": 8, "y": 8 },
|
|
91
|
+
"fieldConfig": { "defaults": { "unit": "s" }, "overrides": [] },
|
|
92
|
+
"targets": [
|
|
93
|
+
{
|
|
94
|
+
"refId": "A",
|
|
95
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
96
|
+
"expr": "histogram_quantile(0.95, rate(authkit_resolve_duration_bucket[5m]))",
|
|
97
|
+
"legendFormat": "p95"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": 5,
|
|
103
|
+
"title": "Erros de resolve (total)",
|
|
104
|
+
"type": "stat",
|
|
105
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
106
|
+
"gridPos": { "h": 8, "w": 8, "x": 16, "y": 8 },
|
|
107
|
+
"fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] },
|
|
108
|
+
"targets": [
|
|
109
|
+
{
|
|
110
|
+
"refId": "A",
|
|
111
|
+
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
|
112
|
+
"expr": "sum(authkit_resolve_errors_total)",
|
|
113
|
+
"legendFormat": "errors"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BaseCommand } from '@adonisjs/core/ace';
|
|
2
|
+
import type { CommandOptions } from '@adonisjs/core/types/ace';
|
|
3
|
+
/**
|
|
4
|
+
* Cria um client OIDC no adapter/DB via {@link AdminClientsService}. O client fica
|
|
5
|
+
* disponível em runtime imediatamente, sem necessidade de redeploy. Para clients
|
|
6
|
+
* confidenciais, o secret é gerado aleatoriamente e impresso UMA ÚNICA VEZ — não é
|
|
7
|
+
* recuperável depois.
|
|
8
|
+
*
|
|
9
|
+
* Exemplos:
|
|
10
|
+
* node ace authkit:clients:create --client-id=my-spa --redirect-uri=https://app/cb --public
|
|
11
|
+
* node ace authkit:clients:create --client-id=my-api --redirect-uri=https://api/cb --redirect-uri=https://api/cb2 --grant=client_credentials
|
|
12
|
+
* node ace authkit:clients:create --redirect-uri=https://app/cb --json
|
|
13
|
+
*/
|
|
14
|
+
export default class AuthkitClientsCreate extends BaseCommand {
|
|
15
|
+
static commandName: string;
|
|
16
|
+
static description: string;
|
|
17
|
+
static help: string[];
|
|
18
|
+
static options: CommandOptions;
|
|
19
|
+
clientId?: string;
|
|
20
|
+
redirectUri?: string[];
|
|
21
|
+
postLogoutUri?: string[];
|
|
22
|
+
grant?: string[];
|
|
23
|
+
public?: boolean;
|
|
24
|
+
backchannelLogoutUri?: string;
|
|
25
|
+
json?: boolean;
|
|
26
|
+
run(): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { BaseCommand, flags } from '@adonisjs/core/ace';
|
|
8
|
+
/**
|
|
9
|
+
* Cria um client OIDC no adapter/DB via {@link AdminClientsService}. O client fica
|
|
10
|
+
* disponível em runtime imediatamente, sem necessidade de redeploy. Para clients
|
|
11
|
+
* confidenciais, o secret é gerado aleatoriamente e impresso UMA ÚNICA VEZ — não é
|
|
12
|
+
* recuperável depois.
|
|
13
|
+
*
|
|
14
|
+
* Exemplos:
|
|
15
|
+
* node ace authkit:clients:create --client-id=my-spa --redirect-uri=https://app/cb --public
|
|
16
|
+
* node ace authkit:clients:create --client-id=my-api --redirect-uri=https://api/cb --redirect-uri=https://api/cb2 --grant=client_credentials
|
|
17
|
+
* node ace authkit:clients:create --redirect-uri=https://app/cb --json
|
|
18
|
+
*/
|
|
19
|
+
export default class AuthkitClientsCreate extends BaseCommand {
|
|
20
|
+
static commandName = 'authkit:clients:create';
|
|
21
|
+
static description = 'Cria um client OIDC no adapter/DB em runtime (sem redeploy). O secret é impresso uma vez.';
|
|
22
|
+
static help = [
|
|
23
|
+
'Cria um client OIDC persistido no adapter via AdminClientsService, o mesmo',
|
|
24
|
+
'caminho usado pelo console admin e pelo registro dinâmico (RFC 7591).',
|
|
25
|
+
'',
|
|
26
|
+
'Para clients confidenciais (default), um secret aleatório é gerado e',
|
|
27
|
+
'impresso UMA ÚNICA VEZ no terminal — armazene-o imediatamente.',
|
|
28
|
+
'',
|
|
29
|
+
'Flags repetíveis (--flag=v1 --flag=v2):',
|
|
30
|
+
' --redirect-uri URI(s) de callback do client (obrigatório).',
|
|
31
|
+
' --post-logout-uri URI(s) de post-logout redirect.',
|
|
32
|
+
' --grant Grant types. Default: authorization_code + refresh_token.',
|
|
33
|
+
'',
|
|
34
|
+
'Exemplos:',
|
|
35
|
+
' node ace authkit:clients:create --client-id=my-spa --redirect-uri=https://app/cb --public',
|
|
36
|
+
' node ace authkit:clients:create --redirect-uri=https://app/cb --backchannel-logout-uri=https://app/bc',
|
|
37
|
+
' node ace authkit:clients:create --client-id=my-app --redirect-uri=https://a/cb --redirect-uri=https://b/cb --json',
|
|
38
|
+
];
|
|
39
|
+
static options = { startApp: true };
|
|
40
|
+
async run() {
|
|
41
|
+
const redirectUris = this.redirectUri ?? [];
|
|
42
|
+
if (redirectUris.length === 0) {
|
|
43
|
+
this.logger.logError('❌ --redirect-uri é obrigatório. Passe ao menos uma URI de callback.');
|
|
44
|
+
this.exitCode = 1;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const service = await this.app.container.make('authkit.server');
|
|
48
|
+
const { AdminClientsService } = await import('../src/host/admin_clients_service.js');
|
|
49
|
+
const svc = new AdminClientsService(service);
|
|
50
|
+
const grantTypes = this.grant && this.grant.length > 0
|
|
51
|
+
? this.grant
|
|
52
|
+
: ['authorization_code', 'refresh_token'];
|
|
53
|
+
const tokenEndpointAuthMethod = this.public ? 'none' : 'client_secret_basic';
|
|
54
|
+
const created = await svc.create({
|
|
55
|
+
clientId: this.clientId,
|
|
56
|
+
redirectUris,
|
|
57
|
+
postLogoutRedirectUris: this.postLogoutUri ?? [],
|
|
58
|
+
grantTypes,
|
|
59
|
+
tokenEndpointAuthMethod,
|
|
60
|
+
backchannelLogoutUri: this.backchannelLogoutUri,
|
|
61
|
+
});
|
|
62
|
+
if (this.json) {
|
|
63
|
+
const out = {
|
|
64
|
+
clientId: created.clientId,
|
|
65
|
+
redirectUris,
|
|
66
|
+
postLogoutRedirectUris: this.postLogoutUri ?? [],
|
|
67
|
+
grantTypes,
|
|
68
|
+
tokenEndpointAuthMethod,
|
|
69
|
+
confidential: !this.public,
|
|
70
|
+
};
|
|
71
|
+
if (created.clientSecret)
|
|
72
|
+
out.clientSecret = created.clientSecret;
|
|
73
|
+
if (this.backchannelLogoutUri)
|
|
74
|
+
out.backchannelLogoutUri = this.backchannelLogoutUri;
|
|
75
|
+
this.logger.info(JSON.stringify(out, null, 2));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.logger.success(`Client criado: ${created.clientId}`);
|
|
79
|
+
this.logger.info(` redirect_uris: ${redirectUris.join(', ')}`);
|
|
80
|
+
this.logger.info(` grant_types: ${grantTypes.join(', ')}`);
|
|
81
|
+
this.logger.info(` type: ${this.public ? 'publico (sem secret)' : 'confidencial'}`);
|
|
82
|
+
if (this.backchannelLogoutUri) {
|
|
83
|
+
this.logger.info(` backchannel: ${this.backchannelLogoutUri}`);
|
|
84
|
+
}
|
|
85
|
+
if (created.clientSecret) {
|
|
86
|
+
this.logger.info('');
|
|
87
|
+
this.logger.success('CLIENT SECRET (mostrado UMA vez - armazene agora):');
|
|
88
|
+
this.logger.success(` ${created.clientSecret}`);
|
|
89
|
+
this.logger.info('');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
__decorate([
|
|
94
|
+
flags.string({ description: 'client_id desejado. Omitir gera um UUID aleatório.' })
|
|
95
|
+
], AuthkitClientsCreate.prototype, "clientId", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
flags.array({ description: 'redirect_uri(s) permitidas (repetível). Obrigatório.' })
|
|
98
|
+
], AuthkitClientsCreate.prototype, "redirectUri", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
flags.array({ description: 'post_logout_redirect_uri(s) permitidas (repetível).' })
|
|
101
|
+
], AuthkitClientsCreate.prototype, "postLogoutUri", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
flags.array({
|
|
104
|
+
description: 'Grant types (repetível). Default: authorization_code + refresh_token.',
|
|
105
|
+
})
|
|
106
|
+
], AuthkitClientsCreate.prototype, "grant", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
flags.boolean({
|
|
109
|
+
description: 'Cria um client público (sem secret; token_endpoint_auth_method=none). Default: false (confidencial).',
|
|
110
|
+
})
|
|
111
|
+
], AuthkitClientsCreate.prototype, "public", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
flags.string({
|
|
114
|
+
description: 'Endpoint de OIDC Back-Channel Logout do RP (POST de logout_token).',
|
|
115
|
+
})
|
|
116
|
+
], AuthkitClientsCreate.prototype, "backchannelLogoutUri", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
flags.boolean({
|
|
119
|
+
description: 'Output em JSON machine-readable (inclui clientId e clientSecret).',
|
|
120
|
+
})
|
|
121
|
+
], AuthkitClientsCreate.prototype, "json", void 0);
|