conjur-asset-ui 1.3.0 → 1.3.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/.gitignore +3 -1
- data/.jshintrc +41 -0
- data/Gemfile +3 -1
- data/README.md +34 -0
- data/Rakefile +69 -1
- data/bower.json +93 -0
- data/conjur-asset-ui.gemspec +1 -1
- data/features/navigation_bar.feature +31 -0
- data/features/step_definitions/custom_step.rb +32 -0
- data/features/support/env.rb +38 -0
- data/features/support/hooks.rb +30 -0
- data/features/support/world.rb +17 -0
- data/gulpfile.js +140 -0
- data/lib/conjur/command/ui.rb +1 -1
- data/lib/conjur/webserver/server.rb +14 -9
- data/lib/conjur-asset-ui-version.rb +1 -1
- data/package.json +47 -0
- data/preprocessor.js +7 -0
- data/public/_client_libs.html +2 -15
- data/public/css/styles.less +170 -4
- data/public/index.html.erb +5 -7
- data/public/js/init.js +183 -97
- data/public/js/lib/sorted-set.no-require.js +3 -28
- data/public/js/models/groupRecord.js +12 -11
- data/public/js/models/hostRecord.js +6 -7
- data/public/js/models/layerRecord.js +12 -11
- data/public/js/models/namespace.js +2 -0
- data/public/js/models/policyList.js +3 -1
- data/public/js/models/policyRecord.js +6 -7
- data/public/js/models/record.js +24 -23
- data/public/js/models/resourceList.js +28 -10
- data/public/js/models/userList.js +7 -2
- data/public/js/models/userRecord.js +7 -8
- data/public/js/models/variableList.js +18 -7
- data/public/js/models/variableRecord.js +13 -12
- data/public/js/routers.js +72 -26
- data/public/js/views/annotations.js +38 -27
- data/public/js/views/audit.js +23 -17
- data/public/js/views/chart.js +471 -0
- data/public/js/views/dashboard.js +94 -58
- data/public/js/views/generic.js +16 -9
- data/public/js/views/group.js +94 -55
- data/public/js/views/groups.js +3 -7
- data/public/js/views/host.js +75 -44
- data/public/js/views/hosts.js +2 -6
- data/public/js/views/layer.js +127 -82
- data/public/js/views/layers.js +2 -6
- data/public/js/views/mixins/search.js +12 -5
- data/public/js/views/mixins/tabs.js +95 -55
- data/public/js/views/navSearch.js +16 -5
- data/public/js/views/owned.js +14 -8
- data/public/js/views/permissions.js +244 -178
- data/public/js/views/policies.js +2 -4
- data/public/js/views/policy.js +65 -38
- data/public/js/views/resource.js +49 -34
- data/public/js/views/role.js +52 -37
- data/public/js/views/searchResults.js +205 -138
- data/public/js/views/time.js +26 -13
- data/public/js/views/user.js +178 -55
- data/public/js/views/users.js +2 -7
- data/public/js/views/variable.js +226 -45
- data/public/js/views/variables.js +4 -8
- metadata +20 -20
- data/public/_client_code.html +0 -42
- data/public/css/bootstrap.css +0 -7
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +0 -229
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/js/lib/JSXTransformer.js +0 -10862
- data/public/js/lib/async.js +0 -958
- data/public/js/lib/backbone.js +0 -2
- data/public/js/lib/bootstrap.js +0 -6
- data/public/js/lib/less.js +0 -16
- data/public/js/lib/moment.js +0 -7768
- data/public/js/lib/react-bootstrap.js +0 -5346
- data/public/js/lib/react-bootstrap.min.js +0 -4
- data/public/js/lib/underscore-min.js +0 -6
- data/public/js/lib/underscore.string.min.js +0 -1
- data/public/js/main.js +0 -57
@@ -1,3 +1,5 @@
|
|
1
|
+
/* global conjur, jQuery, async */
|
2
|
+
|
1
3
|
(function(conjur, $, async, errback) {
|
2
4
|
'use strict';
|
3
5
|
|
@@ -18,12 +20,11 @@
|
|
18
20
|
Group.prototype = Object.create(Generic.prototype);
|
19
21
|
Group.prototype.constructor = Group;
|
20
22
|
|
21
|
-
Group.prototype.fetch = function(callback,
|
22
|
-
var
|
23
|
-
id = this.id;
|
23
|
+
Group.prototype.fetch = function(callback, customErrback) {
|
24
|
+
var id = this.id;
|
24
25
|
|
25
|
-
if (typeof(
|
26
|
-
|
26
|
+
if (typeof(customErrback) === 'undefined') {
|
27
|
+
customErrback = errback; // reset to default
|
27
28
|
}
|
28
29
|
|
29
30
|
async.parallel([
|
@@ -31,11 +32,11 @@
|
|
31
32
|
this.ownedResources.bind(this),
|
32
33
|
function(cb) {
|
33
34
|
$.ajax({
|
34
|
-
url: '/api/authz/'
|
35
|
-
|
36
|
-
|
37
|
-
+
|
38
|
-
|
35
|
+
url: '/api/authz/' +
|
36
|
+
conjur.app.configuration.account +
|
37
|
+
'/roles/group/' +
|
38
|
+
id +
|
39
|
+
'?members',
|
39
40
|
success: function(result) {
|
40
41
|
cb(null, result);
|
41
42
|
},
|
@@ -46,7 +47,7 @@
|
|
46
47
|
this.resource.bind(this)
|
47
48
|
], function(err, results) {
|
48
49
|
if (err) {
|
49
|
-
return
|
50
|
+
return customErrback(err.status);
|
50
51
|
}
|
51
52
|
|
52
53
|
callback({
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/* global conjur, async */
|
2
|
+
|
1
3
|
(function(conjur, async, errback) {
|
2
4
|
'use strict';
|
3
5
|
|
@@ -18,12 +20,9 @@
|
|
18
20
|
Host.prototype = Object.create(Generic.prototype);
|
19
21
|
Host.prototype.constructor = Host;
|
20
22
|
|
21
|
-
Host.prototype.fetch = function(callback,
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
if (typeof(custom_errback) === 'undefined') {
|
26
|
-
custom_errback = errback; // reset to default
|
23
|
+
Host.prototype.fetch = function(callback, customErrback) {
|
24
|
+
if (typeof(customErrback) === 'undefined') {
|
25
|
+
customErrback = errback; // reset to default
|
27
26
|
}
|
28
27
|
|
29
28
|
async.parallel([
|
@@ -33,7 +32,7 @@
|
|
33
32
|
this.resource.bind(this)
|
34
33
|
], function(err, results) {
|
35
34
|
if (err) {
|
36
|
-
return
|
35
|
+
return customErrback(err.status);
|
37
36
|
}
|
38
37
|
|
39
38
|
callback({
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/* global conjur, jQuery, _, async */
|
2
|
+
|
1
3
|
(function(conjur, $, _, async, errback) {
|
2
4
|
'use strict';
|
3
5
|
|
@@ -18,22 +20,21 @@
|
|
18
20
|
Layer.prototype = Object.create(Generic.prototype);
|
19
21
|
Layer.prototype.constructor = Layer;
|
20
22
|
|
21
|
-
Layer.prototype.fetch = function(callback,
|
22
|
-
var
|
23
|
-
id = this.id;
|
23
|
+
Layer.prototype.fetch = function(callback, customErrback) {
|
24
|
+
var id = this.id;
|
24
25
|
|
25
|
-
if (typeof(
|
26
|
-
|
26
|
+
if (typeof(customErrback) === 'undefined') {
|
27
|
+
customErrback = errback; // reset to default
|
27
28
|
}
|
28
29
|
|
29
30
|
function members(role) {
|
30
31
|
return function(cb) {
|
31
32
|
$.ajax({
|
32
|
-
url: '/api/authz/'
|
33
|
-
|
34
|
-
|
35
|
-
+
|
36
|
-
|
33
|
+
url: '/api/authz/' +
|
34
|
+
conjur.app.configuration.account +
|
35
|
+
'/roles/' +
|
36
|
+
role +
|
37
|
+
'?members',
|
37
38
|
success: function(result) {
|
38
39
|
cb(null, result);
|
39
40
|
},
|
@@ -51,7 +52,7 @@
|
|
51
52
|
this.resource.bind(this)
|
52
53
|
], function(err, results) {
|
53
54
|
if (err) {
|
54
|
-
return
|
55
|
+
return customErrback(err.status);
|
55
56
|
}
|
56
57
|
|
57
58
|
callback({
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/* global conjur, async */
|
2
|
+
|
1
3
|
(function(conjur, async, errback) {
|
2
4
|
'use strict';
|
3
5
|
|
@@ -18,12 +20,9 @@
|
|
18
20
|
Policy.prototype = Object.create(Generic.prototype);
|
19
21
|
Policy.prototype.constructor = Policy;
|
20
22
|
|
21
|
-
Policy.prototype.fetch = function(callback,
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
if (typeof(custom_errback) == 'undefined') {
|
26
|
-
custom_errback = errback; // reset to default
|
23
|
+
Policy.prototype.fetch = function(callback, customErrback) {
|
24
|
+
if (typeof(customErrback) === 'undefined') {
|
25
|
+
customErrback = errback; // reset to default
|
27
26
|
}
|
28
27
|
|
29
28
|
async.parallel([
|
@@ -32,7 +31,7 @@
|
|
32
31
|
this.allRoles.bind(this)
|
33
32
|
], function(err, results) {
|
34
33
|
if (err) {
|
35
|
-
return
|
34
|
+
return customErrback(err.status);
|
36
35
|
}
|
37
36
|
|
38
37
|
callback({
|
data/public/js/models/record.js
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
/* global conjur, jQuery */
|
2
|
+
|
1
3
|
(function(conjur, $, errback) {
|
2
4
|
'use strict';
|
3
5
|
|
@@ -19,36 +21,35 @@
|
|
19
21
|
Generic.prototype.attributes = function(callback) {
|
20
22
|
var id = this.id;
|
21
23
|
|
22
|
-
ajax('/api/'
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
ajax('/api/'+
|
25
|
+
conjur.utils.pluralize(this.kind) +
|
26
|
+
'/' +
|
27
|
+
window.encodeURIComponent(id),
|
26
28
|
callback);
|
27
29
|
};
|
28
30
|
|
29
31
|
Generic.prototype.resource = function(callback) {
|
30
|
-
ajax('/api/authz/'
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
ajax('/api/authz/' +
|
33
|
+
conjur.app.configuration.account +
|
34
|
+
'/resources/' +
|
35
|
+
this.kind +
|
36
|
+
'/' +
|
37
|
+
window.encodeURIComponent(this.id),
|
36
38
|
callback);
|
37
39
|
};
|
38
40
|
|
39
41
|
Generic.prototype.ownedResources = function(callback) {
|
40
|
-
var id = this.id;
|
41
42
|
var roleid = [this.kind, this.id].join(':');
|
42
43
|
|
43
|
-
ajax('/api/authz/'
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
ajax('/api/authz/' +
|
45
|
+
conjur.app.configuration.account +
|
46
|
+
'/resources?owner=' +
|
47
|
+
roleid,
|
47
48
|
function(err, result) {
|
48
49
|
if (typeof result.filter === 'function') {
|
49
50
|
result = result.filter(function(item) {
|
50
51
|
// assets of 'secret' kind are internal
|
51
|
-
return item.id.split(':')[1]
|
52
|
+
return item.id.split(':')[1] !== 'secret';
|
52
53
|
});
|
53
54
|
}
|
54
55
|
|
@@ -57,13 +58,13 @@
|
|
57
58
|
};
|
58
59
|
|
59
60
|
Generic.prototype.allRoles = function(callback) {
|
60
|
-
ajax('/api/authz/'
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
61
|
+
ajax('/api/authz/' +
|
62
|
+
conjur.app.configuration.account +
|
63
|
+
'/roles/' +
|
64
|
+
window.encodeURIComponent(this.kind) +
|
65
|
+
'/' +
|
66
|
+
window.encodeURIComponent(this.id) +
|
67
|
+
'?all',
|
67
68
|
callback);
|
68
69
|
};
|
69
70
|
|
@@ -1,20 +1,23 @@
|
|
1
|
+
/* global conjur, jQuery, _ */
|
2
|
+
|
1
3
|
(function(conjur, $, _) {
|
2
4
|
'use strict';
|
3
5
|
|
4
|
-
|
6
|
+
this.ResourceList = function(kind, options) {
|
5
7
|
var List = function() {
|
6
8
|
this._members = null;
|
7
9
|
this.namespaces = null;
|
8
10
|
this.options = options || {};
|
9
11
|
|
10
|
-
if (
|
12
|
+
if (!this.options.idSelector) {
|
11
13
|
this.options.idSelector = function(member) {
|
12
14
|
var idTokens = member.id.split(':');
|
15
|
+
|
13
16
|
return idTokens[idTokens.length-1];
|
14
17
|
};
|
15
18
|
}
|
16
19
|
|
17
|
-
if (
|
20
|
+
if (!this.options.namespaceSelector) {
|
18
21
|
this.options.namespaceSelector = function(member) {
|
19
22
|
return member.identifier.split('/')[0];
|
20
23
|
};
|
@@ -24,7 +27,7 @@
|
|
24
27
|
List.prototype.members = function(namespace) {
|
25
28
|
var result;
|
26
29
|
|
27
|
-
if (
|
30
|
+
if (namespace === '') {
|
28
31
|
result = _.clone(this._members);
|
29
32
|
} else {
|
30
33
|
result = this._members.filter(function(o) {
|
@@ -38,32 +41,47 @@
|
|
38
41
|
};
|
39
42
|
|
40
43
|
List.prototype.fetch = function(callback) {
|
41
|
-
if (
|
44
|
+
if (this._members) {
|
42
45
|
return callback(this);
|
46
|
+
}
|
43
47
|
|
44
48
|
var self = this;
|
45
49
|
|
46
50
|
$.ajax({
|
47
|
-
url:
|
51
|
+
url: '/api/authz/' +
|
52
|
+
window.encodeURIComponent(conjur.app.configuration.account) +
|
53
|
+
'/resources/' +
|
54
|
+
window.encodeURIComponent(kind),
|
48
55
|
success: function(data) {
|
49
|
-
var filter
|
56
|
+
var filter = this.options.filter;
|
50
57
|
|
51
|
-
if (
|
58
|
+
if (filter) {
|
52
59
|
data = _.filter(data, filter);
|
53
60
|
}
|
54
61
|
|
55
62
|
self._members = data;
|
63
|
+
|
56
64
|
self._members.forEach(function(member) {
|
57
65
|
member.identifier = this.options.idSelector(member);
|
58
66
|
}.bind(this));
|
59
|
-
|
67
|
+
|
68
|
+
self.namespaces = _.unique(
|
69
|
+
self._members.map(this.options.namespaceSelector)
|
70
|
+
).sort();
|
71
|
+
|
60
72
|
callback(self);
|
61
73
|
}.bind(this)
|
62
74
|
});
|
63
75
|
|
76
|
+
return undefined;
|
64
77
|
};
|
65
78
|
|
66
79
|
return new List();
|
67
80
|
};
|
68
81
|
|
69
|
-
})(conjur
|
82
|
+
}).bind(conjur.models)
|
83
|
+
(
|
84
|
+
conjur,
|
85
|
+
jQuery,
|
86
|
+
_
|
87
|
+
);
|
@@ -1,7 +1,9 @@
|
|
1
|
+
/* global conjur */
|
2
|
+
|
1
3
|
(function(conjur) {
|
2
4
|
'use strict';
|
3
5
|
|
4
|
-
|
6
|
+
this.UserList = function() {
|
5
7
|
var options = {
|
6
8
|
namespaceSelector: function(member) {
|
7
9
|
var idTokens = member.id.split('@');
|
@@ -17,4 +19,7 @@
|
|
17
19
|
return conjur.models.ResourceList('user', options);
|
18
20
|
};
|
19
21
|
|
20
|
-
})(conjur)
|
22
|
+
}).bind(conjur.models)
|
23
|
+
(
|
24
|
+
conjur
|
25
|
+
);
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/* global conjur, jQuery, async */
|
2
|
+
|
1
3
|
(function(conjur, $, async, errback) {
|
2
4
|
'use strict';
|
3
5
|
|
@@ -18,7 +20,7 @@
|
|
18
20
|
User.prototype = Object.create(Generic.prototype);
|
19
21
|
User.prototype.constructor = User;
|
20
22
|
|
21
|
-
User.prototype.publicKeys = function(callback
|
23
|
+
User.prototype.publicKeys = function(callback) {
|
22
24
|
$.ajax({
|
23
25
|
url: '/api/pubkeys/' + window.encodeURIComponent(this.id),
|
24
26
|
success: function(data) {
|
@@ -30,12 +32,9 @@
|
|
30
32
|
});
|
31
33
|
};
|
32
34
|
|
33
|
-
User.prototype.fetch = function(callback,
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
if (typeof(custom_errback) === 'undefined') {
|
38
|
-
custom_errback = errback; // reset to default
|
35
|
+
User.prototype.fetch = function(callback, customErrback) {
|
36
|
+
if (typeof(customErrback) === 'undefined') {
|
37
|
+
customErrback = errback; // reset to default
|
39
38
|
}
|
40
39
|
|
41
40
|
async.parallel([
|
@@ -46,7 +45,7 @@
|
|
46
45
|
this.publicKeys.bind(this)
|
47
46
|
], function(err, results) {
|
48
47
|
if (err) {
|
49
|
-
return
|
48
|
+
return customErrback(err.status);
|
50
49
|
}
|
51
50
|
|
52
51
|
callback({
|
@@ -1,16 +1,27 @@
|
|
1
|
+
/* global conjur */
|
2
|
+
|
1
3
|
(function(conjur) {
|
2
4
|
'use strict';
|
3
5
|
|
4
|
-
|
6
|
+
this.VariableList = function() {
|
5
7
|
var options = {
|
6
|
-
|
7
|
-
var idTokens = member.id.split('
|
8
|
-
|
9
|
-
|
8
|
+
namespaceSelector: function(member) {
|
9
|
+
var idTokens = member.id.split('@');
|
10
|
+
|
11
|
+
if (idTokens.length > 1) {
|
12
|
+
return idTokens.slice(1, idTokens.length-1).join['@'];
|
13
|
+
} else {
|
14
|
+
return null;
|
15
|
+
}
|
10
16
|
}
|
11
17
|
};
|
12
18
|
|
13
|
-
|
19
|
+
var list = conjur.models.ResourceList('variable', options);
|
20
|
+
|
21
|
+
return list;
|
14
22
|
};
|
15
23
|
|
16
|
-
})(conjur)
|
24
|
+
}).bind(conjur.models)
|
25
|
+
(
|
26
|
+
conjur
|
27
|
+
);
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/* global conjur, jQuery, async */
|
2
|
+
|
1
3
|
(function(conjur, $, async, errback) {
|
2
4
|
'use strict';
|
3
5
|
|
@@ -18,23 +20,22 @@
|
|
18
20
|
Variable.prototype = Object.create(Generic.prototype);
|
19
21
|
Variable.prototype.constructor = Variable;
|
20
22
|
|
21
|
-
Variable.prototype.fetch = function(callback,
|
22
|
-
var
|
23
|
-
id = this.id;
|
23
|
+
Variable.prototype.fetch = function(callback, customErrback) {
|
24
|
+
var id = this.id;
|
24
25
|
|
25
|
-
if (typeof(
|
26
|
-
|
26
|
+
if (typeof(customErrback) === 'undefined') {
|
27
|
+
customErrback = errback; // reset to default
|
27
28
|
}
|
28
29
|
|
29
30
|
function members(privilege) {
|
30
31
|
return function(cb) {
|
31
32
|
$.ajax({
|
32
|
-
url: '/api/authz/'
|
33
|
-
|
34
|
-
|
35
|
-
+
|
36
|
-
|
37
|
-
|
33
|
+
url: '/api/authz/' +
|
34
|
+
conjur.app.configuration.account +
|
35
|
+
'/roles/allowed_to/' +
|
36
|
+
privilege +
|
37
|
+
'/variable/' +
|
38
|
+
window.encodeURIComponent(id),
|
38
39
|
success: function(result) {
|
39
40
|
cb(null, result);
|
40
41
|
},
|
@@ -50,7 +51,7 @@
|
|
50
51
|
this.resource.bind(this)
|
51
52
|
], function(err, results) {
|
52
53
|
if (err) {
|
53
|
-
return
|
54
|
+
return customErrback(err.status);
|
54
55
|
}
|
55
56
|
|
56
57
|
callback({
|