conjur-asset-ui 1.4.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +8 -3
- data/CHANGELOG.md +10 -0
- data/Makefile +19 -0
- data/README.md +0 -3
- data/Rakefile +22 -17
- data/TODO.md +0 -23
- data/app/.csscomb.json +304 -0
- data/app/.eslintignore +3 -0
- data/app/.eslintrc +265 -0
- data/app/config/preprocessor.js +19 -0
- data/app/config/webpack.js +124 -0
- data/app/gulpfile.js +96 -0
- data/app/package.json +86 -0
- data/app/src/actions.js +550 -0
- data/app/src/app.js +83 -0
- data/app/src/clients/audit.js +34 -0
- data/app/src/clients/auth.js +24 -0
- data/app/src/clients/generic.js +52 -0
- data/app/src/clients/graph.js +7 -0
- data/app/src/clients/layer_members.js +18 -0
- data/app/src/clients/list.js +31 -0
- data/app/src/clients/members.js +20 -0
- data/app/src/clients/request.js +531 -0
- data/app/src/clients/search.js +5 -0
- data/app/src/components/app/__tests__/app-test.js +22 -0
- data/app/src/components/app/app.js +36 -0
- data/app/src/components/app/wrapper.js +17 -0
- data/app/src/components/audit/__tests__/table_header-test.js +22 -0
- data/app/src/components/audit/box.js +9 -0
- data/app/src/components/audit/constants.js +5 -0
- data/app/src/components/audit/entry.js +105 -0
- data/app/src/components/audit/fields_mixin.js +11 -0
- data/app/src/components/audit/humanize_event.js +213 -0
- data/app/src/components/audit/table.js +64 -0
- data/app/src/components/audit/table_header.js +37 -0
- data/app/src/components/audit/timestamp.js +28 -0
- data/app/src/components/auth/login.js +177 -0
- data/app/src/components/auth/login.less +71 -0
- data/app/src/components/auth/logout.js +42 -0
- data/app/src/components/auth/logout.less +21 -0
- data/app/src/components/chart/chart.js +540 -0
- data/app/src/components/chart/chart_helper_mixin.js +78 -0
- data/app/src/components/custom/list.js +3 -0
- data/app/src/components/custom/view.js +81 -0
- data/app/src/components/dashboard/activity.js +144 -0
- data/app/src/components/dashboard/dashboard.js +46 -0
- data/app/src/components/flash/flash.js +98 -0
- data/app/src/components/flash/flash.less +3 -0
- data/app/src/components/generic/__tests__/time-test.js +42 -0
- data/app/src/components/generic/annotations.js +39 -0
- data/app/src/components/generic/breadcrumbs.js +57 -0
- data/app/src/components/generic/foldable_audit_section.js +204 -0
- data/app/src/components/generic/list.js +141 -0
- data/app/src/components/generic/list_factory.js +41 -0
- data/app/src/components/generic/resource_link.js +64 -0
- data/app/src/components/generic/role_link.js +66 -0
- data/app/src/components/generic/tab_mixin.js +146 -0
- data/app/src/components/generic/time.js +32 -0
- data/app/src/components/graph/__tests__/collapse-test.js +133 -0
- data/app/src/components/graph/__tests__/edges-from-vertices-test.js +48 -0
- data/app/src/components/graph/__tests__/new-vertex-set-test.js +16 -0
- data/app/src/components/graph/__tests__/next-id-test.js +27 -0
- data/app/src/components/graph/__tests__/role-kind-from-id-test.js +24 -0
- data/app/src/components/graph/__tests__/vertices-from-edges-test.js +72 -0
- data/app/src/components/graph/graph.js +449 -0
- data/app/src/components/graph/graph.less +39 -0
- data/app/src/components/graph/helpers.js +368 -0
- data/app/src/components/group/list.js +3 -0
- data/app/src/components/group/view.js +153 -0
- data/app/src/components/host/activity.js +111 -0
- data/app/src/components/host/details.js +28 -0
- data/app/src/components/host/executors.js +77 -0
- data/app/src/components/host/host_link.js +18 -0
- data/app/src/components/host/list.js +3 -0
- data/app/src/components/host/updaters.js +77 -0
- data/app/src/components/host/view.js +145 -0
- data/app/src/components/layer/list.js +3 -0
- data/app/src/components/layer/view.js +197 -0
- data/app/src/components/navbar/__tests__/navbar-test.js +21 -0
- data/app/src/components/navbar/nav_search_form.js +40 -0
- data/app/src/components/navbar/navbar.js +96 -0
- data/app/src/components/notfound/notfound.js +35 -0
- data/app/src/components/notfound/notfound.less +21 -0
- data/app/src/components/owned_resources/owned_resources.js +84 -0
- data/app/src/components/owned_resources/owned_resources_box.js +101 -0
- data/app/src/components/permissions/permissions.js +138 -0
- data/app/src/components/permissions/permissions_table.js +101 -0
- data/app/src/components/policy/list.js +3 -0
- data/app/src/components/policy/view.js +107 -0
- data/app/src/components/refresh/refresh.js +29 -0
- data/app/src/components/refresh/refresh.less +15 -0
- data/app/src/components/search/group.js +43 -0
- data/app/src/components/search/group_heading.js +50 -0
- data/app/src/components/search/group_title.js +37 -0
- data/app/src/components/search/result_item.js +55 -0
- data/app/src/components/search/search.js +118 -0
- data/app/src/components/user/activity.js +112 -0
- data/app/src/components/user/details.js +30 -0
- data/app/src/components/user/list.js +3 -0
- data/app/src/components/user/pubkeys.js +118 -0
- data/app/src/components/user/pubkeys.less +56 -0
- data/app/src/components/user/view.js +143 -0
- data/app/src/components/variable/activity.js +101 -0
- data/app/src/components/variable/details.js +46 -0
- data/app/src/components/variable/fetchers.js +77 -0
- data/app/src/components/variable/list.js +3 -0
- data/app/src/components/variable/updaters.js +77 -0
- data/app/src/components/variable/view.js +115 -0
- data/app/src/constants.js +36 -0
- data/{public → app/src}/images/conjur-logo.svg +0 -0
- data/{public → app/src}/images/icon-client-pc.svg +0 -0
- data/{public → app/src}/images/icon-environment.png +0 -0
- data/{public → app/src}/images/icon-person.svg +0 -0
- data/{public → app/src}/images/icon-policy.png +0 -0
- data/{public → app/src}/images/icon-resource.png +0 -0
- data/{public → app/src}/images/icon-service-dots.svg +0 -0
- data/{public → app/src}/images/icon-variable.png +0 -0
- data/app/src/pages/index.html +27 -0
- data/app/src/routes.js +64 -0
- data/app/src/stores/app_store.js +35 -0
- data/app/src/stores/audit_store.js +143 -0
- data/app/src/stores/graph_store.js +51 -0
- data/app/src/stores/group_store.js +104 -0
- data/app/src/stores/host_store.js +111 -0
- data/app/src/stores/layer_store.js +115 -0
- data/app/src/stores/policy_store.js +88 -0
- data/app/src/stores/resources_store.js +115 -0
- data/app/src/stores/route_store.js +21 -0
- data/app/src/stores/search_store.js +77 -0
- data/app/src/stores/user_store.js +109 -0
- data/app/src/stores/variable_store.js +93 -0
- data/app/src/styles/bootstrap.less +54 -0
- data/{public/css → app/src/styles}/styles.less +26 -82
- data/app/src/utils.js +38 -0
- data/app/src/vendor/pace.js +2 -0
- data/conjur-asset-ui.gemspec +3 -4
- data/docker/assets-build/Dockerfile +12 -0
- data/docker/conjur-ui/Dockerfile +33 -0
- data/docker/conjur-ui/README.md +38 -0
- data/docker/conjur-ui/mime.types +90 -0
- data/docker/conjur-ui/nginx.conf +110 -0
- data/docker/conjur-ui/start.py +72 -0
- data/docker/conjur-ui/start.sh +18 -0
- data/docker/conjur-ui/test.env +8 -0
- data/lib/conjur-asset-ui-version.rb +1 -1
- data/lib/conjur/command/ui.rb +10 -2
- data/lib/conjur/webserver/home.rb +3 -3
- data/lib/conjur/webserver/login.rb +1 -1
- data/lib/conjur/webserver/server.rb +16 -4
- data/public/js/views/roleGraph.js +91 -0
- metadata +167 -105
- data/.jshintrc +0 -41
- data/bower.json +0 -98
- data/gulpfile.js +0 -139
- data/package.json +0 -47
- data/preprocessor.js +0 -7
- data/public/_client_libs.html +0 -9
- data/public/index.html.erb +0 -63
- data/public/js/init.js +0 -196
- data/public/js/lib/pace.js +0 -2
- data/public/js/lib/sorted-set.no-require.js +0 -1145
- data/public/js/lib/sorted-set.no-require.js.txt +0 -6
- data/public/js/models/groupRecord.js +0 -72
- data/public/js/models/hostRecord.js +0 -60
- data/public/js/models/layerRecord.js +0 -79
- data/public/js/models/namespace.js +0 -12
- data/public/js/models/policyList.js +0 -16
- data/public/js/models/policyRecord.js +0 -54
- data/public/js/models/record.js +0 -117
- data/public/js/models/resourceList.js +0 -87
- data/public/js/models/userList.js +0 -25
- data/public/js/models/userRecord.js +0 -75
- data/public/js/models/variableList.js +0 -27
- data/public/js/models/variableRecord.js +0 -77
- data/public/js/routers.js +0 -242
- data/public/js/views/annotations.js +0 -47
- data/public/js/views/audit.js +0 -369
- data/public/js/views/breadcrumbs.js +0 -62
- data/public/js/views/chart.js +0 -617
- data/public/js/views/dashboard.js +0 -146
- data/public/js/views/generic.js +0 -122
- data/public/js/views/group.js +0 -109
- data/public/js/views/groups.js +0 -26
- data/public/js/views/host.js +0 -200
- data/public/js/views/hosts.js +0 -26
- data/public/js/views/layer.js +0 -146
- data/public/js/views/layers.js +0 -26
- data/public/js/views/mixins/search.js +0 -22
- data/public/js/views/mixins/tabs.js +0 -154
- data/public/js/views/namespaces.js +0 -40
- data/public/js/views/navSearch.js +0 -36
- data/public/js/views/owned.js +0 -184
- data/public/js/views/permissions.js +0 -254
- data/public/js/views/policies.js +0 -26
- data/public/js/views/policy.js +0 -70
- data/public/js/views/resource.js +0 -59
- data/public/js/views/role.js +0 -63
- data/public/js/views/searchResults.js +0 -212
- data/public/js/views/sections.js +0 -226
- data/public/js/views/time.js +0 -39
- data/public/js/views/user.js +0 -297
- data/public/js/views/users.js +0 -26
- data/public/js/views/variable.js +0 -310
- data/public/js/views/variables.js +0 -26
- data/spec/javascripts/helpers/.gitkeep +0 -0
- data/spec/javascripts/support/jasmine.yml +0 -112
- data/spec/javascripts/support/jasmine_helper.rb +0 -22
- data/spec/javascripts/support/run.html.erb +0 -23
- data/spec/javascripts/views/AuditSpec.js +0 -22
- data/spec/javascripts/views/AuditSpec.ls +0 -18
data/public/js/views/time.js
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
/** @jsx React.DOM */
|
2
|
-
/* global conjur, React, moment */
|
3
|
-
|
4
|
-
(function(conjur, React, moment) {
|
5
|
-
'use strict';
|
6
|
-
|
7
|
-
// render a <time> tag. props.timestamp should be a timestamp
|
8
|
-
// that moment can parse, props.format should be one of the
|
9
|
-
// format strings accepted by moment (optional).
|
10
|
-
this.Time = React.createClass({
|
11
|
-
render: function() {
|
12
|
-
var timestamp = this.props.timestamp,
|
13
|
-
format = this.props.format || 'lll',
|
14
|
-
m = moment(timestamp),
|
15
|
-
date;
|
16
|
-
|
17
|
-
switch (this.props.relative) {
|
18
|
-
case 'time from now':
|
19
|
-
date = m.fromNow();
|
20
|
-
break;
|
21
|
-
case 'calendar time':
|
22
|
-
date = m.calendar();
|
23
|
-
break;
|
24
|
-
default:
|
25
|
-
date = m.format(format);
|
26
|
-
}
|
27
|
-
|
28
|
-
return (
|
29
|
-
<time dateTime={m.format()}>{date}</time>
|
30
|
-
);
|
31
|
-
}
|
32
|
-
});
|
33
|
-
|
34
|
-
}).bind(conjur.views)
|
35
|
-
(
|
36
|
-
conjur,
|
37
|
-
React,
|
38
|
-
moment
|
39
|
-
);
|
data/public/js/views/user.js
DELETED
@@ -1,297 +0,0 @@
|
|
1
|
-
/** @jsx React.DOM */
|
2
|
-
/* global conjur, _, React, ReactBootstrap */
|
3
|
-
|
4
|
-
(function(conjur, _, React, ReactBootstrap) {
|
5
|
-
'use strict';
|
6
|
-
|
7
|
-
var TabbedArea = ReactBootstrap.TabbedArea,
|
8
|
-
TabPane = ReactBootstrap.TabPane,
|
9
|
-
Tab = conjur.views.mixins.Tab,
|
10
|
-
AuditBox = window.AuditBox,
|
11
|
-
AnnotationsBox = conjur.views.AnnotationsBox,
|
12
|
-
Breadcrumbs = conjur.views.Breadcrumbs,
|
13
|
-
RoleLink = conjur.views.RoleLink,
|
14
|
-
Chart = conjur.views.Chart,
|
15
|
-
ChartHelperMixin = conjur.views.ChartHelperMixin,
|
16
|
-
FoldableAuditSection = conjur.views.FoldableAuditSection;
|
17
|
-
|
18
|
-
var PubkeyItem = React.createClass({
|
19
|
-
render: function() {
|
20
|
-
return (
|
21
|
-
<div className="b-pubkey">
|
22
|
-
<div className="b-pubkey__logo">
|
23
|
-
<span className="badge">{this.props.pubkey[0]}</span>
|
24
|
-
</div>
|
25
|
-
<ul className="b-pubkey__list list-unstyled">
|
26
|
-
<li className="b-pubkey__name">
|
27
|
-
{this.props.pubkey[2]}
|
28
|
-
</li>
|
29
|
-
<li className="b-pubkey__fingerprint">
|
30
|
-
{/* TODO: key fingerprint */}
|
31
|
-
</li>
|
32
|
-
<li className="b-pubkey__info">
|
33
|
-
{/* TODO: When added, when last time used */}
|
34
|
-
</li>
|
35
|
-
</ul>
|
36
|
-
<div className="b-pubkeys__actions">
|
37
|
-
{/* TODO: Action buttons */}
|
38
|
-
</div>
|
39
|
-
</div>
|
40
|
-
);
|
41
|
-
}
|
42
|
-
});
|
43
|
-
|
44
|
-
var PubkeysList = React.createClass({
|
45
|
-
render: function() {
|
46
|
-
var login = this.props.login;
|
47
|
-
|
48
|
-
var pubkeysList = this.props.pubkeys.map(function(k, idx, coll) {
|
49
|
-
var tokens = k.split(' ');
|
50
|
-
|
51
|
-
var className = 'b-pubkeys__item list-group-item list-group-item-noborder';
|
52
|
-
|
53
|
-
if (idx + 1 !== coll.length) {
|
54
|
-
className = className + ' b-pubkeys__item--headline';
|
55
|
-
}
|
56
|
-
|
57
|
-
return (
|
58
|
-
<li className={className}>
|
59
|
-
<PubkeyItem pubkey={tokens} />
|
60
|
-
</li>
|
61
|
-
);
|
62
|
-
});
|
63
|
-
|
64
|
-
return (
|
65
|
-
<div className="b-pubkeys">
|
66
|
-
<PubkeysHelp>
|
67
|
-
This is list of SSH public keys associated with user {login}.
|
68
|
-
</PubkeysHelp>
|
69
|
-
<ul className="b-pubkeys__list">
|
70
|
-
{pubkeysList}
|
71
|
-
</ul>
|
72
|
-
</div>
|
73
|
-
);
|
74
|
-
}
|
75
|
-
});
|
76
|
-
|
77
|
-
var PubkeysHelp = React.createClass({
|
78
|
-
render: function() {
|
79
|
-
var ret;
|
80
|
-
|
81
|
-
if (React.Children.count(this.props.children) > 0) {
|
82
|
-
ret = (
|
83
|
-
<p className="b-pubkeys__help">
|
84
|
-
{this.props.children}
|
85
|
-
</p>
|
86
|
-
);
|
87
|
-
} else {
|
88
|
-
var login = this.props.login;
|
89
|
-
|
90
|
-
ret = (
|
91
|
-
<p className="b-pubkeys__help">
|
92
|
-
There is no pubkeys registered for this user yet. Use following command to upload one from a file:
|
93
|
-
<pre>$ conjur pubkeys add {login} @userkeyfile.pub</pre>
|
94
|
-
</p>
|
95
|
-
);
|
96
|
-
}
|
97
|
-
|
98
|
-
return ret;
|
99
|
-
}
|
100
|
-
});
|
101
|
-
|
102
|
-
var PubkeysTabContent = React.createClass({
|
103
|
-
render: function() {
|
104
|
-
var body;
|
105
|
-
|
106
|
-
if (this.props.pubkeys.length > 0) {
|
107
|
-
body = (
|
108
|
-
<PubkeysList login={this.props.login} pubkeys={this.props.pubkeys} />
|
109
|
-
);
|
110
|
-
} else {
|
111
|
-
body = (
|
112
|
-
<div className="b-pubkeys">
|
113
|
-
<PubkeysHelp login={this.props.login} />
|
114
|
-
</div>
|
115
|
-
);
|
116
|
-
}
|
117
|
-
|
118
|
-
return body;
|
119
|
-
}
|
120
|
-
});
|
121
|
-
|
122
|
-
var Activity = React.createClass({
|
123
|
-
mixins: [ChartHelperMixin],
|
124
|
-
|
125
|
-
getDefaultProps: function() {
|
126
|
-
return {
|
127
|
-
options: {
|
128
|
-
legend: {
|
129
|
-
logins: 'Logins',
|
130
|
-
sudo: 'Sudo calls',
|
131
|
-
reads: 'Secret reads',
|
132
|
-
updates: 'Secret updates',
|
133
|
-
warnings: 'Warnings'
|
134
|
-
},
|
135
|
-
axis: {
|
136
|
-
y: {
|
137
|
-
label: 'Value'
|
138
|
-
}
|
139
|
-
}
|
140
|
-
}
|
141
|
-
};
|
142
|
-
},
|
143
|
-
|
144
|
-
getDefaultItem: function() {
|
145
|
-
return {
|
146
|
-
logins: 0,
|
147
|
-
sudo: 0,
|
148
|
-
reads: 0,
|
149
|
-
updates: 0,
|
150
|
-
warnings: 0
|
151
|
-
};
|
152
|
-
},
|
153
|
-
|
154
|
-
getEventType: function(e) {
|
155
|
-
if (e.hasOwnProperty('facility') && e.facility === 'ssh') {
|
156
|
-
if (e.action === 'sudo' && e.allowed === true) {
|
157
|
-
return 'sudo';
|
158
|
-
|
159
|
-
} else if (e.action === 'login' && e.allowed === true) {
|
160
|
-
return 'logins';
|
161
|
-
}
|
162
|
-
}
|
163
|
-
|
164
|
-
if (e.hasOwnProperty('error') || e.allowed === false) {
|
165
|
-
return 'warnings';
|
166
|
-
}
|
167
|
-
|
168
|
-
if (e.action==='check' &&
|
169
|
-
e.hasOwnProperty('allowed') &&
|
170
|
-
e.allowed === true) {
|
171
|
-
|
172
|
-
if (e.hasOwnProperty('role') &&
|
173
|
-
e.role === this.props.roleid) {
|
174
|
-
|
175
|
-
if (e.hasOwnProperty('resource') &&
|
176
|
-
e.resource.split(':')[1] === 'variable') {
|
177
|
-
|
178
|
-
if (e.privilege === 'update' ) {
|
179
|
-
return 'updates';
|
180
|
-
|
181
|
-
} else if (e.privilege === 'execute') {
|
182
|
-
return 'reads';
|
183
|
-
}
|
184
|
-
}
|
185
|
-
}
|
186
|
-
}
|
187
|
-
|
188
|
-
return null;
|
189
|
-
},
|
190
|
-
|
191
|
-
render: function() {
|
192
|
-
var data = this.getData(this.props.audit);
|
193
|
-
|
194
|
-
return (
|
195
|
-
<div className="b-user-activity">
|
196
|
-
<h2>Activity</h2>
|
197
|
-
<div className="b-user-activity__graph">
|
198
|
-
<Chart options={this.props.options}
|
199
|
-
data={data} />
|
200
|
-
</div>
|
201
|
-
</div>
|
202
|
-
);
|
203
|
-
}
|
204
|
-
});
|
205
|
-
|
206
|
-
var Details = React.createClass({
|
207
|
-
render: function() {
|
208
|
-
// TODO: refactor
|
209
|
-
// TODO: show public keys
|
210
|
-
// TODO: actions menu (e.g. 'upload public key', 'add annotation')
|
211
|
-
// TODO: memberships panel
|
212
|
-
return (
|
213
|
-
<div className="b-user-details">
|
214
|
-
<h2>Details</h2>
|
215
|
-
<dl className="dl-horizontal">
|
216
|
-
<dt>Created by</dt>
|
217
|
-
<dd><RoleLink id={this.props.user.userid}/></dd>
|
218
|
-
|
219
|
-
<dt>Owner</dt>
|
220
|
-
<dd><RoleLink id={this.props.owner}/></dd>
|
221
|
-
|
222
|
-
<dt>Uidnumber</dt>
|
223
|
-
<dd>{this.props.user.uidnumber}</dd>
|
224
|
-
</dl>
|
225
|
-
</div>
|
226
|
-
);
|
227
|
-
}
|
228
|
-
});
|
229
|
-
|
230
|
-
this.User = React.createClass({
|
231
|
-
mixins: [Tab],
|
232
|
-
|
233
|
-
render: function() {
|
234
|
-
var user = this.props.data.user;
|
235
|
-
|
236
|
-
var pubkeysTab = (
|
237
|
-
<TabPane key="pubkeys"
|
238
|
-
tab={conjur.utils.getTabname('Public Keys', this.props.data.pubkeys)}>
|
239
|
-
<PubkeysTabContent login={user.login} pubkeys={this.props.data.pubkeys} />
|
240
|
-
</TabPane>
|
241
|
-
);
|
242
|
-
|
243
|
-
var permissionsTab = this.permissionsTab(user.roleid);
|
244
|
-
var membershipsTab = this.membershipsTab(user.roleid);
|
245
|
-
var ownedTab = this.ownedTab();
|
246
|
-
|
247
|
-
var tabs = _.compact([
|
248
|
-
pubkeysTab,
|
249
|
-
ownedTab,
|
250
|
-
membershipsTab,
|
251
|
-
permissionsTab
|
252
|
-
]);
|
253
|
-
|
254
|
-
var elems = [
|
255
|
-
{url: '/ui/users', text: 'Users'},
|
256
|
-
{url: '', text: this.props.data.user.login},
|
257
|
-
{url: '', text: '(owned by ' + this.props.data.user.ownerid + ')'}
|
258
|
-
];
|
259
|
-
|
260
|
-
return (
|
261
|
-
<div className="b-user">
|
262
|
-
<Breadcrumbs elems={elems} />
|
263
|
-
<hr />
|
264
|
-
<Activity audit={this.props.data.audit} roleid={user.roleid} />
|
265
|
-
<hr />
|
266
|
-
{FoldableAuditSection.warnings(this.props.data.audit)}
|
267
|
-
<hr />
|
268
|
-
<div className="row">
|
269
|
-
<div className="col-md-6">
|
270
|
-
<Details owner={this.props.data.owner}
|
271
|
-
user={user} />
|
272
|
-
</div>
|
273
|
-
<div className="col-md-6">
|
274
|
-
<h2>Annotations</h2>
|
275
|
-
<AnnotationsBox annotations={this.props.data.annotations} />
|
276
|
-
</div>
|
277
|
-
</div>
|
278
|
-
<hr />
|
279
|
-
<h2>Other</h2>
|
280
|
-
<TabbedArea>
|
281
|
-
{tabs}
|
282
|
-
</TabbedArea>
|
283
|
-
<hr />
|
284
|
-
<AuditBox roles={[user.roleid]}
|
285
|
-
resources={[user.resource_identifier]} />
|
286
|
-
</div>
|
287
|
-
);
|
288
|
-
}
|
289
|
-
});
|
290
|
-
|
291
|
-
}).bind(conjur.views)
|
292
|
-
(
|
293
|
-
conjur,
|
294
|
-
_,
|
295
|
-
React,
|
296
|
-
ReactBootstrap
|
297
|
-
);
|
data/public/js/views/users.js
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
/** @jsx React.DOM */
|
2
|
-
/* global conjur, React */
|
3
|
-
|
4
|
-
(function(conjur, React) {
|
5
|
-
'use strict';
|
6
|
-
|
7
|
-
var GenericList = conjur.views.GenericList;
|
8
|
-
|
9
|
-
this.UserBox = React.createClass({
|
10
|
-
render: function() {
|
11
|
-
return (
|
12
|
-
<div className="userBox">
|
13
|
-
<div className="userList">
|
14
|
-
<h2>Users</h2>
|
15
|
-
<GenericList data={{kind: 'users', members: this.props.data.members}} />
|
16
|
-
</div>
|
17
|
-
</div>
|
18
|
-
);
|
19
|
-
}
|
20
|
-
});
|
21
|
-
|
22
|
-
}).bind(conjur.views)
|
23
|
-
(
|
24
|
-
conjur,
|
25
|
-
React
|
26
|
-
);
|
data/public/js/views/variable.js
DELETED
@@ -1,310 +0,0 @@
|
|
1
|
-
/** @jsx React.DOM */
|
2
|
-
/* global conjur, React, ReactBootstrap, _ */
|
3
|
-
|
4
|
-
(function(conjur, React, ReactBootstrap, _) {
|
5
|
-
'use strict';
|
6
|
-
|
7
|
-
var RoleLink = conjur.views.RoleLink,
|
8
|
-
AuditBox = window.AuditBox,
|
9
|
-
Breadcrumbs = conjur.views.Breadcrumbs,
|
10
|
-
Chart = conjur.views.Chart,
|
11
|
-
ChartHelperMixin = conjur.views.ChartHelperMixin,
|
12
|
-
AnnotationsBox = conjur.views.AnnotationsBox,
|
13
|
-
FoldableAuditSection = conjur.views.FoldableAuditSection;
|
14
|
-
|
15
|
-
var RevealerBox = React.createClass({
|
16
|
-
getInitialState: function() {
|
17
|
-
return {revealed: false};
|
18
|
-
},
|
19
|
-
|
20
|
-
handleClick: function() {
|
21
|
-
this.setState({revealed: !this.state.revealed});
|
22
|
-
},
|
23
|
-
|
24
|
-
render: function() {
|
25
|
-
var valToShow = this.state.revealed ? 'SECRET HERE!' : 'Show Value';
|
26
|
-
|
27
|
-
return (
|
28
|
-
<div className="revealer well well-sm" onClick={this.handleClick}>
|
29
|
-
{valToShow}
|
30
|
-
</div>
|
31
|
-
);
|
32
|
-
}
|
33
|
-
});
|
34
|
-
|
35
|
-
var Activity = React.createClass({
|
36
|
-
mixins: [ChartHelperMixin],
|
37
|
-
|
38
|
-
getDefaultProps: function() {
|
39
|
-
return {
|
40
|
-
options: {
|
41
|
-
legend: {
|
42
|
-
sread: 'Successful reads',
|
43
|
-
supdate: 'Successful updates',
|
44
|
-
fread: 'Failed reads',
|
45
|
-
fupdate: 'Failed updates'
|
46
|
-
},
|
47
|
-
axis: {
|
48
|
-
y: {
|
49
|
-
label: 'Value'
|
50
|
-
}
|
51
|
-
}
|
52
|
-
}
|
53
|
-
};
|
54
|
-
},
|
55
|
-
|
56
|
-
getDefaultItem: function() {
|
57
|
-
return {
|
58
|
-
sread: 0,
|
59
|
-
supdate: 0,
|
60
|
-
fread: 0,
|
61
|
-
fupdate: 0
|
62
|
-
};
|
63
|
-
},
|
64
|
-
|
65
|
-
getEventType: function(e) {
|
66
|
-
if (e.action === 'check') {
|
67
|
-
if (e.hasOwnProperty('error') || e.allowed === false) {
|
68
|
-
if (e.privilege === 'execute') {
|
69
|
-
return 'fread';
|
70
|
-
} else if (e.privilege === 'update') {
|
71
|
-
return 'fupdate';
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
if (!e.hasOwnProperty('error') && e.allowed !== false) {
|
76
|
-
if (e.privilege === 'execute') {
|
77
|
-
return 'sread';
|
78
|
-
} else if (e.privilege === 'update') {
|
79
|
-
return 'supdate';
|
80
|
-
}
|
81
|
-
}
|
82
|
-
}
|
83
|
-
|
84
|
-
return null;
|
85
|
-
},
|
86
|
-
|
87
|
-
render: function() {
|
88
|
-
var data = this.getData(this.props.audit);
|
89
|
-
|
90
|
-
return (
|
91
|
-
<div className="b-variable-activity">
|
92
|
-
<h2>Activity</h2>
|
93
|
-
<div className="b-variable-activity__graph">
|
94
|
-
<Chart options={this.props.options}
|
95
|
-
data={data} />
|
96
|
-
</div>
|
97
|
-
</div>
|
98
|
-
);
|
99
|
-
}
|
100
|
-
});
|
101
|
-
|
102
|
-
var Updaters = React.createClass({
|
103
|
-
getInitialState: function() {
|
104
|
-
return {showAll: false};
|
105
|
-
},
|
106
|
-
|
107
|
-
handleClick: function(e) {
|
108
|
-
e.preventDefault();
|
109
|
-
|
110
|
-
this.setState({showAll: !this.state.showAll});
|
111
|
-
},
|
112
|
-
|
113
|
-
getItems: function() {
|
114
|
-
var items = this.props.data || [];
|
115
|
-
|
116
|
-
if (!this.state.showAll) {
|
117
|
-
items = _.first(items, 5);
|
118
|
-
}
|
119
|
-
|
120
|
-
return _.map(items, function(e) {
|
121
|
-
return (
|
122
|
-
<li className="list-group-item list-group-item-noborder">
|
123
|
-
<RoleLink id={e} />
|
124
|
-
</li>
|
125
|
-
);
|
126
|
-
});
|
127
|
-
},
|
128
|
-
|
129
|
-
render: function() {
|
130
|
-
var items = this.getItems(),
|
131
|
-
msg = this.state.showAll ? 'Show top 5' : 'See all',
|
132
|
-
empty = items.length === 0,
|
133
|
-
lessThan5 = items.length < 5,
|
134
|
-
body = [(<h2>Updaters</h2>)];
|
135
|
-
|
136
|
-
if (!empty) {
|
137
|
-
body.push(
|
138
|
-
<ul className="b-variable-updaters__list list-unstyled list-group">
|
139
|
-
{items}
|
140
|
-
</ul>
|
141
|
-
);
|
142
|
-
} else {
|
143
|
-
body.push(
|
144
|
-
<p>There is not any updaters</p>
|
145
|
-
);
|
146
|
-
}
|
147
|
-
|
148
|
-
if (!lessThan5) {
|
149
|
-
body.push(
|
150
|
-
<div className="b-variable-updaters__toggle">
|
151
|
-
<a href="#" onClick={this.handleClick}>{msg}</a>
|
152
|
-
</div>
|
153
|
-
);
|
154
|
-
}
|
155
|
-
|
156
|
-
return (
|
157
|
-
<div className="b-variable-updaters">
|
158
|
-
{body}
|
159
|
-
</div>
|
160
|
-
);
|
161
|
-
}
|
162
|
-
});
|
163
|
-
|
164
|
-
var Fetchers = React.createClass({
|
165
|
-
getInitialState: function() {
|
166
|
-
return {showAll: false};
|
167
|
-
},
|
168
|
-
|
169
|
-
handleClick: function(e) {
|
170
|
-
e.preventDefault();
|
171
|
-
|
172
|
-
this.setState({showAll: !this.state.showAll});
|
173
|
-
},
|
174
|
-
|
175
|
-
getItems: function() {
|
176
|
-
var items = this.props.data || [];
|
177
|
-
|
178
|
-
if (!this.state.showAll) {
|
179
|
-
items = _.first(items, 5);
|
180
|
-
}
|
181
|
-
|
182
|
-
return _.map(items, function(e) {
|
183
|
-
return (
|
184
|
-
<li className="list-group-item list-group-item-noborder">
|
185
|
-
<RoleLink id={e} />
|
186
|
-
</li>
|
187
|
-
);
|
188
|
-
});
|
189
|
-
},
|
190
|
-
|
191
|
-
render: function() {
|
192
|
-
var items = this.getItems(),
|
193
|
-
msg = this.state.showAll ? 'Show top 5' : 'See all',
|
194
|
-
empty = items.length === 0,
|
195
|
-
lessThan5 = items.length < 5,
|
196
|
-
body = [(<h2>Fetchers</h2>)];
|
197
|
-
|
198
|
-
if (!empty) {
|
199
|
-
body.push(
|
200
|
-
<ul className="b-variable-fetchers__list list-unstyled list-group">
|
201
|
-
{items}
|
202
|
-
</ul>
|
203
|
-
);
|
204
|
-
} else {
|
205
|
-
body.push(
|
206
|
-
<p>There is not any fetchers</p>
|
207
|
-
);
|
208
|
-
}
|
209
|
-
|
210
|
-
if (!lessThan5) {
|
211
|
-
body.push(
|
212
|
-
<div className="b-variable-fetchers__toggle">
|
213
|
-
<a href="#" onClick={this.handleClick}>{msg}</a>
|
214
|
-
</div>
|
215
|
-
);
|
216
|
-
}
|
217
|
-
|
218
|
-
return (
|
219
|
-
<div className="b-variable-fetchers">
|
220
|
-
{body}
|
221
|
-
</div>
|
222
|
-
);
|
223
|
-
}
|
224
|
-
});
|
225
|
-
|
226
|
-
|
227
|
-
var Details = React.createClass({
|
228
|
-
render: function() {
|
229
|
-
// <RevealerBox variable={this.props.data.variable} />
|
230
|
-
|
231
|
-
return (
|
232
|
-
<div className="b-variable-details">
|
233
|
-
<h2>Details</h2>
|
234
|
-
<dl className="dl-horizontal">
|
235
|
-
<dt>Owner</dt>
|
236
|
-
<dd><RoleLink id={this.props.data.owner} /></dd>
|
237
|
-
|
238
|
-
<dt>Created by</dt>
|
239
|
-
<dd><RoleLink id={this.props.data.variable.userid} /></dd>
|
240
|
-
|
241
|
-
<dt>MIME type</dt>
|
242
|
-
<dd>{this.props.data.variable.mime_type}</dd>
|
243
|
-
|
244
|
-
<dt>Kind</dt>
|
245
|
-
<dd>{this.props.data.variable.kind}</dd>
|
246
|
-
|
247
|
-
<dt>Versions</dt>
|
248
|
-
<dd>{this.props.data.variable.version_count}</dd>
|
249
|
-
</dl>
|
250
|
-
</div>
|
251
|
-
);
|
252
|
-
}
|
253
|
-
});
|
254
|
-
|
255
|
-
this.Variable = React.createClass({
|
256
|
-
render: function() {
|
257
|
-
var resourceId = [
|
258
|
-
conjur.app.configuration.account,
|
259
|
-
'variable',
|
260
|
-
this.props.data.variable.id
|
261
|
-
].join(':');
|
262
|
-
|
263
|
-
var elems = [
|
264
|
-
{url: '/ui/variables', text: 'Variables'},
|
265
|
-
{url: '', text: this.props.data.variable.id},
|
266
|
-
{url: '', text: '(owned by ' + this.props.data.variable.ownerid + ')'}
|
267
|
-
];
|
268
|
-
|
269
|
-
return (
|
270
|
-
<div className="b-variable">
|
271
|
-
<Breadcrumbs elems={elems} />
|
272
|
-
<hr />
|
273
|
-
<Activity audit={this.props.data.audit} />
|
274
|
-
<hr />
|
275
|
-
<div className="row">
|
276
|
-
<div className="col-md-6">
|
277
|
-
<Updaters data={this.props.data.updaters} />
|
278
|
-
</div>
|
279
|
-
<div className="col-md-6">
|
280
|
-
<Fetchers data={this.props.data.fetchers} />
|
281
|
-
</div>
|
282
|
-
</div>
|
283
|
-
<hr />
|
284
|
-
{FoldableAuditSection.updates(this.props.data.audit)}
|
285
|
-
<hr />
|
286
|
-
{FoldableAuditSection.warnings(this.props.data.audit)}
|
287
|
-
<hr />
|
288
|
-
<div className="row">
|
289
|
-
<div className="col-md-6">
|
290
|
-
<Details data={this.props.data} />
|
291
|
-
</div>
|
292
|
-
<div className="col-md-6">
|
293
|
-
<h2>Annotations</h2>
|
294
|
-
<AnnotationsBox annotations={this.props.data.annotations} />
|
295
|
-
</div>
|
296
|
-
</div>
|
297
|
-
<hr />
|
298
|
-
<AuditBox resources={[resourceId]} />
|
299
|
-
</div>
|
300
|
-
);
|
301
|
-
}
|
302
|
-
});
|
303
|
-
|
304
|
-
}).bind(conjur.views)
|
305
|
-
(
|
306
|
-
conjur,
|
307
|
-
React,
|
308
|
-
ReactBootstrap,
|
309
|
-
_
|
310
|
-
);
|