distinguished_name 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +21 -2
- data/lib/distinguished_name/transform.rb +1 -0
- data/lib/distinguished_name/version.rb +1 -1
- data/test/transform_test.rb +2 -2
- metadata +1 -1
data/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
A String Representation of Distinguished Names
|
|
1
|
+
#A String Representation of Distinguished Names
|
|
2
|
+
|
|
3
|
+
* This is a gem for interacting with the string representation of distinguished names, per the RFC-1779 (http://www.ietf.org/rfc/rfc1779.txt)
|
|
4
|
+
|
|
5
|
+
* It will allow you to transform a distinguished name that is passed from Apache in a particular format into another format.
|
|
6
|
+
```
|
|
7
|
+
DistinguishedName::Transform.slashify("CN=Welker.Wes.83,OU=people,OU=Patriots,O=NFL,C=US")
|
|
8
|
+
# => "/C=US/O=NFL/OU=Patriots/OU=people/CN=Welker.Wes.83"
|
|
9
|
+
DistinguishedName::Transform.ldapify("/C=US/O=NFL/OU=Patriots/OU=people/CN=Welker.Wes.83")
|
|
10
|
+
# => "CN=Welker.Wes.83,OU=people,OU=Patriots,O=NFL,C=US"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
* It will also leave distinguished names 'unconverted', but still validate them
|
|
14
|
+
```
|
|
15
|
+
DistinguishedName::Transform.slashify("/C=US/O=NFL/OU=Patriots/OU=people/CN=Welker.Wes.83")
|
|
16
|
+
# => "/C=US/O=NFL/OU=Patriots/OU=people/CN=Welker.Wes.83"
|
|
17
|
+
DistinguishedName::Transform.ldapify("CN=Welker.Wes.83,OU=people,OU=Patriots,O=NFL,C=US")
|
|
18
|
+
# => "CN=Welker.Wes.83,OU=people,OU=Patriots,O=NFL,C=US"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
* It will raise an OpenSSL::X509::NameError if you give it an invalid Distinguished Name
|
|
2
22
|
|
|
3
|
-
This is a gem for interacting with the string representation of distinguished names, per the RFC-1779 (http://www.ietf.org/rfc/rfc1779.txt)
|
data/test/transform_test.rb
CHANGED
|
@@ -4,8 +4,8 @@ class TransformTest < Test::Unit::TestCase
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def setup
|
|
7
|
-
@ldap_dn = "CN=
|
|
8
|
-
@slash_dn = "/C=US/O=NFL/OU=
|
|
7
|
+
@ldap_dn = "CN=Welker.Wes.83,OU=people,OU=Patriots,O=NFL,C=US"
|
|
8
|
+
@slash_dn = "/C=US/O=NFL/OU=Patriots/OU=people/CN=Welker.Wes.83"
|
|
9
9
|
super
|
|
10
10
|
end
|
|
11
11
|
|