nimbu 0.10.3 → 0.10.4
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/lib/nimbu/auth.rb +10 -0
- data/lib/nimbu/command/sites.rb +0 -2
- data/lib/nimbu/command/themes.rb +8 -1
- data/lib/nimbu/server/base.rb +4 -1
- data/lib/nimbu/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: c258adca42192cb79c6dfdf1e8ff0b83ea64c204be2fecf91c30f0450ea26b2d
|
|
4
|
+
data.tar.gz: a8f018a41f46a3d77dfd11bd71fc8d195c6644c55a38c9d00956506530e4f328
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a21d79911c4e7ba0c0f53d81b5ff997b18407e8bf13316d993053fed5bf27a2c957cb89a7facb80844c3e1709d2b7db2b649dadac538856385b213a360370df
|
|
7
|
+
data.tar.gz: d9b783cc35d575446b35723605152baf61150462ad26ee5c6aac047bf52e462739c8a028bcf577a8652ba620553c77f8ea85a4c66baf9dcd7587f21203017af9
|
data/lib/nimbu/auth.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
require "yaml"
|
|
3
3
|
require "nimbu"
|
|
4
4
|
require "nimbu/helpers"
|
|
5
|
+
require 'term/ansicolor'
|
|
5
6
|
|
|
6
7
|
class Nimbu::Auth
|
|
7
8
|
class << self
|
|
@@ -297,5 +298,14 @@ class Nimbu::Auth
|
|
|
297
298
|
60.times { print "#"}
|
|
298
299
|
print "\n"
|
|
299
300
|
end
|
|
301
|
+
|
|
302
|
+
def invalid_access!
|
|
303
|
+
puts invalid_access_message.bold.red
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
def invalid_access_message
|
|
307
|
+
"Error! You do not have access to #{Nimbu::Auth.site}.#{Nimbu::Auth.admin_host}! " +
|
|
308
|
+
"Please check your site id or request access to your site owner."
|
|
309
|
+
end
|
|
300
310
|
end
|
|
301
311
|
end
|
data/lib/nimbu/command/sites.rb
CHANGED
data/lib/nimbu/command/themes.rb
CHANGED
|
@@ -21,6 +21,8 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
|
|
|
21
21
|
end
|
|
22
22
|
puts ""
|
|
23
23
|
puts "Currently this directory is configured for '#{Nimbu::Auth.theme.red.bold}'"
|
|
24
|
+
rescue ::Nimbu::Error::Forbidden
|
|
25
|
+
Nimbu::Auth.invalid_access!
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
# themes:list
|
|
@@ -63,6 +65,8 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
|
|
|
63
65
|
display " - #{a["folder"]}/#{a["name"]}"
|
|
64
66
|
end
|
|
65
67
|
end
|
|
68
|
+
rescue ::Nimbu::Error::Forbidden
|
|
69
|
+
Nimbu::Auth.invalid_access!
|
|
66
70
|
end
|
|
67
71
|
|
|
68
72
|
# themes
|
|
@@ -81,6 +85,8 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
|
|
|
81
85
|
display "\nShowing differences between local and server\nlayouts, templates, snippets and assets for '#{theme.green.bold}':"
|
|
82
86
|
json = nimbu.themes(:subdomain => Nimbu::Auth.site).get(theme)
|
|
83
87
|
check_differences(json, theme, "layouts", "templates", "snippets")
|
|
88
|
+
rescue ::Nimbu::Error::Forbidden
|
|
89
|
+
Nimbu::Auth.invalid_access!
|
|
84
90
|
end
|
|
85
91
|
|
|
86
92
|
# themes:push
|
|
@@ -227,7 +233,8 @@ class Nimbu::Command::Themes < Nimbu::Command::Base
|
|
|
227
233
|
print " (ok)\n"
|
|
228
234
|
end
|
|
229
235
|
end
|
|
230
|
-
|
|
236
|
+
rescue ::Nimbu::Error::Forbidden
|
|
237
|
+
Nimbu::Auth.invalid_access!
|
|
231
238
|
end
|
|
232
239
|
|
|
233
240
|
private
|
data/lib/nimbu/server/base.rb
CHANGED
|
@@ -110,8 +110,11 @@ module Nimbu
|
|
|
110
110
|
headers encoded_headers
|
|
111
111
|
end
|
|
112
112
|
body Base64.decode64(results["body"])
|
|
113
|
+
rescue ::Nimbu::Error::Forbidden
|
|
114
|
+
Nimbu::Auth.invalid_access!
|
|
115
|
+
Nimbu::Auth.invalid_access_message
|
|
113
116
|
rescue Exception => error
|
|
114
|
-
puts error if Nimbu.debug
|
|
117
|
+
puts error.message if Nimbu.debug
|
|
115
118
|
puts "Error! #{error.http_body if error.respond_to?(:http_body)}"
|
|
116
119
|
error.http_body
|
|
117
120
|
end
|
data/lib/nimbu/version.rb
CHANGED