-
Notifications
You must be signed in to change notification settings - Fork 13
Authenticate to LDAP using creds are configured #327
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -362,10 +362,13 @@ func (g *GDriveSource) SyncFilesToFilestore(ctx context.Context, fs *filestore.F | |
| if stored { | ||
| logger.Info("stored gdrive file", | ||
| "fileID", record.FileID, "fileName", record.FileName) | ||
| mu.Lock() | ||
| storedFiles = append(storedFiles, file) | ||
| mu.Unlock() | ||
| } | ||
|
|
||
| // still append the file to the storedFiles list, | ||
| mu.Lock() | ||
| storedFiles = append(storedFiles, file) | ||
| mu.Unlock() | ||
|
Comment on lines
+366
to
+370
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Do not record skipped oversized files as successfully processed.
🤖 Prompt for AI Agents |
||
|
|
||
| return nil | ||
| }) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 46853
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 37177
Reject partial LDAP credentials instead of selecting anonymous bind.
When either
LdapUserNameorLdapPasswordis empty, the client performsUnauthenticatedBind(""). This can silently ignore a configured username whenLDAP_PASSWORDis missing. Reject partial credentials during initialization and reconnection. Allow anonymous binding only when both values are empty.🤖 Prompt for AI Agents
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 25957
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 30390
Require encrypted LDAP for credentialed binds.
With
ldap://,Bindsends credentials in an LDAP simple bind over TCP. When credentials are configured, rejectldap://or call certificate-validatedStartTLSbefore bothBindcalls. Update the sample and API documentation to useldaps://.🤖 Prompt for AI Agents
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 5758
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 1877
🌐 Web query:
github.com/go-ldap/ldap/v3 v3.4.13 Conn SetTimeout Bind implementation💡 Result:
In the go-ldap/ldap/v3 library (specifically version 3.4.13), the SetTimeout method and the Bind method are separate components of the Conn struct, and they interact in the context of request lifecycle management [1][2][3]. SetTimeout implementation: The SetTimeout method configures a duration used for individual LDAP request timeouts, not for the underlying TCP connection timeout [4][3]. When a timeout is set (greater than zero), the library initiates a background goroutine for each request sent via the connection [3]. This goroutine sleeps for the specified duration and, if the request has not yet completed, sends a MessageTimeout packet to the connection's processing loop [3]. This causes the library to stop waiting for the server's response, close the associated response channel, and return an error (typically "ldap: connection timed out") to the caller [3]. Bind implementation: The Bind method performs a simple bind operation using the provided username and password [1]. Internally, it creates a SimpleBindRequest and calls the SimpleBind method [1]. Because SimpleBind uses the internal message sending mechanism (typically sendMessage), it is subject to the request timeout configured by SetTimeout [3]. If the Bind request takes longer than the duration specified in SetTimeout, the background timer will trigger, and the Bind call will return an error [4][3]. Important Clarifications: 1. Terminology: Users often confuse SetTimeout with connection-level timeouts [4]. As noted in library discussions, SetTimeout specifically controls the timeout for an individual LDAP operation [4]. To control the initial TCP connection timeout, users should use a custom dialer (e.g., net.Dialer) passed via DialWithDialer when establishing the connection [4]. 2. Versioning: The implementation of these mechanics remains consistent across the v3.x releases, including v3.4.13 [5][2][3]. 3. Best Practice: Because SetTimeout is a global setting on the Conn object, it applies to all subsequent operations performed on that connection until changed [3]. If you need different timeouts for different operations, consider that SetTimeout is not thread-safe for concurrent adjustments and is intended to be a persistent configuration for the connection's operations [3].
Citations:
Set an LDAP operation timeout for every bind path.
The 5-second
net.Dialertimeout does not limit LDAP responses. A bind can block when the server accepts TCP but does not respond. Set an operation timeout on both the initial and replacement connections before binding.🤖 Prompt for AI Agents