forked from go-ldap/ldap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extend SearchResult
Unmarshal
to support *string as field type (
- Loading branch information
1 parent
707a142
commit 032ab34
Showing
4 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,11 @@ func TestEntry_Unmarshal(t *testing.T) { | |
Values: []string{"[email protected]"}, | ||
ByteValues: nil, | ||
}, | ||
{ | ||
Name: "upn", | ||
Values: []string{"[email protected]"}, | ||
ByteValues: nil, | ||
}, | ||
// Tests int value. | ||
{ | ||
Name: "id", | ||
|
@@ -132,6 +137,7 @@ func TestEntry_Unmarshal(t *testing.T) { | |
Dn string `ldap:"dn"` | ||
Cn string `ldap:"cn"` | ||
Mail string `ldap:"mail"` | ||
UPN *string `ldap:"upn"` | ||
ID int `ldap:"id"` | ||
LongID int64 `ldap:"longId"` | ||
Data []byte `ldap:"data"` | ||
|
@@ -157,10 +163,12 @@ func TestEntry_Unmarshal(t *testing.T) { | |
children = append(children, dn) | ||
} | ||
|
||
UPN := "[email protected]" | ||
expect := &User{ | ||
Dn: "cn=mario,ou=Users,dc=go-ldap,dc=github,dc=com", | ||
Cn: "mario", | ||
Mail: "[email protected]", | ||
UPN: &UPN, | ||
ID: 2147483647, | ||
LongID: 9223372036854775807, | ||
Data: []byte("data"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,11 @@ func TestEntry_Unmarshal(t *testing.T) { | |
Values: []string{"[email protected]"}, | ||
ByteValues: nil, | ||
}, | ||
{ | ||
Name: "upn", | ||
Values: []string{"[email protected]"}, | ||
ByteValues: nil, | ||
}, | ||
// Tests int value. | ||
{ | ||
Name: "id", | ||
|
@@ -132,6 +137,7 @@ func TestEntry_Unmarshal(t *testing.T) { | |
Dn string `ldap:"dn"` | ||
Cn string `ldap:"cn"` | ||
Mail string `ldap:"mail"` | ||
UPN *string `ldap:"upn"` | ||
ID int `ldap:"id"` | ||
LongID int64 `ldap:"longId"` | ||
Data []byte `ldap:"data"` | ||
|
@@ -157,10 +163,12 @@ func TestEntry_Unmarshal(t *testing.T) { | |
children = append(children, dn) | ||
} | ||
|
||
UPN := "[email protected]" | ||
expect := &User{ | ||
Dn: "cn=mario,ou=Users,dc=go-ldap,dc=github,dc=com", | ||
Cn: "mario", | ||
Mail: "[email protected]", | ||
UPN: &UPN, | ||
ID: 2147483647, | ||
LongID: 9223372036854775807, | ||
Data: []byte("data"), | ||
|