conjur-asset-ui 1.3.1 → 1.3.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/.gitignore +1 -3
- data/Gemfile +1 -3
- data/README.md +0 -34
- data/Rakefile +1 -69
- data/conjur-asset-ui.gemspec +1 -1
- data/lib/conjur-asset-ui-version.rb +1 -1
- data/lib/conjur/command/ui.rb +1 -1
- data/lib/conjur/webserver/server.rb +8 -14
- data/public/_client_code.html +42 -0
- data/public/_client_libs.html +15 -2
- data/public/css/bootstrap.css +7 -0
- data/public/css/styles.less +4 -170
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +229 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/index.html.erb +7 -5
- data/public/js/init.js +97 -183
- data/public/js/lib/JSXTransformer.js +10862 -0
- data/public/js/lib/async.js +958 -0
- data/public/js/lib/backbone.js +2 -0
- data/public/js/lib/bootstrap.js +6 -0
- data/public/js/lib/less.js +16 -0
- data/public/js/lib/moment.js +7768 -0
- data/public/js/lib/react-bootstrap.js +5346 -0
- data/public/js/lib/react-bootstrap.min.js +4 -0
- data/public/js/lib/sorted-set.no-require.js +28 -3
- data/public/js/lib/underscore-min.js +6 -0
- data/public/js/lib/underscore.string.min.js +1 -0
- data/public/js/main.js +57 -0
- data/public/js/models/groupRecord.js +11 -12
- data/public/js/models/hostRecord.js +7 -6
- data/public/js/models/layerRecord.js +11 -12
- data/public/js/models/namespace.js +0 -2
- data/public/js/models/policyList.js +1 -3
- data/public/js/models/policyRecord.js +7 -6
- data/public/js/models/record.js +23 -24
- data/public/js/models/resourceList.js +10 -28
- data/public/js/models/userList.js +2 -7
- data/public/js/models/userRecord.js +8 -7
- data/public/js/models/variableList.js +7 -18
- data/public/js/models/variableRecord.js +12 -13
- data/public/js/routers.js +26 -72
- data/public/js/views/annotations.js +27 -38
- data/public/js/views/audit.js +17 -23
- data/public/js/views/dashboard.js +58 -94
- data/public/js/views/generic.js +9 -16
- data/public/js/views/group.js +55 -94
- data/public/js/views/groups.js +7 -3
- data/public/js/views/host.js +44 -75
- data/public/js/views/hosts.js +6 -2
- data/public/js/views/layer.js +82 -127
- data/public/js/views/layers.js +6 -2
- data/public/js/views/mixins/search.js +5 -12
- data/public/js/views/mixins/tabs.js +55 -95
- data/public/js/views/navSearch.js +5 -16
- data/public/js/views/owned.js +8 -14
- data/public/js/views/permissions.js +178 -244
- data/public/js/views/policies.js +4 -2
- data/public/js/views/policy.js +38 -65
- data/public/js/views/resource.js +34 -49
- data/public/js/views/role.js +37 -52
- data/public/js/views/searchResults.js +138 -205
- data/public/js/views/time.js +13 -26
- data/public/js/views/user.js +55 -178
- data/public/js/views/users.js +7 -2
- data/public/js/views/variable.js +45 -226
- data/public/js/views/variables.js +8 -4
- metadata +19 -18
- data/.jshintrc +0 -41
- data/bower.json +0 -93
- data/features/navigation_bar.feature +0 -31
- data/features/step_definitions/custom_step.rb +0 -32
- data/features/support/env.rb +0 -38
- data/features/support/hooks.rb +0 -30
- data/features/support/world.rb +0 -17
- data/gulpfile.js +0 -140
- data/package.json +0 -47
- data/preprocessor.js +0 -7
- data/public/js/views/chart.js +0 -471
data/public/js/views/hosts.js
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
-
/* global conjur, React */
|
3
2
|
|
4
3
|
(function(conjur, React) {
|
5
4
|
'use strict';
|
6
5
|
|
7
6
|
var GenericList = conjur.views.GenericList;
|
8
7
|
|
9
|
-
this.HostBox = React.createClass({
|
8
|
+
var HostBox = this.HostBox = React.createClass({
|
9
|
+
/*getInitialState: function() {
|
10
|
+
return { currentNamespace: "", members: [] };
|
11
|
+
},*/
|
10
12
|
render: function() {
|
13
|
+
//<NamespaceFilter currentNamespace={this.props.currentNamespace}
|
14
|
+
//namespaces={this.props.data.namespaces} />
|
11
15
|
return (
|
12
16
|
<div className="hostBox">
|
13
17
|
<div className="hostList">
|
data/public/js/views/layer.js
CHANGED
@@ -1,137 +1,92 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
-
/* global conjur, React, ReactBootstrap, _ */
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
};
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
}
|
54
|
-
|
55
|
-
// TODO: controls to add/remove admins/users/hosts
|
56
|
-
var overviewTab = (
|
57
|
-
<TabPane key="overview" tab="Overview">
|
58
|
-
<dl className="dl-horizontal">
|
59
|
-
<dt>Owner</dt>
|
60
|
-
<dd><RoleLink id={data.layer.ownerid} /></dd>
|
61
|
-
|
62
|
-
<dt>Created by</dt>
|
63
|
-
<dd><RoleLink id={data.layer.userid} /></dd>
|
64
|
-
</dl>
|
65
|
-
</TabPane>
|
66
|
-
);
|
67
|
-
|
68
|
-
var adminsTab = (
|
69
|
-
<TabPane key="admins" tab={conjur.utils.getTabname('Admins', admins)}>
|
70
|
-
<ul className="list-group">
|
71
|
-
{admins}
|
72
|
-
</ul>
|
73
|
-
</TabPane>
|
74
|
-
);
|
75
|
-
|
76
|
-
var usersTab = (
|
77
|
-
<TabPane key="users" tab={conjur.utils.getTabname('Users', users)}>
|
3
|
+
var Layer = React.createClass({
|
4
|
+
mixins: [conjur.views.mixins.Tab],
|
5
|
+
render: function() {
|
6
|
+
function abstractRole(expected) {
|
7
|
+
return function(role) {
|
8
|
+
var tokens = role.split(':');
|
9
|
+
var kind = tokens[1];
|
10
|
+
var abstractKinds = [ '@', 'layer' ];
|
11
|
+
var isAbstract = abstractKinds.indexOf(kind) !== -1;
|
12
|
+
return isAbstract === expected;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
var layer = this.props.data.layer;
|
17
|
+
|
18
|
+
var hosts = layer.hosts.map(function (host) {
|
19
|
+
return <li className="list-group-item list-group-item-noborder">
|
20
|
+
<HostLink data={host} />
|
21
|
+
</li>
|
22
|
+
}.bind(this));
|
23
|
+
var admins = this.props.data.admins.filter(abstractRole(false)).map(function (role) {
|
24
|
+
return <li className="list-group-item list-group-item-noborder">
|
25
|
+
<RoleLink id={role}/>
|
26
|
+
</li>;
|
27
|
+
}.bind(this));
|
28
|
+
var users = this.props.data.users.filter(abstractRole(false)).map(function (role) {
|
29
|
+
return <li className="list-group-item list-group-item-noborder">
|
30
|
+
<RoleLink id={role}/>
|
31
|
+
</li>;
|
32
|
+
}.bind(this));
|
33
|
+
|
34
|
+
|
35
|
+
// TODO: controls to add/remove admins/users/hosts
|
36
|
+
var overview_tab =
|
37
|
+
<TabPane key="overview" tab="Overview">
|
38
|
+
<dl className="dl-horizontal">
|
39
|
+
<dt>Owner</dt>
|
40
|
+
<dd><RoleLink id={layer.ownerid}/></dd>
|
41
|
+
<dt>Created by</dt>
|
42
|
+
<dd><RoleLink id={layer.userid}/></dd>
|
43
|
+
</dl>
|
44
|
+
</TabPane>;
|
45
|
+
var admins_tab =
|
46
|
+
<TabPane key="admins" tab={get_tabname("Admins",admins)}>
|
47
|
+
<ul className="list-group">
|
48
|
+
{admins}
|
49
|
+
</ul>
|
50
|
+
</TabPane> ;
|
51
|
+
var users_tab =
|
52
|
+
<TabPane key="users" tab={ get_tabname("Users", users) } >
|
78
53
|
<ul className="list-group">
|
79
54
|
{users}
|
80
55
|
</ul>
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
var hostsTab = (
|
85
|
-
<TabPane key="hosts" tab={conjur.utils.getTabname('Hosts', hosts)}>
|
56
|
+
</TabPane>;
|
57
|
+
var hosts_tab =
|
58
|
+
<TabPane key="hosts" tab={ get_tabname("Hosts", hosts) } >
|
86
59
|
<ul className="list-group">
|
87
60
|
{hosts}
|
88
61
|
</ul>
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
var auditTab = (
|
93
|
-
<TabPane key="audit" tab="Recent Activity">
|
62
|
+
</TabPane>;
|
63
|
+
var audit_tab=
|
64
|
+
<TabPane key="audit" tab="Recent Activity">
|
94
65
|
<div className="audit auditGroup">
|
95
|
-
<AuditBox roles={[
|
96
|
-
resources={[data.layer.resource_identifier]}
|
97
|
-
tabview={true} />
|
66
|
+
<AuditBox roles={[layer.roleid]} resources={[layer.resource_identifier]} tabview={true} />
|
98
67
|
</div>
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
{tabs}
|
125
|
-
</TabbedArea>
|
126
|
-
</div>
|
127
|
-
);
|
128
|
-
}
|
129
|
-
});
|
130
|
-
|
131
|
-
}).bind(conjur.views)
|
132
|
-
(
|
133
|
-
conjur,
|
134
|
-
React,
|
135
|
-
ReactBootstrap,
|
136
|
-
_
|
137
|
-
);
|
68
|
+
</TabPane>;
|
69
|
+
|
70
|
+
|
71
|
+
var permissions_tab = this.permissions_tab(layer.roleid);
|
72
|
+
var memberships_tab = this.memberships_tab(layer.roleid);
|
73
|
+
var annotations_tab = this.annotations_tab();
|
74
|
+
var owned_tab = this.owned_tab();
|
75
|
+
|
76
|
+
var tabs = _.compact( [overview_tab, admins_tab, users_tab, hosts_tab,
|
77
|
+
owned_tab, memberships_tab, permissions_tab,
|
78
|
+
annotations_tab,
|
79
|
+
audit_tab
|
80
|
+
] );
|
81
|
+
|
82
|
+
return (
|
83
|
+
<div className="layer">
|
84
|
+
<h2>Layer {layer.id}</h2>
|
85
|
+
|
86
|
+
<TabbedArea defaultActiveKey="overview">
|
87
|
+
{tabs}
|
88
|
+
</TabbedArea>
|
89
|
+
</div>
|
90
|
+
);
|
91
|
+
}
|
92
|
+
});
|
data/public/js/views/layers.js
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
-
/* global conjur, React */
|
3
2
|
|
4
3
|
(function(conjur, React) {
|
5
4
|
'use strict';
|
6
5
|
|
7
6
|
var GenericList = conjur.views.GenericList;
|
8
7
|
|
9
|
-
this.LayerBox = React.createClass({
|
8
|
+
var LayerBox = this.LayerBox = React.createClass({
|
9
|
+
/* getInitialState: function() {
|
10
|
+
return { currentNamespace: "", members: [] };
|
11
|
+
}, */
|
10
12
|
render: function() {
|
13
|
+
// <NamespaceFilter currentNamespace={this.props.currentNamespace}
|
14
|
+
// namespaces={this.props.data.namespaces} />
|
11
15
|
return (
|
12
16
|
<div className="layerBox">
|
13
17
|
<div className="layerList">
|
@@ -1,22 +1,15 @@
|
|
1
|
-
/* global conjur */
|
2
|
-
|
3
1
|
(function(conjur) {
|
4
2
|
'use strict';
|
5
3
|
|
6
|
-
|
7
|
-
handleSubmit: function() {
|
4
|
+
conjur.views.mixins.Search = {
|
5
|
+
handleSubmit: function(e) {
|
8
6
|
var search = this.refs.input.getDOMNode().value;
|
9
7
|
|
10
|
-
if (search && search.length
|
11
|
-
conjur.app.router.navigate('/ui/search/' +
|
12
|
-
{trigger: true});
|
8
|
+
if (search && search.length != 0) {
|
9
|
+
conjur.app.router.navigate('/ui/search/' + encodeURIComponent(search), {trigger: true});
|
13
10
|
}
|
14
11
|
|
15
12
|
return false;
|
16
13
|
}
|
17
14
|
};
|
18
|
-
|
19
|
-
}).bind(conjur.views.mixins)
|
20
|
-
(
|
21
|
-
conjur
|
22
|
-
);
|
15
|
+
})(conjur);
|
@@ -1,45 +1,40 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
-
/* global conjur, React, ReactBootstrap, _ */
|
3
2
|
|
4
|
-
(function(conjur,
|
3
|
+
(function(conjur, ReactBootstrap) {
|
5
4
|
'use strict';
|
6
5
|
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
AnnotationsBox = conjur.views.AnnotationsBox,
|
11
|
-
Permissions = conjur.views.Permissions;
|
6
|
+
var TabbedArea = ReactBootstrap.TabbedArea,
|
7
|
+
TabPane = ReactBootstrap.TabPane,
|
8
|
+
OwnedResources = conjur.views.OwnedResources;
|
12
9
|
|
13
10
|
// we can't create custom TabPanes as components,
|
14
11
|
// because they won't be recognized by TabbedArea as tabs
|
15
12
|
// that's why we just generalize their constructors
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
);
|
13
|
+
conjur.views.mixins.Tab = {
|
14
|
+
lexical_sorter: function(a,b) {
|
15
|
+
|
16
|
+
},
|
17
|
+
|
18
|
+
contains_owned_items: function() {
|
19
|
+
return (this.props.data.owned && this.props.data.owned.length && this.props.data.owned.length > 0 );
|
23
20
|
},
|
24
21
|
|
25
|
-
|
26
|
-
if (this.
|
27
|
-
return this.props.data.owned.map(function(
|
28
|
-
return
|
22
|
+
owned_ids: function() {
|
23
|
+
if (this.contains_owned_items()) {
|
24
|
+
return this.props.data.owned.map(function(owned_item) {
|
25
|
+
return owned_item.id;
|
29
26
|
});
|
30
27
|
}
|
31
28
|
|
32
29
|
return [];
|
33
30
|
},
|
34
31
|
|
35
|
-
|
36
|
-
if (this.
|
37
|
-
var result =
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
</TabPane>
|
42
|
-
);
|
32
|
+
owned_tab: function() {
|
33
|
+
if (this.contains_owned_items()) {
|
34
|
+
var result =
|
35
|
+
<TabPane key="owned" tab={get_tabname("Owned resources",this.props.data.owned)}>
|
36
|
+
<OwnedResources owned={this.props.data.owned} tabview={true} />
|
37
|
+
</TabPane>;
|
43
38
|
|
44
39
|
return result;
|
45
40
|
}
|
@@ -47,108 +42,73 @@
|
|
47
42
|
return null;
|
48
43
|
},
|
49
44
|
|
50
|
-
|
51
|
-
return (
|
52
|
-
this.props.data.roles &&
|
53
|
-
this.props.data.roles.length &&
|
54
|
-
this.props.data.roles.length > 1
|
55
|
-
);
|
45
|
+
contains_nontrivial_roles: function() {
|
46
|
+
return (this.props.data.roles && this.props.data.roles.length && this.props.data.roles.length>1);
|
56
47
|
},
|
57
48
|
|
58
|
-
|
59
|
-
if (!this.
|
49
|
+
external_roles: function( own_id ) {
|
50
|
+
if (!this.contains_nontrivial_roles()) {
|
60
51
|
return [];
|
61
52
|
}
|
62
53
|
|
63
|
-
var
|
54
|
+
var owned_ids = this.owned_ids();
|
64
55
|
|
65
56
|
return this.props.data.roles.filter(function(roleid) {
|
66
57
|
// do not show themself
|
67
|
-
return roleid
|
58
|
+
return roleid!=own_id;
|
68
59
|
}).filter(function(roleid) {
|
69
60
|
// do not show internal roles
|
70
|
-
return roleid.split(':')[1]
|
61
|
+
return ! (roleid.split(':')[1]=='@') ;
|
71
62
|
}).filter(function(roleid) {
|
72
63
|
// do not show owned groups
|
73
|
-
return ! _.contains(
|
64
|
+
return ! _.contains(owned_ids, roleid);
|
74
65
|
});
|
75
66
|
},
|
76
67
|
|
77
|
-
|
78
|
-
if (!this.
|
68
|
+
memberships_tab: function( own_id ) {
|
69
|
+
if (!this.contains_nontrivial_roles()) {
|
79
70
|
return null;
|
80
71
|
}
|
81
72
|
|
82
|
-
var
|
83
|
-
.sort(function(a, b)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
return (
|
88
|
-
<li className="list-group-item list-group-item-noborder">
|
89
|
-
<RoleLink id={roleid} />
|
90
|
-
</li>
|
91
|
-
);
|
92
|
-
});
|
93
|
-
|
94
|
-
if (membershipLinks.length === 0) {
|
95
|
-
return null;
|
96
|
-
}
|
73
|
+
var membership_links = this.external_roles(own_id)
|
74
|
+
.sort( function(a,b) { return a.toLowerCase().localeCompare(b.toLowerCase());} )
|
75
|
+
.map ( function(roleid) { return <li className="list-group-item list-group-item-noborder"><RoleLink id={roleid}/></li> });
|
76
|
+
|
77
|
+
if (membership_links.length==0) { return null; }
|
97
78
|
|
98
|
-
var result =
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
{membershipLinks}
|
103
|
-
</ul>
|
104
|
-
</TabPane>
|
105
|
-
);
|
79
|
+
var result =
|
80
|
+
<TabPane key="memberships" tab={get_tabname("Explicit memberships", membership_links)}>
|
81
|
+
<ul className="list-group">{membership_links}</ul>
|
82
|
+
</TabPane>;
|
106
83
|
|
107
84
|
return result;
|
108
|
-
},
|
85
|
+
} ,
|
109
86
|
|
110
|
-
|
111
|
-
return (
|
112
|
-
this.props.data.annotations &&
|
113
|
-
this.props.data.annotations.length &&
|
114
|
-
this.props.data.annotations.length > 0
|
115
|
-
);
|
87
|
+
contains_annotations: function() {
|
88
|
+
return (this.props.data.annotations && this.props.data.annotations.length && this.props.data.annotations.length>0);
|
116
89
|
},
|
117
90
|
|
118
|
-
|
119
|
-
if (!this.
|
91
|
+
annotations_tab: function() {
|
92
|
+
if (!this.contains_annotations()) {
|
120
93
|
return null;
|
121
94
|
}
|
122
95
|
|
123
|
-
var result =
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
</TabPane>
|
128
|
-
);
|
96
|
+
var result =
|
97
|
+
<TabPane key="annotations" tab={get_tabname("Annotations",this.props.data.annotations)}>
|
98
|
+
<AnnotationsBox annotations={this.props.data.annotations}/>
|
99
|
+
</TabPane>;
|
129
100
|
|
130
101
|
return result;
|
131
102
|
},
|
132
103
|
|
133
|
-
|
134
|
-
var result =
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
role={roleid}
|
139
|
-
tabview={true} />
|
140
|
-
</TabPane>
|
141
|
-
);
|
104
|
+
permissions_tab: function(roleid) {
|
105
|
+
var result =
|
106
|
+
<TabPane key="permissions" tab="Permissions held">
|
107
|
+
<Permissions owned={this.props.data.owned} roles={this.props.data.roles} role={roleid} tabview={true}/>
|
108
|
+
</TabPane>;
|
142
109
|
|
143
110
|
return result;
|
144
111
|
}
|
145
112
|
|
146
113
|
};
|
147
|
-
|
148
|
-
}).bind(conjur.views.mixins)
|
149
|
-
(
|
150
|
-
conjur,
|
151
|
-
React,
|
152
|
-
ReactBootstrap,
|
153
|
-
_
|
154
|
-
);
|
114
|
+
})(conjur, ReactBootstrap);
|