Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ControlSyncRequest Encode: cookie optionality #459

Merged
merged 2 commits into from Aug 17, 2023

Conversation

zeslava
Copy link
Contributor

@zeslava zeslava commented Aug 15, 2023

In SyncRequest cookie is optional, so do not add cookie if empty

In SyncRequest cookie is optional, so do not add cookie if empty
ControlSyncRequest Encode: cookie optionality
@zeslava
Copy link
Contributor Author

zeslava commented Aug 15, 2023

@t2y FYI

@t2y
Copy link
Contributor

t2y commented Aug 16, 2023

According to https://www.rfc-editor.org/rfc/rfc4533.html#section-2.2 , a cookie is optional. You are right.

      syncRequestValue ::= SEQUENCE {
          mode ENUMERATED {
              -- 0 unused
              refreshOnly       (1),
              -- 2 reserved
              refreshAndPersist (3)
          },
          cookie     syncCookie OPTIONAL,
          reloadHint BOOLEAN DEFAULT FALSE
      }

It works that I send nil cookie as no cookie to OpenLDAP server (2.4/2.5). https://www.rfc-editor.org/rfc/rfc4533.html#section-2.1 describes as below.

   The syncCookie is a notational convenience to indicate that, while
   the syncCookie type is encoded as an OCTET STRING, its value is an
   opaque value containing information about the synchronization session
   and its state.  Generally, the session information would include a
   hash of the operation parameters that the server requires not be
   changed and the synchronization state information would include a
   commit (log) sequence number, a change sequence number, or a time
   stamp.  For convenience of description, the term "no cookie" refers
   either to a null cookie or to a cookie with pre-initialized
   synchronization state.

      syncCookie ::= OCTET STRING

I wonder how we handle reloadHint when we don't send a cookie.

  • normal control
mode
cookie
reloadHint
  • without cookie
mode
reloadHint

or

mode

@cpuschma What do you think about proper implementation?

@t2y
Copy link
Contributor

t2y commented Aug 16, 2023

@zeslava Thank you for notifying me. I am new to LDAP protocol. I want to think together about which implementation is better.

@cpuschma
Copy link
Member

Agreed, we should stick to the LDAP RFCs and not derivate whereever possible

@cpuschma cpuschma merged commit 7f97b82 into go-ldap:master Aug 17, 2023
18 checks passed
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.

None yet

3 participants