fripa 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.
- checksums.yaml +4 -4
- data/README.md +25 -1
- data/lib/fripa/configuration.rb +14 -5
- data/lib/fripa/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d50f7498dd0bbd51cdedde2bdd30db19e23d50062bcc013bc4ff560888f8a830
|
|
4
|
+
data.tar.gz: b677039839af7e04549d7277976798953f48c551df25c7c3f97fb432cf176c71
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c491390606580cfecdf5a77551a00d42e661249f2cc2975a28de5bbe3ad5963a116c069d282effddd59ef6dba975f6b0185b872fd5af5b7c01058cc0e5567f83
|
|
7
|
+
data.tar.gz: 4fc759c7aa47dae2ede657e79873fc721a1fcb41480240ca695a352a9ea64cb306247623b32340047709fbb951bb848dcb4840db8990b661fed14aa18020799d
|
data/README.md
CHANGED
|
@@ -4,6 +4,9 @@ A Ruby client for the FreeIPA JSON-RPC API.
|
|
|
4
4
|
|
|
5
5
|
Docs: [FreeIPA JSON-RPC API](https://freeipa.readthedocs.io/en/latest/api/json-rpc.html)
|
|
6
6
|
|
|
7
|
+
## What is FreeIPA
|
|
8
|
+
FreeIPA (Free Identity, Policy, Audit) is an open-source identity management system for Linux/Unix environments. It provides centralized authentication, authorization, and account information by integrating LDAP, Kerberos, DNS, and certificate management. Essentially, it helps organizations manage users, groups, and access policies in a secure and unified way.
|
|
9
|
+
|
|
7
10
|
## Installation
|
|
8
11
|
|
|
9
12
|
Add this line to your application's Gemfile:
|
|
@@ -33,7 +36,9 @@ Configure your FreeIPA server settings globally. These settings are shared acros
|
|
|
33
36
|
```ruby
|
|
34
37
|
Fripa.configure do |config|
|
|
35
38
|
config.host = 'ipa.example.com'
|
|
36
|
-
config.
|
|
39
|
+
config.port = 8443 # optional, default: 443 (standard HTTPS port)
|
|
40
|
+
config.scheme = 'https' # optional, default: 'https' (use 'http' for local development)
|
|
41
|
+
config.verify_ssl = true # default: true
|
|
37
42
|
end
|
|
38
43
|
```
|
|
39
44
|
|
|
@@ -42,6 +47,8 @@ end
|
|
|
42
47
|
```ruby
|
|
43
48
|
Fripa.config = {
|
|
44
49
|
host: 'ipa.example.com',
|
|
50
|
+
port: 8443, # optional
|
|
51
|
+
scheme: 'https', # optional
|
|
45
52
|
verify_ssl: true
|
|
46
53
|
}
|
|
47
54
|
```
|
|
@@ -51,6 +58,8 @@ Fripa.config = {
|
|
|
51
58
|
```ruby
|
|
52
59
|
config = Fripa::Configuration.new(
|
|
53
60
|
host: 'ipa.example.com',
|
|
61
|
+
port: 8443, # optional
|
|
62
|
+
scheme: 'https', # optional
|
|
54
63
|
verify_ssl: true
|
|
55
64
|
)
|
|
56
65
|
Fripa.config = config
|
|
@@ -60,9 +69,24 @@ Fripa.config = config
|
|
|
60
69
|
|
|
61
70
|
```ruby
|
|
62
71
|
Fripa.config.host = 'ipa.example.com'
|
|
72
|
+
Fripa.config.port = 8443 # optional
|
|
73
|
+
Fripa.config.scheme = 'https' # optional
|
|
63
74
|
Fripa.config.verify_ssl = false
|
|
64
75
|
```
|
|
65
76
|
|
|
77
|
+
### Local development example
|
|
78
|
+
|
|
79
|
+
For local FreeIPA instances running on HTTP:
|
|
80
|
+
|
|
81
|
+
```ruby
|
|
82
|
+
Fripa.configure do |config|
|
|
83
|
+
config.host = 'localhost'
|
|
84
|
+
config.port = 8080
|
|
85
|
+
config.scheme = 'http'
|
|
86
|
+
config.verify_ssl = false
|
|
87
|
+
end
|
|
88
|
+
```
|
|
89
|
+
|
|
66
90
|
## Usage
|
|
67
91
|
|
|
68
92
|
### Creating a Client
|
data/lib/fripa/configuration.rb
CHANGED
|
@@ -6,23 +6,32 @@ require "uri"
|
|
|
6
6
|
module Fripa
|
|
7
7
|
# Configuration for Fripa
|
|
8
8
|
class Configuration
|
|
9
|
-
attr_accessor :host, :verify_ssl
|
|
9
|
+
attr_accessor :host, :port, :scheme, :verify_ssl
|
|
10
10
|
|
|
11
|
-
def initialize(host: nil, verify_ssl: true)
|
|
11
|
+
def initialize(host:, port: nil, scheme: "https", verify_ssl: true)
|
|
12
12
|
@host = host
|
|
13
|
+
@port = port
|
|
14
|
+
@scheme = scheme
|
|
13
15
|
@verify_ssl = verify_ssl
|
|
14
16
|
end
|
|
15
17
|
|
|
16
18
|
def base_url
|
|
17
|
-
|
|
19
|
+
build_uri
|
|
18
20
|
end
|
|
19
21
|
|
|
20
22
|
def login_url
|
|
21
|
-
|
|
23
|
+
build_uri(path: "/ipa/session/login_password")
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
def api_url
|
|
25
|
-
|
|
27
|
+
build_uri(path: "/ipa/session/json")
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
def build_uri(path: nil)
|
|
33
|
+
uri_class = scheme == "https" ? URI::HTTPS : URI::HTTP
|
|
34
|
+
uri_class.build(host: host, port: port, path: path)
|
|
26
35
|
end
|
|
27
36
|
end
|
|
28
37
|
|
data/lib/fripa/version.rb
CHANGED