Skip to content

Conversation

@orbaps
Copy link

@orbaps orbaps commented Oct 31, 2025

🚀 Pull Request: Auth Inheritance Feature


🧩 PR Description

This PR implements the Auth Inheritance Feature for the APIDash project — enabling requests to inherit authentication credentials from their active environment.

🌍 Overview

This brings Postman/Insomnia-like behavior, where users can define authentication at the environment level and reuse it across multiple requests automatically.

🔧 Problem

Previously, APIDash only supported per-request authentication, forcing users to manually configure identical credentials for multiple requests — causing:

  • Repetitive setup
  • Difficult credential management
  • Lack of centralized control

💡 Solution

Auth inheritance adds the ability for requests to use the environment’s default authentication when selected.
Implemented by:

  1. Extending EnvironmentModel to include default authentication
  2. Adding authInheritanceType in HttpRequestModel (Enum: none, environment)
  3. Modifying CollectionStateNotifier to apply inherited auth dynamically
  4. Enhancing the UI to manage and visualize inheritance states

⚙️ Key Technical Changes

  • Added defaultAuthModel field in EnvironmentModel
  • Added authInheritanceType field (AuthInheritanceType enum) in HttpRequestModel
  • Created AuthInheritanceType enum with values:
    • none → Use request-specific auth
    • environment → Inherit from environment
  • Updated request processing logic in CollectionStateNotifier
  • Added UI components:
    • Dropdown for inheritance type selection
    • Environment Auth tab for environment-level credentials
  • Added comprehensive test coverage for all new models, logic, and UI elements

🧠 Benefits

Reduced Duplication: Single configuration for multiple requests
Centralized Management: Modify environment-level auth once, apply everywhere
Familiar Workflow: Mirrors Postman/Insomnia UX
Backward Compatible: Default behavior unchanged (none)
Environment Variable Support: Works with inherited credentials


🔗 Related Issues

Ability to inherit auth credentials #881


✅ Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main before making this PR
  • I am using the latest Flutter stable branch (flutter upgrade)
  • I have run all tests (flutter test) and verified they pass

🧪 Added / Updated Tests

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: please explain

💻 OS Used for Development and Testing

  • Windows
  • macOS
  • Linux

🧩 References


🧑‍💻 Author: @orbaps
📅 Date: 1st November

@animator animator linked an issue Nov 12, 2025 that may be closed by this pull request
@animator animator changed the title Ability to inherit auth credentials #881 Ability to inherit auth credentials Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to inherit auth credentials

1 participant