Skip to content

GODRIVER-3284 Allow valid SRV hostnames with less than 3 parts. #1898

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

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

qingyang-hu
Copy link
Collaborator

GODRIVER-3284

Summary

Allow valid SRV hostnames with less than 3 parts.

Background & Motivation

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Nov 18, 2024
Copy link
Contributor

API Change Report

./v2/mongo/options

incompatible changes

(*ClientOptionsBuilder).SetDriverInfo: removed
(*DistinctOptionsBuilder).SetHint: removed
ClientOptions.DriverInfo: removed
DistinctOptions.Hint: removed
DriverInfo: removed

./v2/x/mongo/driver/auth

incompatible changes

HandshakeOptions.OuterLibraryName: removed
HandshakeOptions.OuterLibraryPlatform: removed
HandshakeOptions.OuterLibraryVersion: removed

./v2/x/mongo/driver/operation

incompatible changes

(*Distinct).Hint: removed
(*Hello).OuterLibraryName: removed
(*Hello).OuterLibraryPlatform: removed
(*Hello).OuterLibraryVersion: removed

./v2/x/mongo/driver/topology

incompatible changes

WithOuterLibraryName: removed
WithOuterLibraryPlatform: removed
WithOuterLibraryVersion: removed

@qingyang-hu qingyang-hu marked this pull request as ready for review December 5, 2024 22:55
if len(separatedRecord) < 2 {
return errors.New("DNS name must contain at least 2 labels")
if l := len(separatedInputDomain); l < 3 && len(separatedRecord) <= l {
return fmt.Errorf("DNS name must contain at least %d labels", l+1)
Copy link
Member

Choose a reason for hiding this comment

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

This error is sort of ambiguous to me. What are your thoughts on matching what node.js does? https://github.com/mongodb/node-mongodb-native/pull/4197/files#diff-39b2554fd18da165b59a6351b1aafff3714e2a80c1435f2de9706355b4d32351R1181

fmt.Errorf(Server record (%d) does not have at least one more domain level than parent URI (%d), l, len(seperatedRecord))

@qingyang-hu qingyang-hu merged commit 9afdc8c into mongodb:master Jan 14, 2025
30 of 34 checks passed
@matthewdale
Copy link
Collaborator

drivers-pr-bot please backport to release/2.0

mongodb-drivers-pr-bot bot pushed a commit that referenced this pull request Feb 19, 2025
matthewdale pushed a commit that referenced this pull request Feb 20, 2025
alcaeus added a commit that referenced this pull request Mar 4, 2025
* release/2.0:
  BUMP v2.0.1
  GODRIVER-3477 Bump golang.org/x/crypto from 0.29.0 to 0.31.0 [release/2.0] (#1952)
  GODRIVER-3284 Allow valid SRV hostnames with less than 3 parts. (#1898) [release/2.0] (#1949)
  GODRIVER-3452 MergeClientOptions returns object when given nil arguments (#1917) [release/2.0] (#1948)
  GODRIVER-3443 Remove internal APIs in migration guide. (#1911) [release/2.0] (#1951)
  GODRIVER-3470 Correct BSON unmarshaling logic for null values (#1924) [master] (#1945) [release/2.0] (#1947)
  Fix erroneous nil error return in FindOne. (#1926) [release/2.0] (#1944)
  GODRIVER-3298 Handle joined errors correctly in WithTransaction. (#1928) [release/2.0] (#1931)
  GODRIVER-3307 clone returned byte slice in MarshalValue (#1913) [release/2.0] (#1921)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants