pakeku / it-doc-system-frontend

https://it-doc-system-frontend.vercel.app
Apache License 2.0
0 stars 0 forks source link

User Story: Create a New Secret via Modal #1

Open pakeku opened 6 days ago

pakeku commented 6 days ago

As a user with the appropriate permissions,
I want to create a new secret using a modal,
so that I can securely add new secrets to the database and manage them.


Acceptance Criteria:

  1. Permissions Validation:

    • The user must be logged in to access this functionality.
    • Only users with the create:secrets permission can create new secrets.
    • If the user lacks the required permissions, the "Create Secret" option should be hidden or disabled.
  2. Retrieved/Processed Data:

    • The following fields should be input by the user when creating a new secret:
      • name (required)
      • description (optional)
      • secretValue (required)
    • Upon submission, the new secret should be saved to the database with the following system-generated fields:
      • createdAt
      • _id
  3. Frontend: Display and Interaction:

    • A "Plus" button should be available on the same page where secrets are listed.
    • Upon clicking the "Plus" button, a modal should appear that prompts the user to enter the new secret’s details (name, description, and secret value).
    • After the secret is created successfully:
      • The new secret should appear in the list of secrets displayed on the frontend.
      • A success notification should confirm the secret was created.
    • If the creation fails, an error message should notify the user.
  4. Frontend: Button Actions:

    • Plus Button:
      • When clicked, it launches a modal where the user can input the secret details.
    • Create Button (within modal):
      • When clicked, it submits the new secret to the backend, which saves it to the database.
      • Upon success, the modal closes and the new secret is displayed on the list.
    • Cancel Button (within modal):
      • When clicked, the modal closes without creating the secret.
  5. Security Considerations:

    • The secret value should be encrypted before being stored in the database.
    • The creation of new secrets should be logged for auditing purposes.
    • Secret data should be transmitted securely over encrypted channels (e.g., HTTPS).
    • Sensitive secret values should not be exposed on the frontend.
pakeku commented 6 days ago

I am going to get started on this. I have the branch development open. I will continue working off of that.