conjur-asset-ui 1.3.2 → 1.4.2
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/CHANGELOG.md +7 -0
- data/Gemfile +3 -1
- data/README.md +38 -4
- data/Rakefile +69 -1
- data/TODO.md +31 -0
- data/bower.json +98 -0
- data/conjur-asset-ui.gemspec +3 -3
- 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 +139 -0
- data/lib/conjur/command/ui.rb +1 -1
- data/lib/conjur/webserver/server.rb +14 -8
- data/lib/conjur-asset-ui-version.rb +1 -1
- data/package.json +47 -0
- data/preprocessor.js +7 -0
- data/public/_client_libs.html +1 -16
- data/public/build/css/styles.css +87 -0
- data/public/build/css/vendor.css +5 -0
- data/public/build/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/{fonts → build/fonts}/glyphicons-halflings-regular.svg +47 -47
- data/public/{fonts → build/fonts}/glyphicons-halflings-regular.ttf +0 -0
- data/public/build/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/build/js/app.min.js +4 -0
- data/public/build/js/vendor.min.js +23 -0
- data/public/build/maps/app.min.js.map +1 -0
- data/public/build/maps/vendor.min.js.map +1 -0
- data/public/css/styles.less +246 -17
- data/public/index.html.erb +11 -10
- data/public/js/init.js +186 -97
- data/public/js/lib/sorted-set.no-require.js +3 -28
- data/public/js/models/groupRecord.js +14 -12
- data/public/js/models/hostRecord.js +13 -8
- data/public/js/models/layerRecord.js +14 -12
- data/public/js/models/namespace.js +2 -0
- data/public/js/models/policyList.js +3 -1
- data/public/js/models/policyRecord.js +8 -8
- data/public/js/models/record.js +59 -27
- data/public/js/models/resourceList.js +28 -10
- data/public/js/models/userList.js +7 -2
- data/public/js/models/userRecord.js +14 -9
- data/public/js/models/variableList.js +18 -7
- data/public/js/models/variableRecord.js +18 -14
- data/public/js/routers.js +74 -37
- data/public/js/views/annotations.js +39 -28
- data/public/js/views/audit.js +31 -25
- data/public/js/views/breadcrumbs.js +62 -0
- data/public/js/views/chart.js +617 -0
- data/public/js/views/dashboard.js +144 -65
- data/public/js/views/generic.js +16 -9
- data/public/js/views/group.js +103 -55
- data/public/js/views/groups.js +3 -7
- data/public/js/views/host.js +192 -56
- data/public/js/views/hosts.js +2 -6
- data/public/js/views/layer.js +136 -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 +54 -34
- data/public/js/views/role.js +59 -37
- data/public/js/views/searchResults.js +205 -138
- data/public/js/views/sections.js +226 -0
- data/public/js/views/time.js +38 -13
- data/public/js/views/user.js +288 -59
- data/public/js/views/users.js +2 -7
- data/public/js/views/variable.js +293 -53
- data/public/js/views/variables.js +4 -8
- metadata +34 -56
- data/.git-hooks/pre_commit/ensure_livescript_compiled.rb +0 -31
- data/.overcommit.yml +0 -5
- data/compile_ls +0 -6
- data/livescript/views/audit.ls +0 -136
- 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.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/date.extensions.js +0 -141
- data/public/js/lib/less.js +0 -16
- data/public/js/lib/moment.js +0 -7768
- data/public/js/lib/prelude-browser-min.js +0 -1
- 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
- data/vendor/prelude-ls/.gitignore +0 -2
- data/vendor/prelude-ls/.travis.yml +0 -3
- data/vendor/prelude-ls/CHANGELOG.md +0 -81
- data/vendor/prelude-ls/LICENSE +0 -22
- data/vendor/prelude-ls/Makefile +0 -50
- data/vendor/prelude-ls/README.md +0 -15
- data/vendor/prelude-ls/browser/prelude-browser-min.js +0 -1
- data/vendor/prelude-ls/browser/prelude-browser.js +0 -1172
- data/vendor/prelude-ls/lib/Func.js +0 -40
- data/vendor/prelude-ls/lib/List.js +0 -602
- data/vendor/prelude-ls/lib/Num.js +0 -129
- data/vendor/prelude-ls/lib/Obj.js +0 -153
- data/vendor/prelude-ls/lib/Str.js +0 -68
- data/vendor/prelude-ls/lib/index.js +0 -164
- data/vendor/prelude-ls/package.json +0 -50
- data/vendor/prelude-ls/package.ls +0 -46
- data/vendor/prelude-ls/src/Func.ls +0 -17
- data/vendor/prelude-ls/src/List.ls +0 -299
- data/vendor/prelude-ls/src/Num.ls +0 -83
- data/vendor/prelude-ls/src/Obj.ls +0 -61
- data/vendor/prelude-ls/src/Str.ls +0 -32
- data/vendor/prelude-ls/src/index.ls +0 -56
- data/vendor/prelude-ls/test/Func.ls +0 -36
- data/vendor/prelude-ls/test/List.ls +0 -751
- data/vendor/prelude-ls/test/Num.ls +0 -258
- data/vendor/prelude-ls/test/Obj.ls +0 -145
- data/vendor/prelude-ls/test/Prelude.ls +0 -49
- data/vendor/prelude-ls/test/Str.ls +0 -208
- data/vendor/prelude-ls/test/browser.html +0 -5
@@ -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
|
},
|
@@ -47,17 +48,20 @@
|
|
47
48
|
this.attributes.bind(this),
|
48
49
|
members('execute'),
|
49
50
|
members('update'),
|
50
|
-
this.resource.bind(this)
|
51
|
+
this.resource.bind(this),
|
52
|
+
this.auditResource.bind(this)
|
51
53
|
], function(err, results) {
|
52
54
|
if (err) {
|
53
|
-
return
|
55
|
+
return customErrback(err.status);
|
54
56
|
}
|
55
57
|
|
56
58
|
callback({
|
57
59
|
variable: results[0],
|
58
60
|
fetchers: results[1],
|
59
61
|
updaters: results[2],
|
60
|
-
|
62
|
+
owner: results[3].owner,
|
63
|
+
annotations: results[3].annotations,
|
64
|
+
audit: results[4]
|
61
65
|
});
|
62
66
|
|
63
67
|
return undefined;
|
data/public/js/routers.js
CHANGED
@@ -1,14 +1,23 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
+
/* global conjur, jQuery, _, Backbone, React */
|
2
3
|
|
3
|
-
|
4
|
+
|
5
|
+
(function(conjur, $, _, Backbone, React) {
|
4
6
|
'use strict';
|
5
7
|
|
6
|
-
var
|
8
|
+
var Dashboard = conjur.views.Dashboard,
|
9
|
+
GroupBox = conjur.views.GroupBox,
|
7
10
|
LayerBox = conjur.views.LayerBox,
|
8
11
|
PolicyBox = conjur.views.PolicyBox,
|
9
12
|
VariableBox = conjur.views.VariableBox,
|
10
|
-
|
11
|
-
|
13
|
+
UserBox = conjur.views.UserBox,
|
14
|
+
Group = conjur.views.Group,
|
15
|
+
Host = conjur.views.Host,
|
16
|
+
Layer = conjur.views.Layer,
|
17
|
+
Policy = conjur.views.Policy,
|
18
|
+
User = conjur.views.User,
|
19
|
+
Variable = conjur.views.Variable,
|
20
|
+
SearchResults = conjur.views.SearchResults;
|
12
21
|
|
13
22
|
conjur.Workspace = Backbone.Router.extend({
|
14
23
|
routes: {
|
@@ -37,7 +46,8 @@
|
|
37
46
|
|
38
47
|
conjur.app.lists[conjur.app.kind].fetch(function(list) {
|
39
48
|
var component = componentFunction(list);
|
40
|
-
// doesn't make much sense due to
|
49
|
+
// doesn't make much sense due to
|
50
|
+
// http://stackoverflow.com/questions/24889934/componentinstance-setstate-undefined-in-0-11-0
|
41
51
|
//components[kind] = component;
|
42
52
|
|
43
53
|
React.renderComponent(
|
@@ -45,15 +55,15 @@
|
|
45
55
|
document.getElementById('content')
|
46
56
|
);
|
47
57
|
|
48
|
-
// state reset won't work anymore in react v11,
|
49
|
-
//
|
58
|
+
// state reset won't work anymore in react v11,
|
59
|
+
// plus I am not sure how it is supposed to work,
|
60
|
+
// if namespace was just reset to zero
|
61
|
+
// component.setState({currentNamespace: namespace.currentNamespace,
|
62
|
+
// members: list.members(namespace.currentNamespace)});
|
50
63
|
});
|
51
64
|
},
|
52
65
|
|
53
66
|
activateRecord: function(k, id, componentFunction) {
|
54
|
-
/* console.log('Record', k, ' :', id); */
|
55
|
-
|
56
|
-
$('#inlineSearchContainer').show();
|
57
67
|
conjur.app.kind = conjur.utils.pluralize(k);
|
58
68
|
this.setActiveNav(conjur.app.kind);
|
59
69
|
|
@@ -73,9 +83,11 @@
|
|
73
83
|
component,
|
74
84
|
document.getElementById('content')
|
75
85
|
);
|
76
|
-
}, function(status, text
|
77
|
-
if (status
|
78
|
-
conjur.app.flash = 'You are not authorized to view ' +
|
86
|
+
}, function(status, text) {
|
87
|
+
if (status === 403) {
|
88
|
+
conjur.app.flash = 'You are not authorized to view ' +
|
89
|
+
conjur.app.kind + ':' + id + '.';
|
90
|
+
|
79
91
|
window.history.back();
|
80
92
|
} else {
|
81
93
|
console.error('HTTP error: ', status, text);
|
@@ -89,7 +101,6 @@
|
|
89
101
|
},
|
90
102
|
|
91
103
|
dashboard: function() {
|
92
|
-
$('#inlineSearchContainer').hide();
|
93
104
|
React.renderComponent(
|
94
105
|
<Dashboard />,
|
95
106
|
document.getElementById('content')
|
@@ -98,77 +109,92 @@
|
|
98
109
|
|
99
110
|
user: function(user) {
|
100
111
|
this.activateRecord('user', user, function(record) {
|
101
|
-
return
|
112
|
+
return (
|
113
|
+
<User data={record}/>
|
114
|
+
);
|
102
115
|
});
|
103
116
|
},
|
104
117
|
|
105
118
|
users: function() {
|
106
|
-
$('#inlineSearchContainer').show();
|
107
119
|
conjur.app.kind = 'users';
|
108
120
|
|
109
121
|
this.activateList(function(list) {
|
110
|
-
return
|
122
|
+
return (
|
123
|
+
<UserBox data={{namespaces: list.namespaces, members: list.members('')}} />
|
124
|
+
);
|
111
125
|
});
|
112
126
|
},
|
113
127
|
|
114
128
|
group: function(group) {
|
115
129
|
this.activateRecord('group', group, function(record) {
|
116
|
-
return
|
130
|
+
return (
|
131
|
+
<Group data={record} />
|
132
|
+
);
|
117
133
|
});
|
118
134
|
},
|
119
135
|
|
120
136
|
groups: function() {
|
121
|
-
$('#inlineSearchContainer').show();
|
122
137
|
conjur.app.kind = 'groups';
|
123
138
|
|
124
139
|
this.activateList(function(list) {
|
125
|
-
return
|
140
|
+
return (
|
141
|
+
<GroupBox data={{namespaces: list.namespaces, members: list.members('')}} />
|
142
|
+
);
|
126
143
|
});
|
127
144
|
},
|
128
145
|
|
129
|
-
host: function(host){
|
146
|
+
host: function(host) {
|
130
147
|
this.activateRecord('host', host, function(record) {
|
131
|
-
return
|
148
|
+
return (
|
149
|
+
<Host data={record}/>
|
150
|
+
);
|
132
151
|
});
|
133
152
|
},
|
134
153
|
|
135
154
|
hosts: function() {
|
136
|
-
$('#inlineSearchContainer').show();
|
137
155
|
conjur.app.kind = 'hosts';
|
138
156
|
var HostBox = conjur.views.HostBox;
|
139
157
|
|
140
158
|
this.activateList(function(list) {
|
141
|
-
return
|
159
|
+
return (
|
160
|
+
<HostBox data={{namespaces: list.namespaces, members: list.members('')}} />
|
161
|
+
);
|
142
162
|
});
|
143
163
|
},
|
144
164
|
|
145
165
|
layer: function(layer) {
|
146
166
|
this.activateRecord('layer', layer, function(record) {
|
147
|
-
return
|
167
|
+
return (
|
168
|
+
<Layer data={record} />
|
169
|
+
);
|
148
170
|
});
|
149
171
|
},
|
150
172
|
|
151
173
|
layers: function() {
|
152
|
-
$('#inlineSearchContainer').show();
|
153
174
|
conjur.app.kind = 'layers';
|
154
175
|
|
155
176
|
this.activateList(function(list) {
|
156
|
-
return
|
177
|
+
return (
|
178
|
+
<LayerBox data={{namespaces: list.namespaces, members: list.members('')}} />
|
179
|
+
);
|
157
180
|
});
|
158
181
|
},
|
159
182
|
|
160
183
|
variable: function(variable) {
|
161
184
|
this.activateRecord('variable', variable, function(record) {
|
162
|
-
return
|
185
|
+
return (
|
186
|
+
<Variable data={record} />
|
187
|
+
);
|
163
188
|
});
|
164
189
|
},
|
165
190
|
|
166
191
|
variables: function() {
|
167
|
-
$('#inlineSearchContainer').show();
|
168
192
|
conjur.app.kind = 'variables';
|
169
193
|
|
170
194
|
this.activateList(function(list) {
|
171
|
-
return
|
195
|
+
return (
|
196
|
+
<VariableBox data={{namespaces: list.namespaces, members: list.members('')}} />
|
197
|
+
);
|
172
198
|
});
|
173
199
|
},
|
174
200
|
|
@@ -176,30 +202,41 @@
|
|
176
202
|
conjur.app.kind = 'policies';
|
177
203
|
|
178
204
|
this.activateList(function(list) {
|
179
|
-
return
|
205
|
+
return (
|
206
|
+
<PolicyBox data={{members: list.members('')}} />
|
207
|
+
);
|
180
208
|
});
|
181
209
|
},
|
182
210
|
|
183
211
|
policy: function(policy) {
|
184
212
|
this.activateRecord('policy', policy, function(record) {
|
185
|
-
return
|
213
|
+
return (
|
214
|
+
<Policy data={record} />
|
215
|
+
);
|
186
216
|
});
|
187
217
|
},
|
188
218
|
|
189
|
-
audit: function(){
|
190
|
-
$('#inlineSearchContainer').show();
|
219
|
+
audit: function() {
|
191
220
|
this.setActiveNav('audit');
|
192
221
|
|
222
|
+
var GlobalAudit = window.GlobalAudit;
|
223
|
+
|
193
224
|
React.renderComponent(
|
194
225
|
<GlobalAudit/>,
|
195
226
|
document.getElementById('content')
|
196
227
|
);
|
197
228
|
},
|
198
229
|
|
199
|
-
search: function(search){
|
200
|
-
$('#inlineSearchContainer').show();
|
230
|
+
search: function(search) {
|
201
231
|
SearchResults.search(search);
|
202
232
|
}
|
203
233
|
});
|
204
234
|
|
205
|
-
})
|
235
|
+
})
|
236
|
+
(
|
237
|
+
conjur,
|
238
|
+
jQuery,
|
239
|
+
_,
|
240
|
+
Backbone,
|
241
|
+
React
|
242
|
+
);
|
@@ -1,36 +1,47 @@
|
|
1
1
|
/** @jsx React.DOM */
|
2
|
+
/* global conjur, React */
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
if (!this.props.annotations || !this.props.annotations.length>0 ) {
|
7
|
-
return <div>
|
8
|
-
<span>None</span>
|
9
|
-
</div>;
|
10
|
-
}
|
4
|
+
(function(conjur, React) {
|
5
|
+
'use strict';
|
11
6
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
this.AnnotationsBox = React.createClass({
|
8
|
+
render: function() {
|
9
|
+
if (!this.props.annotations || this.props.annotations.length === 0) {
|
10
|
+
return (
|
11
|
+
<div>
|
12
|
+
<span>None</span>
|
13
|
+
</div>
|
14
|
+
);
|
15
|
+
}
|
20
16
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
annotations_list.push(<dt key={dt_key}>{itemname}</dt>);
|
25
|
-
annotations_list.push(<dd key={dd_key}>{itemvalue}</dd>);
|
26
|
-
});
|
17
|
+
// TODO: sort by date (optionally)
|
18
|
+
// TODO: table view
|
19
|
+
var annotationsList = [];
|
27
20
|
|
21
|
+
this.props.annotations.sort(function(a, b) {
|
22
|
+
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
|
23
|
+
}).forEach(function(item) {
|
24
|
+
var itemName = item.name,
|
25
|
+
itemValue = item.value,
|
26
|
+
term = 'annotation_' + itemName + '_key',
|
27
|
+
description = 'annotation_' + itemName + '_value';
|
28
28
|
|
29
|
-
|
30
|
-
<
|
31
|
-
|
29
|
+
annotationsList.push(<dt key={term}>{itemName}</dt>);
|
30
|
+
annotationsList.push(<dd key={description}>{itemValue}</dd>);
|
31
|
+
});
|
32
|
+
|
33
|
+
return (
|
34
|
+
<div>
|
35
|
+
<dl className="annotations">
|
36
|
+
{annotationsList}
|
32
37
|
</dl>
|
33
|
-
|
34
|
-
|
35
|
-
|
38
|
+
</div>
|
39
|
+
);
|
40
|
+
}
|
41
|
+
});
|
42
|
+
|
43
|
+
}).bind(conjur.views)
|
44
|
+
(
|
45
|
+
conjur,
|
46
|
+
React
|
36
47
|
);
|
data/public/js/views/audit.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
ref$ = React.DOM, em = ref$.em, strong = ref$.strong, table = ref$.table, div = ref$.div, th = ref$.th, tr = ref$.tr, td = ref$.td, thead = ref$.thead, tbody = ref$.tbody, section = ref$.section, h3 = ref$.h3, time = ref$.time;
|
7
7
|
ref$ = require('prelude-ls'), map = ref$.map, each = ref$.each, unique = ref$.unique, isType = ref$.isType, join = ref$.join;
|
8
8
|
compact_fields = ['auditview_user', 'auditview_action'];
|
9
|
-
//extended_fields = ['timestamp', 'user', 'acting_as', 'action', 'entities', 'privilege','human'];
|
9
|
+
//extended_fields = ['timestamp', 'user', 'acting_as', 'action', 'entities', 'privilege','human'];
|
10
10
|
extended_fields = ['timestamp','auditview_user','auditview_action'];
|
11
11
|
known_rolsource_types = [ 'user','group','host','layer','policy']; // what if somebody explicitly will create the role of such type?
|
12
12
|
FieldsMixin = {
|
@@ -57,7 +57,10 @@
|
|
57
57
|
// TODO: make message a separate React Class
|
58
58
|
humanizeEvent: function(e) {
|
59
59
|
// copy of SHORT_FORMATS logic from cli-ruby:lib/conjur/command/audit.rb
|
60
|
-
var msg=
|
60
|
+
var msg=[];
|
61
|
+
|
62
|
+
var ResourceLink = conjur.views.ResourceLink;
|
63
|
+
var RoleLink = conjur.views.RoleLink;
|
61
64
|
|
62
65
|
if ((e.kind=='resource') && (e.action=='check')) {
|
63
66
|
msg = [ ]
|
@@ -84,7 +87,7 @@
|
|
84
87
|
} else if ((e.kind=="resource") && (e.action=="permit")) {
|
85
88
|
msg = [ " permitted ", RoleLink({id: e.grantee, noIcon: true}), " to ", em({}, e.privilege), " ", ResourceLink({id: e.resource, noIcon: true}) ]
|
86
89
|
if ( e.grant_option )
|
87
|
-
msg.push(" with grant option");
|
90
|
+
msg.push(" with grant option");
|
88
91
|
} else if ((e.kind=="resource") && (e.action=="deny")) {
|
89
92
|
msg = [ " denied ", em({}, e.privilege), " from ", RoleLink({id: e.grantee, noIcon: true}), " on ", ResourceLink({id: e.resource, noIcon: true}) ];
|
90
93
|
} else if ((e.kind=="resource") && (e.action=="permitted_roles")) {
|
@@ -92,14 +95,14 @@
|
|
92
95
|
} else if ((e.kind=="role") && (e.action=="check")) {
|
93
96
|
msg = [ ]
|
94
97
|
if ( e.allowed ) {
|
95
|
-
msg.push(RoleLink({id: e.role, noIcon: true}))
|
98
|
+
//msg.push(RoleLink({id: e.role, noIcon: true}))
|
96
99
|
msg.push(" performed ");
|
97
100
|
msg.push(em({}, e.privilege));
|
98
101
|
msg.push(" on ");
|
99
102
|
msg.push(ResourceLink({id: e.resource, noIcon: true}));
|
100
103
|
}
|
101
104
|
else {
|
102
|
-
msg.push(RoleLink({id: e.role, noIcon: true}))
|
105
|
+
//msg.push(RoleLink({id: e.role, noIcon: true}))
|
103
106
|
msg.push(" was ");
|
104
107
|
msg.push(strong({}, "denied permission"));
|
105
108
|
msg.push(" to ");
|
@@ -126,32 +129,35 @@
|
|
126
129
|
var parts = [action_part];
|
127
130
|
if (e.role!=null) {
|
128
131
|
parts.push(" by ");
|
129
|
-
parts.push(RoleLink({id: e.role, noIcon: true}));
|
132
|
+
parts.push(RoleLink({id: e.role, noIcon: true}));
|
130
133
|
}
|
131
|
-
if (e.resource_id!=null) {
|
134
|
+
if (e.resource_id!=null) {
|
132
135
|
parts.push(" on");
|
133
|
-
parts.push(ResourceLink({id: e.resource_id, noIcon: true}));
|
136
|
+
parts.push(ResourceLink({id: e.resource_id, noIcon: true}));
|
134
137
|
}
|
135
|
-
if (e.allowed!=null) {
|
136
|
-
parts.push(" (allowed: "+e.allowed+")");
|
138
|
+
if (e.allowed!=null) {
|
139
|
+
parts.push(" (allowed: "+e.allowed+")");
|
137
140
|
}
|
138
141
|
var statement = parts.join(" ");
|
139
142
|
msg = [" reported ", parts ];
|
140
|
-
if (e.audit_message!=null) {
|
143
|
+
if (e.audit_message!=null) {
|
141
144
|
msg.push("; message: ");
|
142
145
|
msg.push(e.audit_message);
|
143
146
|
}
|
144
147
|
} else {
|
145
|
-
msg
|
146
|
-
}
|
148
|
+
msg.push(" unknown event: "+e.kind+":"+e.action+"!");
|
149
|
+
}
|
147
150
|
|
148
151
|
if (e.error!=null) {
|
149
|
-
msg
|
152
|
+
msg.push(" (failed with "+e.error+")");
|
150
153
|
}
|
151
154
|
|
152
155
|
return msg;
|
153
156
|
},
|
154
157
|
transformField: function(key, value){
|
158
|
+
var ResourceLink = conjur.views.ResourceLink;
|
159
|
+
var RoleLink = conjur.views.RoleLink;
|
160
|
+
|
155
161
|
var that;
|
156
162
|
switch (key) {
|
157
163
|
case 'entities':
|
@@ -179,7 +185,7 @@
|
|
179
185
|
break;
|
180
186
|
case 'auditview_user': //virtual field
|
181
187
|
var acting_user =this.props.user;
|
182
|
-
var acting_role = this.props.acting_as;
|
188
|
+
var acting_role = this.props.acting_as;
|
183
189
|
msg = [ RoleLink({id: acting_user}) ];
|
184
190
|
if ((acting_role!=null) && (acting_role != acting_user)) {
|
185
191
|
msg.push([" as ", RoleLink({id: acting_role})]);
|
@@ -192,7 +198,7 @@
|
|
192
198
|
});
|
193
199
|
}
|
194
200
|
break;
|
195
|
-
case 'auditview_action':
|
201
|
+
case 'auditview_action':
|
196
202
|
return this.humanizeEvent(this.props);
|
197
203
|
default:
|
198
204
|
return value;
|
@@ -233,7 +239,7 @@
|
|
233
239
|
events: newEventSet()
|
234
240
|
};
|
235
241
|
},
|
236
|
-
knownRolsourceTypes: function() {
|
242
|
+
knownRolsourceTypes: function() {
|
237
243
|
return ;
|
238
244
|
},
|
239
245
|
render: function(){
|
@@ -250,7 +256,7 @@
|
|
250
256
|
compact: compact
|
251
257
|
}), tbody({
|
252
258
|
key: 'tbody'
|
253
|
-
}, this.state.events.filter(function(ev){
|
259
|
+
}, this.state.events.filter(function(ev){
|
254
260
|
// remove internal resources creation
|
255
261
|
if ((ev.role!=null) && (ev.role.split(':')[1] == '@')) {
|
256
262
|
return false;
|
@@ -270,12 +276,12 @@
|
|
270
276
|
var rolekind = ev.role.split(':')[1];
|
271
277
|
if (_.contains(known_rolsource_types, rolekind)) {
|
272
278
|
return false;
|
273
|
-
}
|
274
|
-
}
|
279
|
+
}
|
280
|
+
}
|
275
281
|
return true;
|
276
282
|
}).map(function(it){
|
277
283
|
// new way to clone objects, custom clone$ does not work no more as expected
|
278
|
-
var ref$ = React.addons.update(it, {$merge: {key: it.id, compact: compact} });
|
284
|
+
var ref$ = React.addons.update(it, {$merge: {key: it.id, compact: compact} });
|
279
285
|
return new AuditEntry(ref$);
|
280
286
|
}))
|
281
287
|
])
|
@@ -288,7 +294,7 @@
|
|
288
294
|
},
|
289
295
|
componentWillUnmount: function(){
|
290
296
|
return each(function(it){
|
291
|
-
console.log("closing event source ", it);
|
297
|
+
// console.log("closing event source ", it);
|
292
298
|
return it.close();
|
293
299
|
})(
|
294
300
|
this.sources);
|
@@ -308,9 +314,9 @@
|
|
308
314
|
},
|
309
315
|
addSource: function(url){
|
310
316
|
var evtSrc;
|
311
|
-
console.log("opening eventsource to " + url);
|
317
|
+
// console.log("opening eventsource to " + url);
|
312
318
|
evtSrc = new EventSource(url);
|
313
|
-
console.log(evtSrc);
|
319
|
+
// console.log(evtSrc);
|
314
320
|
evtSrc.onmessage = this.addEvent;
|
315
321
|
evtSrc.onerror = function(a, b, c, d){
|
316
322
|
return console.log(a, b, c, d);
|
@@ -345,7 +351,7 @@
|
|
345
351
|
resources);
|
346
352
|
things = join(', ')(
|
347
353
|
unique(
|
348
|
-
roles.concat(resources)));
|
354
|
+
roles.concat(resources)));
|
349
355
|
|
350
356
|
var options= { src: roleSrcs.concat(resSrcs) };
|
351
357
|
if (this.props.tabview==null) {
|