Skip to content

chore: Trying Augment to break down LdapUtils responsibilities#290

Draft
definitelynotagoblin wants to merge 1 commit intov4from
anemeth/ldap-utils-breakdown_augment
Draft

chore: Trying Augment to break down LdapUtils responsibilities#290
definitelynotagoblin wants to merge 1 commit intov4from
anemeth/ldap-utils-breakdown_augment

Conversation

@definitelynotagoblin
Copy link
Copy Markdown
Contributor

Description

Motivation and Context

This PR addresses: [GitHub issue or Jira ticket number]

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Chore (a change that does not modify the application functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

@definitelynotagoblin definitelynotagoblin self-assigned this Apr 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0c257b77-ecd6-43af-9696-54d325d39837

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch anemeth/ldap-utils-breakdown_augment

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.

// Pass 'this' so that virtual-method overrides (e.g. via Moq) are respected.
_wkpService = new WellKnownPrincipalService(this, _domainControllerRegistry, _log);
_principalResolver = new PrincipalResolver(this, _wkpService, _domainControllerRegistry, _ldapConfig, _log, _metric);
_hostResolver = new HostResolver(_principalResolver, _portScanner, _nativeMethods, _log);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (non-blocking): the hostResolver is set to readonly, and is not updated in reset, yet it is reliant on the _principalResolver which is reset. After a reset the LdapUtils._principalResolver and the _hostResolver._principalResolvers are different instances. This may cause some cache misses on _distinguishedNameCache down the line.

return true;
}

var resDomain = await _utils.GetDomainNameFromSid(domainName) is (false, var tempDomain)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (non-blocking): augment flagged this as an existing bug? should the tempDomain be used if _utils.GetDomainNameFromSid is (false, _)?

_dcRegistry.Add(domainControllerSID);
}

private IDirectoryObject CreateDirectoryEntry(string path) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (non-blocking): this function is duplicated in LdapUtils, should it instead be exposed through ILdapUtils and called from PrincipalResolver?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

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.

2 participants