Skip to content

Conversation

@RaymondLaubert
Copy link
Contributor

@RaymondLaubert RaymondLaubert commented Jan 15, 2026

Description

Adds a new application configuration property DisableAPIKeys.

Motivation and Context

Resolves BED-7133

Why is this change required? What problem does it solve?

The change adds the DisableAPIKeys to the Application Configuration properties; default this is turned off. This will allow a new option to be added to the configuration file to override the default value and ultimately allow for disabling the use of API Keys; this will help fulfill contractual obligations for an on-prem client.

How Has This Been Tested?

Modified the build.config.json file and ran it locally using breakpoints to observe and verify the new configuration property was being added, the DisableAPIKeys was defaulting to false, and overwritten when the build.config.json file contained the override "disable_api_keys": true.

Screenshots (optional):

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

Summary by CodeRabbit

  • New Features
    • Added a new configurable setting to manage API keys availability across the application.

✏️ Tip: You can customize this high-level summary in your review settings.

@RaymondLaubert RaymondLaubert self-assigned this Jan 15, 2026
@RaymondLaubert RaymondLaubert added enhancement New feature or request infrastructure A pull request containing changes affecting the infrastructure code. labels Jan 15, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

Walkthrough

This PR adds a new DisableAPIKeys boolean configuration field to the Configuration struct and its default initializer, enabling API key functionality to be toggled via configuration without introducing any behavioral changes.

Changes

Cohort / File(s) Summary
Configuration field addition
cmd/api/src/config/config.go, cmd/api/src/config/default.go
Added new public DisableAPIKeys boolean field to Configuration struct with JSON tag disable_api_keys, initialized to false in default configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • stephanieslamb
  • Useinovski

Poem

🐰 A config field hops into place,
DisableAPIKeys sets the pace,
Boolean flags, so neat and clean,
Default false—the safest scene! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a new configuration field for disabling API keys.
Description check ✅ Passed The description covers all required sections: clear description of changes, motivation/context with ticket reference, testing approach, and completed checklist items.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

🧹 Recent nitpick comments
cmd/api/src/config/config.go (1)

162-162: Minor formatting inconsistency with whitespace alignment.

The new field uses tabs for alignment while surrounding fields (lines 159-166) use spaces. This doesn't affect functionality but creates visual inconsistency in the struct definition.

🔧 Suggested fix to match surrounding formatting
-	DisableAPIKeys					bool					  `json:"disable_api_keys"`
+	DisableAPIKeys                  bool                      `json:"disable_api_keys"`
cmd/api/src/config/default.go (1)

64-66: Default value is correct; minor formatting inconsistency.

The default of false correctly enables API keys by default, requiring explicit opt-in to disable them. This aligns with the PR objectives for on-prem client configuration.

Same whitespace alignment issue as in config.go - tabs used instead of spaces for consistency with surrounding lines.

🔧 Suggested fix to match surrounding formatting
-			DisableAPIKeys: 				 false,
+			DisableAPIKeys:                  false,

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b9501e2 and 46668a8.

📒 Files selected for processing (2)
  • cmd/api/src/config/config.go
  • cmd/api/src/config/default.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build BloodHound Container Image / Build and Package Container
  • GitHub Check: run-tests
  • GitHub Check: build-ui
  • GitHub Check: run-analysis

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RaymondLaubert RaymondLaubert merged commit 35250cc into main Jan 16, 2026
13 checks passed
@RaymondLaubert RaymondLaubert deleted the BED-7133/ApiKey-AppConfig branch January 16, 2026 17:25
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request infrastructure A pull request containing changes affecting the infrastructure code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants