kaui 0.7.1 → 0.7.2
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/Gemfile.lock +1 -1
- data/README.md +5 -8
- data/app/models/kaui/user.rb +0 -2
- data/app/views/kaui/home/index.html.erb +2 -2
- data/lib/kaui/version.rb +1 -1
- data/lib/kaui.rb +0 -6
- data/test/dummy/config/environments/development.rb +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcfdad169627618fcedf7f8d57019705ddbd1fad
|
4
|
+
data.tar.gz: ffb855fc7166ec29ff766a78b20bee6dc374011e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22c1fc01244a91e541c9037d314d0047e074ec2746931614094c8eb8b0ea4f09cb37b619255204a191c59c1dbf89bdf79d62e46d23c66f987f3de4120bd45343
|
7
|
+
data.tar.gz: 775ec5703c332ca338732047d06b77e3be2cf964b5efbb50fd4d3b6eb272cd2d1aa719cc0f281cb326bb21e568f7db887208c30637a0a8dbba688c617be6853c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,10 +7,8 @@ Getting started
|
|
7
7
|
Running Kaui
|
8
8
|
------------
|
9
9
|
|
10
|
-
You can run Kaui locally using the sandbox script:
|
10
|
+
You can run Kaui locally by using the sandbox script:
|
11
11
|
|
12
|
-
# Point to your killbill installation
|
13
|
-
export KILLBILL_URL="http://killbill.company.com:8080"
|
14
12
|
# Run the sandbox script
|
15
13
|
bundle exec script/sandbox
|
16
14
|
# Start the Rails app
|
@@ -24,19 +22,18 @@ Mounting Kaui into your own Rails app
|
|
24
22
|
The Kaui gem comes with a `kaui` script to mount it in your existing Rails app.
|
25
23
|
|
26
24
|
Kaui expects the container app to define the <tt>current_user</tt> method, which returns the
|
27
|
-
name of the logged-in user. This is used by
|
25
|
+
name of the logged-in user. This is used by Kill Bill for auditing purposes.
|
28
26
|
|
29
|
-
Finally,
|
30
|
-
variable to point to your existing Killbill installation (e.g. http://killbill.company.com:8080).
|
27
|
+
Finally, a Kill Bill server needs to be running for Kaui to fetch its information (see the Configuration section below).
|
31
28
|
The default login credentials are admin/password. Users, Credentials, Roles and Permissions are
|
32
29
|
passed through to Kill Bill. It uses Basic Auth by default, but the backend is pluggable (LDAP,
|
33
30
|
ActiveDirectory, etc.).
|
34
31
|
|
35
32
|
|
36
|
-
|
33
|
+
Configuration
|
37
34
|
-------------
|
38
35
|
|
39
|
-
|
36
|
+
Specify your Kill Bill server url, api key and secret in ```config/initializers/killbill_client.rb```:
|
40
37
|
|
41
38
|
```
|
42
39
|
KillBillClient.url = 'http://127.0.0.1:8080/'
|
data/app/models/kaui/user.rb
CHANGED
@@ -28,7 +28,6 @@ module Kaui
|
|
28
28
|
|
29
29
|
# Verify the Kill Bill session hasn't timed-out
|
30
30
|
def authenticated_with_killbill?(api_key=KillBillClient.api_key, api_secret=KillBillClient.api_secret)
|
31
|
-
KillBillClient.url = Kaui.killbill_finder.call
|
32
31
|
subject = KillBillClient::Model::Security.find_subject :session_id => kb_session_id,
|
33
32
|
:api_key => api_key,
|
34
33
|
:api_secret => api_secret
|
@@ -40,7 +39,6 @@ module Kaui
|
|
40
39
|
private
|
41
40
|
|
42
41
|
def self.do_find_permissions(options = {})
|
43
|
-
KillBillClient.url = Kaui.killbill_finder.call
|
44
42
|
KillBillClient::Model::Security.find_permissions options
|
45
43
|
end
|
46
44
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<header class='hero-unit'>
|
2
2
|
<h1>Welcome to Kaui!</h1>
|
3
|
-
<p class='lead'>Online documentation can be found at <a href='http://
|
3
|
+
<p class='lead'>Online documentation can be found at <a href='http://kill-bill.org/' target='_blank'>http://kill-bill.org/</a></p>
|
4
4
|
|
5
5
|
<p>About your application’s environment:
|
6
6
|
<ul>
|
7
|
-
<li>Kill Bill url: <%=
|
7
|
+
<li>Kill Bill url: <%= KillBillClient.url %></li>
|
8
8
|
</ul>
|
9
9
|
</p>
|
10
10
|
</header>
|
data/lib/kaui/version.rb
CHANGED
data/lib/kaui.rb
CHANGED
@@ -4,16 +4,13 @@
|
|
4
4
|
require "kaui/engine"
|
5
5
|
|
6
6
|
module Kaui
|
7
|
-
mattr_accessor :killbill_finder
|
8
7
|
mattr_accessor :account_home_path
|
9
8
|
mattr_accessor :bundle_home_path
|
10
9
|
mattr_accessor :invoice_home_path
|
11
10
|
mattr_accessor :bundle_key_display_string
|
12
11
|
mattr_accessor :creditcard_plugin_name
|
13
12
|
mattr_accessor :layout
|
14
|
-
mattr_accessor :killbill_url
|
15
13
|
|
16
|
-
self.killbill_finder = lambda { self.config[:killbill_url] }
|
17
14
|
self.account_home_path = lambda {|account_id| Kaui::Engine.routes.url_helpers.account_path(account_id) }
|
18
15
|
self.bundle_home_path = lambda {|bundle_id| Kaui::Engine.routes.url_helpers.bundle_path(:id => bundle_id) }
|
19
16
|
self.invoice_home_path = lambda {|invoice_id| Kaui::Engine.routes.url_helpers.invoice_path(:id => invoice_id) }
|
@@ -24,11 +21,8 @@ module Kaui
|
|
24
21
|
# TODO
|
25
22
|
{
|
26
23
|
:layout => layout || 'kaui/layouts/kaui_application',
|
27
|
-
:killbill_url => killbill_url || ENV['KILLBILL_URL'] || 'http://127.0.0.1:8080'
|
28
24
|
}
|
29
25
|
end
|
30
|
-
|
31
|
-
KillBillClient.url = Kaui.killbill_finder.call
|
32
26
|
end
|
33
27
|
|
34
28
|
# ruby-1.8 compatibility
|
@@ -1,8 +1,6 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
|
-
config.killbill_url = ENV["KILLBILL_URL"] || "http://127.0.0.1:8080"
|
5
|
-
|
6
4
|
# In the development environment your application's code is reloaded on
|
7
5
|
# every request. This slows down response time but is perfect for development
|
8
6
|
# since you don't have to restart the web server when you make code changes.
|