conjur-asset-ui 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- 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,40 +1,45 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
+
/* global conjur, React, ReactBootstrap, _ */
|
2
3
|
|
3
|
-
(function(conjur, ReactBootstrap) {
|
4
|
+
(function(conjur, React, ReactBootstrap, _) {
|
4
5
|
'use strict';
|
5
6
|
|
6
|
-
var
|
7
|
-
|
8
|
-
|
7
|
+
var TabPane = ReactBootstrap.TabPane,
|
8
|
+
OwnedResources = conjur.views.OwnedResources,
|
9
|
+
RoleLink = conjur.views.RoleLink,
|
10
|
+
AnnotationsBox = conjur.views.AnnotationsBox,
|
11
|
+
Permissions = conjur.views.Permissions;
|
9
12
|
|
10
13
|
// we can't create custom TabPanes as components,
|
11
14
|
// because they won't be recognized by TabbedArea as tabs
|
12
15
|
// that's why we just generalize their constructors
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
this.Tab = {
|
17
|
+
containsOwnedItems: function() {
|
18
|
+
return (
|
19
|
+
this.props.data.owned &&
|
20
|
+
this.props.data.owned.length &&
|
21
|
+
this.props.data.owned.length > 0
|
22
|
+
);
|
20
23
|
},
|
21
24
|
|
22
|
-
|
23
|
-
if (this.
|
24
|
-
return this.props.data.owned.map(function(
|
25
|
-
return
|
25
|
+
ownedIds: function() {
|
26
|
+
if (this.containsOwnedItems()) {
|
27
|
+
return this.props.data.owned.map(function(ownedItem) {
|
28
|
+
return ownedItem.id;
|
26
29
|
});
|
27
30
|
}
|
28
31
|
|
29
32
|
return [];
|
30
33
|
},
|
31
34
|
|
32
|
-
|
33
|
-
if (this.
|
34
|
-
var result =
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
ownedTab: function() {
|
36
|
+
if (this.containsOwnedItems()) {
|
37
|
+
var result = (
|
38
|
+
<TabPane key="owned"
|
39
|
+
tab={conjur.utils.getTabname('Owned resources', this.props.data.owned)}>
|
40
|
+
<OwnedResources owned={this.props.data.owned} tabview={true} />
|
41
|
+
</TabPane>
|
42
|
+
);
|
38
43
|
|
39
44
|
return result;
|
40
45
|
}
|
@@ -42,73 +47,108 @@
|
|
42
47
|
return null;
|
43
48
|
},
|
44
49
|
|
45
|
-
|
46
|
-
return (
|
50
|
+
containsNontrivialRoles: function() {
|
51
|
+
return (
|
52
|
+
this.props.data.roles &&
|
53
|
+
this.props.data.roles.length &&
|
54
|
+
this.props.data.roles.length > 1
|
55
|
+
);
|
47
56
|
},
|
48
57
|
|
49
|
-
|
50
|
-
if (!this.
|
58
|
+
externalRoles: function(ownId) {
|
59
|
+
if (!this.containsNontrivialRoles()) {
|
51
60
|
return [];
|
52
61
|
}
|
53
62
|
|
54
|
-
var
|
63
|
+
var ownedIds = this.ownedIds();
|
55
64
|
|
56
65
|
return this.props.data.roles.filter(function(roleid) {
|
57
66
|
// do not show themself
|
58
|
-
return roleid
|
67
|
+
return roleid !== ownId;
|
59
68
|
}).filter(function(roleid) {
|
60
69
|
// do not show internal roles
|
61
|
-
return
|
70
|
+
return roleid.split(':')[1] !== '@';
|
62
71
|
}).filter(function(roleid) {
|
63
72
|
// do not show owned groups
|
64
|
-
return ! _.contains(
|
73
|
+
return ! _.contains(ownedIds, roleid);
|
65
74
|
});
|
66
75
|
},
|
67
76
|
|
68
|
-
|
69
|
-
if (!this.
|
77
|
+
membershipsTab: function(ownId) {
|
78
|
+
if (!this.containsNontrivialRoles()) {
|
70
79
|
return null;
|
71
80
|
}
|
72
81
|
|
73
|
-
var
|
74
|
-
.sort(
|
75
|
-
|
76
|
-
|
77
|
-
|
82
|
+
var membershipLinks = this.externalRoles(ownId)
|
83
|
+
.sort(function(a, b) {
|
84
|
+
return a.toLowerCase().localeCompare(b.toLowerCase());
|
85
|
+
})
|
86
|
+
.map(function(roleid) {
|
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
|
+
}
|
78
97
|
|
79
|
-
var result =
|
80
|
-
|
81
|
-
|
82
|
-
|
98
|
+
var result = (
|
99
|
+
<TabPane key="memberships"
|
100
|
+
tab={conjur.utils.getTabname('Explicit memberships', membershipLinks)}>
|
101
|
+
<ul className="list-group">
|
102
|
+
{membershipLinks}
|
103
|
+
</ul>
|
104
|
+
</TabPane>
|
105
|
+
);
|
83
106
|
|
84
107
|
return result;
|
85
|
-
}
|
108
|
+
},
|
86
109
|
|
87
|
-
|
88
|
-
return (
|
110
|
+
containsAnnotations: function() {
|
111
|
+
return (
|
112
|
+
this.props.data.annotations &&
|
113
|
+
this.props.data.annotations.length &&
|
114
|
+
this.props.data.annotations.length > 0
|
115
|
+
);
|
89
116
|
},
|
90
117
|
|
91
|
-
|
92
|
-
if (!this.
|
118
|
+
annotationsTab: function() {
|
119
|
+
if (!this.containsAnnotations()) {
|
93
120
|
return null;
|
94
121
|
}
|
95
122
|
|
96
|
-
var result =
|
97
|
-
|
98
|
-
|
99
|
-
|
123
|
+
var result = (
|
124
|
+
<TabPane key="annotations"
|
125
|
+
tab={conjur.utils.getTabname('Annotations', this.props.data.annotations)}>
|
126
|
+
<AnnotationsBox annotations={this.props.data.annotations} />
|
127
|
+
</TabPane>
|
128
|
+
);
|
100
129
|
|
101
130
|
return result;
|
102
131
|
},
|
103
132
|
|
104
|
-
|
105
|
-
var result =
|
106
|
-
|
107
|
-
|
108
|
-
|
133
|
+
permissionsTab: function(roleid) {
|
134
|
+
var result = (
|
135
|
+
<TabPane key="permissions" tab="Permissions held">
|
136
|
+
<Permissions owned={this.props.data.owned}
|
137
|
+
roles={this.props.data.roles}
|
138
|
+
role={roleid}
|
139
|
+
tabview={true} />
|
140
|
+
</TabPane>
|
141
|
+
);
|
109
142
|
|
110
143
|
return result;
|
111
144
|
}
|
112
145
|
|
113
146
|
};
|
114
|
-
|
147
|
+
|
148
|
+
}).bind(conjur.views.mixins)
|
149
|
+
(
|
150
|
+
conjur,
|
151
|
+
React,
|
152
|
+
ReactBootstrap,
|
153
|
+
_
|
154
|
+
);
|
@@ -1,18 +1,29 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
+
/* global conjur, React */
|
2
3
|
|
3
4
|
(function(conjur, React) {
|
4
5
|
'use strict';
|
5
6
|
|
6
|
-
var
|
7
|
-
|
7
|
+
var Search = conjur.views.mixins.Search;
|
8
|
+
|
9
|
+
this.NavSearchForm = React.createClass({
|
10
|
+
mixins: [Search],
|
8
11
|
|
9
12
|
render: function() {
|
10
13
|
return (
|
11
|
-
<form className="form-inline navbar-form"
|
14
|
+
<form className="form-inline navbar-form"
|
15
|
+
role="search"
|
16
|
+
onSubmit={this.handleSubmit}>
|
12
17
|
<div className="form-group">
|
13
|
-
<input ref="input"
|
18
|
+
<input ref="input"
|
19
|
+
type="text"
|
20
|
+
className="form-control"
|
21
|
+
placeholder="Search Conjur"></input>
|
14
22
|
</div>
|
15
|
-
<button type="submit"
|
23
|
+
<button type="submit"
|
24
|
+
className="btn btn-default search-button">
|
25
|
+
Search
|
26
|
+
</button>
|
16
27
|
</form>
|
17
28
|
);
|
18
29
|
}
|
data/public/js/views/owned.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
+
/* global conjur, React, _ */
|
2
3
|
|
3
|
-
(function(conjur,
|
4
|
+
(function(conjur, React, _) {
|
4
5
|
'use strict';
|
5
6
|
|
6
7
|
var knownTypes = ['user', 'group', 'layer', 'host', 'variable', 'policy'];
|
@@ -34,11 +35,16 @@
|
|
34
35
|
return a.id.toLowerCase().localeCompare(b.id.toLowerCase());
|
35
36
|
}).map(function(resource) {
|
36
37
|
var kind = resource.id.split(':')[1];
|
38
|
+
|
37
39
|
filters.push(kind);
|
38
40
|
|
39
|
-
if ((this.state.filter === '')
|
40
|
-
|
41
|
-
|
41
|
+
if ((this.state.filter === '') ||
|
42
|
+
(this.state.filter !== 'other' && this.state.filter === kind) ||
|
43
|
+
(this.state.filter === 'other' &&
|
44
|
+
_.intersection([kind], knownTypes).length === 0)) {
|
45
|
+
|
46
|
+
var ResourceLink = conjur.views.ResourceLink;
|
47
|
+
|
42
48
|
return (
|
43
49
|
<li className="list-group-item list-group-item-noborder">
|
44
50
|
<ResourceLink data={resource} />
|
@@ -61,7 +67,7 @@
|
|
61
67
|
|
62
68
|
var filterSelect = '';
|
63
69
|
|
64
|
-
if (this.props.resources.length > 9 || this.state.filter
|
70
|
+
if (this.props.resources.length > 9 || this.state.filter !== '') {
|
65
71
|
// TODO: sort, when done with previous TODO
|
66
72
|
filterSelect = _.intersection(_.uniq(filters, true), knownTypes).map(function(f) {
|
67
73
|
return (
|
@@ -127,7 +133,7 @@
|
|
127
133
|
}
|
128
134
|
});
|
129
135
|
|
130
|
-
|
136
|
+
this.OwnedResources = React.createClass({
|
131
137
|
getInitialState: function() {
|
132
138
|
return {
|
133
139
|
expanded: false
|
@@ -173,6 +179,6 @@
|
|
173
179
|
}).bind(conjur.views)
|
174
180
|
(
|
175
181
|
conjur,
|
176
|
-
|
177
|
-
|
182
|
+
React,
|
183
|
+
_
|
178
184
|
);
|