Skip to content

Data Integrity and Secure Authentication

To ensure data accuracy and security, we integrated Formik and Yup for handling and validating user input within forms. These libraries help enforce data integrity by validating information before it reaches the backend, reducing errors and improving the reliability of policy management. Users are also notified immediately if an input does not meet requirements, preventing common mistakes and securing data accuracy.

Form Validation with Formik and Yup

Formik is used to manage form state, while Yup provides a powerful schema-based validation mechanism. The validation schema ensures that all required fields are correctly filled out before form submission. For example, the policyValidationSchema enforces rules such as:

  • Policy Name: Required field.
  • Subject Type: Must be either "host" or "app".
  • Host ID: Required if the subject type is "host".
  • App Name: Required if the subject type is "app".
  • Expression: Required field for defining policy logic.
  • URL: Must be a valid URL format.
  • HTTP Method: Must be one of the allowed methods (POST, GET, PUT, DELETE).

This validation ensures that the data submitted to the backend is consistent and accurate, reducing the likelihood of errors.

Secure Authentication with Keycloak

The application uses Keycloak to manage user authentication and authorization. Keycloak provides a robust solution for securing the application, ensuring that only authorized users can access specific features. Keycloak handles:

  • User Authentication: Users log in via Keycloak, which validates their credentials.
  • Token Management: Keycloak issues and refreshes access tokens, ensuring secure communication between the frontend and backend.
  • Role-Based Access Control (RBAC): Users are assigned roles that determine their access levels within the application.

Keycloak also supports Single Sign-On (SSO), allowing users to authenticate once and access multiple services seamlessly. This integration adds an essential layer of security, enabling us to manage user sessions confidently, protect sensitive data, and deliver a seamless, secure experience.

Conclusion

With its secure, intuitive, and highly functional design, the DPM’s GUI is designed to meet current needs in policy management. By leveraging Formik and Yup for data integrity and Keycloak for secure authentication, the application ensures a reliable and secure user experience.