Skip to content

Add Controls and Referrals public APIs#9

Open
vjeantet wants to merge 2 commits intolor00x:masterfrom
vjeantet:controls-referrals
Open

Add Controls and Referrals public APIs#9
vjeantet wants to merge 2 commits intolor00x:masterfrom
vjeantet:controls-referrals

Conversation

@vjeantet
Copy link
Copy Markdown
Contributor

Summary

  • NewControl(controlType, criticality, value) - constructor for building Control values
  • LDAPMessage.SetControls(controls) - attach controls to the message envelope
  • SearchResultDone.SetDiagnosticMessage(msg) - set diagnostic message on search results
  • SearchResultDone.SetReferral(referral) - attach referral URLs to search results

These are needed to build LDAP servers that return controls and referrals in responses, as required by RFC 4511 sections 4.1.11 (Controls) and 4.1.10 (Referral).

Used in vjeantet/ldapserver to support WriteWithControls(), NewReferral(), and NewSearchResultReference().

Changes

Two small commits, no breaking changes, all new public API surface:

  1. message/control.go - add NewControl() constructor
  2. message/message.go - add SetControls() method on LDAPMessage
  3. message/search_result_done.go - add SetDiagnosticMessage() and SetReferral() methods

Add SetControls method on LDAPMessage to allow setting controls on
outgoing messages, and NewControl constructor to create Control values
from Go native types.
These methods were only available on LDAPResult but not on
SearchResultDone which is a distinct defined type.
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.

1 participant