Commit graph

96 commits

Author SHA1 Message Date
Clemente Raposo
027e2f5d8f Add system config for session expired redirect
- Inject new system config
- Set Login page as default for redirect
2022-10-04 13:13:19 +01:00
Clemente Raposo
8a1123ab1a Set logged-out view as failure_path for saml 2022-10-04 13:13:19 +01:00
Clemente Raposo
4fd29a4e95 Add logged-out backend route 2022-10-04 13:13:19 +01:00
Clemente Raposo
7a612a0685 Add saml user auto-creation
- Add option to auto-create user upon login
- Add support for mapping fields from Idp to SuiteCRM
2022-10-04 13:13:19 +01:00
Clemente Raposo
0179d916a9 Add auth logging channel
- Add channel for authentication logs to be easier to debug authentication problems
2022-10-04 13:13:19 +01:00
Clemente Raposo
a4dbc76d37 Set saml config option to use target_path
- Set always_use_default_target_path
- Avoids login redirect loops
2022-09-09 12:46:23 +01:00
Clemente Raposo
c3e02d8113 Add native auth security config
- Configure firewall for native auth
- Add shared context between the two firewalls
- Add access control restrictions for native auth paths
2022-09-09 12:46:23 +01:00
Clemente Raposo
4e4b43e92e Add base saml configuration
- Allow enabling saml configuration
- Make security.access_control dynamic, depending on the auth_type
- Add saml specific access_control configuration
- Add saml routes configuration
- Enable auth.logout.redirect for saml
- Add template configuration for hslavich_onelogin_saml
2022-09-09 12:46:23 +01:00
Clemente Raposo
c5d096e945 Add configuration to enable ldap user auto create
- Allow enabling user auto create for ldap
- Add default configuration in .env
2022-09-09 12:46:22 +01:00
Clemente Raposo
06172843d7 Configure login throttling
- Set default of 3 attempts
- Make configurable in .env
2022-09-09 12:46:22 +01:00
Clemente Raposo
487a010d52 Add symfony/rate-limiter dependency 2022-09-09 12:46:22 +01:00
Clemente Raposo
db6afc52fc Allow switching between native and ldap login
- Add base ldap service configuration
- Add dynamic login configuration selection based on env
- Add default env options for ldap
2022-09-09 12:46:22 +01:00
Clemente Raposo
0c79491581 Use new symfony authenticator mechanism
- Add auth success listener to initialize legacy session
- Add password encoder to support legacy style encoding
- Add xsrf-token check to json_login
- enable authenticator_manager
2022-09-09 12:46:22 +01:00
Clemente Raposo
84aa865a68 Update login to use only symfony
- Add Suite 8 side only login
- Do not login on legacy, only initialize session
- This enables the usage of other symfony login mechanisms
2022-09-09 12:46:20 +01:00
Clemente Raposo
8ee2c7dee7 Fix #90 - Properly reset legacy session cookie after logout 2022-05-11 13:11:31 +01:00
p.kumar
7adffd8e37 update install command to use the step by step handler
- Add BaseStepExecutorCommand to reuse code
- Update UpgradeCommand to use BaseStepExecutorCommand
- Init legacy languages for Install command
2021-09-27 13:26:37 +05:30
Clemente Raposo
5bbd578200 Add support for container aware migrations 2021-06-24 12:44:30 +01:00
Clemente Raposo
d22cfbbf8f Add Upgrade Command
- Add Upgrade Package handler

-- Add base package handler service with re-usable api handle packages
-- Re-usable service to extract and apply upgrade packages
-- Add upgrade settings to configs

- Add Base command

-- Add abstract class with common input processing logic

- Add Upgrade Command

-- Add re-usable UpgradeHandler with api for applying upgrades
-- Add command to call upgrade handler
-- Add service feedback
-- Call clear cache on upgrade command

- Add Upgrade step by step execution

-- Add process step interface and executor
--- add common logging to each step execution
--- add debug logging for each step execution
--- allow running processes step by step
--- allow configuring steps independently

-- Move upgrade handler and upgrade command to use step executor
-- Add upgrade log
-- Improve upgrade command output
2021-06-23 10:09:40 +01:00
Dillon-Brown
ca2a8b413d Move Repositories
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:42 +01:00
Dillon-Brown
3aed1df849 Move all entities to component folders
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:41 +01:00
Dillon-Brown
1cab43c7d3 Rename src to backend
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:41 +01:00
Clemente Raposo
e8f9b18418 Move api documentation to /docs
- Enable swagger docs
- Disable re-doc
- Move rest docs path to /docs/rest
- Move graphql docs path to /docs/graphql
2021-03-30 19:22:39 +01:00
Dillon-Brown
9881af09e2 Update assets base path
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:37 +01:00
Dillon-Brown
95702c7854 Fix Symfony deprecations
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:33 +01:00
Dillon-Brown
6ba763e1c7 Set dev configuration to enable further web profiler features.
- This change causes the browser to stop before making any redirections, show the redirect URL, its toolbar, and its profiler.

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:33 +01:00
Dillon-Brown
e82feb45b7 Update UserRepository and security.yaml to allow more control over user authentication
- Remove hardcoded property identifier to enable us to chose how users are identified.
- Remove user password encoding that isn't used in favour of using legacy users.
- Optimizing the container by removing unused services through service configs.

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:31 +01:00
Dillon-Brown
7701f45b05 Implement doctrine migrations
- Setup doctrine migration configuration.

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:31 +01:00
Dillon-Brown
8271d66178 Update User entity to match types with pre-existing legacy database
- Update User entity.
- Update schema_filters to only allow doctrine interaction with the users and migration_versions tables.
- Set auto_generate_proxy_classes to false since we don't need proxy classes.
- Updated broken ORM and doctrine mappings.

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:31 +01:00
Dillon-Brown
4cd53cc6fd Refactor authentication to use application/json
- Sending by JSON is the preferred choice for API platform.

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:31 +01:00
Dillon-Brown
a3aaa0c5fc Set web profiler config
- This will be automatically disabled in production environments

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:31 +01:00
Dillon-Brown
6734f26d98 Implement CSRF protection
- Remove outdated CSRF package
- Implement core CSRF protection

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:22:31 +01:00
Clemente Raposo
cd7c611069 Set symfony profiler to track exceptions only
- Avoid having huge volume of cached data
2021-03-30 19:21:38 +01:00
Clemente Raposo
f2bd9d9949 Improve session checks and cookie reset
- Clean CSRF token when session has expired
-- On the root path
-- On the session-check entrypoint
--- Needed since this invalidates the session

- Add new session token after expiring old session
-- On the session-check entrypoint
--- Needed as the following login requests will require a token

- Configure CSRF token generation on the session-status api
-- The session status can invalidate the session
-- It also cleans the tokens
-- We need to generate a new token afterwards
2021-03-30 19:21:37 +01:00
Dillon-Brown
3672c445e7 Create a UserChecker for pre/post authentication security
- Implement UserChecker to check user deletion status on pre/post auth.
- Modify LoginFormAuthenticator to use Symfony/Security to fetch user data.
- Add Security Exceptions: UserDeletedException, UserNotFoundException.
- Set the security firewall to run the UserChecker.
- Update User Entity with deleted getter.

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:21:35 +01:00
Dillon-Brown
aa242f970c Implement user action menu
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:21:34 +01:00
Dillon-Brown
bc115670ba Add legacy user provider
- This changes the Symfony User entity to fetch the user from the legacy users table

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:21:34 +01:00
Dillon-Brown
9d484ed4a4 Linkup footer back to top with authentication
Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:21:34 +01:00
Dillon-Brown
07cfbf4d37 Add default session expiration
- Sets default cookie lifetime to use PHP.ini value.
- Adds bn-ng-idle to handle idle user.
- Sets default timeout to 3600 seconds to log the user out and redirect to the login page.
- Displays a warning message to the user on session timeout.

Signed-off-by: Dillon-Brown <dillon.brown@salesagility.com>
2021-03-30 19:21:34 +01:00
Clemente Raposo
0ff1c9072c Link data to login component
- Add language facade
- Add appStrings observable from facade
- Combine appStrings and systemConfigs into vm (viewModel)
- Link data to login component template
- Expose needed languages from the Users module
- Unprotect graphiql endpoint
2021-03-30 19:21:32 +01:00
Ross Moroney
ba67d839e3 Add language dropdown too login screen 2021-03-30 19:21:32 +01:00
Clemente Raposo
ac13d08e44 Enable GraphiQl docs
- Configure the assets folder to public
- Enable GraphiQl docs
2021-03-30 19:21:32 +01:00
Dillon-Brown
287ed2fb15 Add Angular CSRF protection 2021-03-30 19:21:31 +01:00
Dillon-Brown
9bff8530c6 Add Suite-8 user authentication 2021-03-30 19:21:31 +01:00
Clemente Raposo
58281a6b64 Implement ClassicView
Add FrontEnd api calls
- Add api method to retrieve classic view html
- Add apiUrl endpoint environment configuration
- Add Resolver to ClassicView routes

Implement FrontEnd component
- Add html and js rendering to classic view.

Add Classic View api-platform Entity and data provider

- Add ClassicViewData Dto with resource definition
- Add Classic controller with dummy html
- Declare controller in the services.yaml
2021-03-30 19:21:31 +01:00
Dillon-Brown
8cf555f4ee Update and audit existing project dependencies for Symfony/Flex.
- Converted all non-flex bundles with available bundles into Symfony/Flex.
- Updated namespaces to more closely match Symfony.
- Removed unnecessary dependencies and recipes.
- Executed Symfony/Flex recipes to create default configs.
- Improved composer.json scripts.
2021-03-30 19:21:31 +01:00
Dillon-Brown
587a79613e Add API Platform Framework with Symfony/Flex
This implements the basic structure that will be used for the API and core application.
2021-03-30 19:21:30 +01:00