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.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.jshintrc +41 -0
  4. data/CHANGELOG.md +7 -0
  5. data/Gemfile +3 -1
  6. data/README.md +38 -4
  7. data/Rakefile +69 -1
  8. data/TODO.md +31 -0
  9. data/bower.json +98 -0
  10. data/conjur-asset-ui.gemspec +3 -3
  11. data/features/navigation_bar.feature +31 -0
  12. data/features/step_definitions/custom_step.rb +32 -0
  13. data/features/support/env.rb +38 -0
  14. data/features/support/hooks.rb +30 -0
  15. data/features/support/world.rb +17 -0
  16. data/gulpfile.js +139 -0
  17. data/lib/conjur/command/ui.rb +1 -1
  18. data/lib/conjur/webserver/server.rb +14 -8
  19. data/lib/conjur-asset-ui-version.rb +1 -1
  20. data/package.json +47 -0
  21. data/preprocessor.js +7 -0
  22. data/public/_client_libs.html +1 -16
  23. data/public/build/css/styles.css +87 -0
  24. data/public/build/css/vendor.css +5 -0
  25. data/public/build/fonts/glyphicons-halflings-regular.eot +0 -0
  26. data/public/{fonts → build/fonts}/glyphicons-halflings-regular.svg +47 -47
  27. data/public/{fonts → build/fonts}/glyphicons-halflings-regular.ttf +0 -0
  28. data/public/build/fonts/glyphicons-halflings-regular.woff +0 -0
  29. data/public/build/js/app.min.js +4 -0
  30. data/public/build/js/vendor.min.js +23 -0
  31. data/public/build/maps/app.min.js.map +1 -0
  32. data/public/build/maps/vendor.min.js.map +1 -0
  33. data/public/css/styles.less +246 -17
  34. data/public/index.html.erb +11 -10
  35. data/public/js/init.js +186 -97
  36. data/public/js/lib/sorted-set.no-require.js +3 -28
  37. data/public/js/models/groupRecord.js +14 -12
  38. data/public/js/models/hostRecord.js +13 -8
  39. data/public/js/models/layerRecord.js +14 -12
  40. data/public/js/models/namespace.js +2 -0
  41. data/public/js/models/policyList.js +3 -1
  42. data/public/js/models/policyRecord.js +8 -8
  43. data/public/js/models/record.js +59 -27
  44. data/public/js/models/resourceList.js +28 -10
  45. data/public/js/models/userList.js +7 -2
  46. data/public/js/models/userRecord.js +14 -9
  47. data/public/js/models/variableList.js +18 -7
  48. data/public/js/models/variableRecord.js +18 -14
  49. data/public/js/routers.js +74 -37
  50. data/public/js/views/annotations.js +39 -28
  51. data/public/js/views/audit.js +31 -25
  52. data/public/js/views/breadcrumbs.js +62 -0
  53. data/public/js/views/chart.js +617 -0
  54. data/public/js/views/dashboard.js +144 -65
  55. data/public/js/views/generic.js +16 -9
  56. data/public/js/views/group.js +103 -55
  57. data/public/js/views/groups.js +3 -7
  58. data/public/js/views/host.js +192 -56
  59. data/public/js/views/hosts.js +2 -6
  60. data/public/js/views/layer.js +136 -82
  61. data/public/js/views/layers.js +2 -6
  62. data/public/js/views/mixins/search.js +12 -5
  63. data/public/js/views/mixins/tabs.js +95 -55
  64. data/public/js/views/navSearch.js +16 -5
  65. data/public/js/views/owned.js +14 -8
  66. data/public/js/views/permissions.js +244 -178
  67. data/public/js/views/policies.js +2 -4
  68. data/public/js/views/policy.js +65 -38
  69. data/public/js/views/resource.js +54 -34
  70. data/public/js/views/role.js +59 -37
  71. data/public/js/views/searchResults.js +205 -138
  72. data/public/js/views/sections.js +226 -0
  73. data/public/js/views/time.js +38 -13
  74. data/public/js/views/user.js +288 -59
  75. data/public/js/views/users.js +2 -7
  76. data/public/js/views/variable.js +293 -53
  77. data/public/js/views/variables.js +4 -8
  78. metadata +34 -56
  79. data/.git-hooks/pre_commit/ensure_livescript_compiled.rb +0 -31
  80. data/.overcommit.yml +0 -5
  81. data/compile_ls +0 -6
  82. data/livescript/views/audit.ls +0 -136
  83. data/public/_client_code.html +0 -42
  84. data/public/css/bootstrap.css +0 -7
  85. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  86. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  87. data/public/js/lib/JSXTransformer.js +0 -10862
  88. data/public/js/lib/async.js +0 -958
  89. data/public/js/lib/backbone.js +0 -2
  90. data/public/js/lib/bootstrap.js +0 -6
  91. data/public/js/lib/date.extensions.js +0 -141
  92. data/public/js/lib/less.js +0 -16
  93. data/public/js/lib/moment.js +0 -7768
  94. data/public/js/lib/prelude-browser-min.js +0 -1
  95. data/public/js/lib/react-bootstrap.js +0 -5346
  96. data/public/js/lib/react-bootstrap.min.js +0 -4
  97. data/public/js/lib/underscore-min.js +0 -6
  98. data/public/js/lib/underscore.string.min.js +0 -1
  99. data/public/js/main.js +0 -57
  100. data/vendor/prelude-ls/.gitignore +0 -2
  101. data/vendor/prelude-ls/.travis.yml +0 -3
  102. data/vendor/prelude-ls/CHANGELOG.md +0 -81
  103. data/vendor/prelude-ls/LICENSE +0 -22
  104. data/vendor/prelude-ls/Makefile +0 -50
  105. data/vendor/prelude-ls/README.md +0 -15
  106. data/vendor/prelude-ls/browser/prelude-browser-min.js +0 -1
  107. data/vendor/prelude-ls/browser/prelude-browser.js +0 -1172
  108. data/vendor/prelude-ls/lib/Func.js +0 -40
  109. data/vendor/prelude-ls/lib/List.js +0 -602
  110. data/vendor/prelude-ls/lib/Num.js +0 -129
  111. data/vendor/prelude-ls/lib/Obj.js +0 -153
  112. data/vendor/prelude-ls/lib/Str.js +0 -68
  113. data/vendor/prelude-ls/lib/index.js +0 -164
  114. data/vendor/prelude-ls/package.json +0 -50
  115. data/vendor/prelude-ls/package.ls +0 -46
  116. data/vendor/prelude-ls/src/Func.ls +0 -17
  117. data/vendor/prelude-ls/src/List.ls +0 -299
  118. data/vendor/prelude-ls/src/Num.ls +0 -83
  119. data/vendor/prelude-ls/src/Obj.ls +0 -61
  120. data/vendor/prelude-ls/src/Str.ls +0 -32
  121. data/vendor/prelude-ls/src/index.ls +0 -56
  122. data/vendor/prelude-ls/test/Func.ls +0 -36
  123. data/vendor/prelude-ls/test/List.ls +0 -751
  124. data/vendor/prelude-ls/test/Num.ls +0 -258
  125. data/vendor/prelude-ls/test/Obj.ls +0 -145
  126. data/vendor/prelude-ls/test/Prelude.ls +0 -49
  127. data/vendor/prelude-ls/test/Str.ls +0 -208
  128. 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
- conjur.models.VariableList = function() {
6
+ this.VariableList = function() {
5
7
  var options = {
6
- filter: function(member) {
7
- var idTokens = member.id.split(':');
8
- var id = idTokens[idTokens.length-1];
9
- return id.split('/').length > 1;
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
- return conjur.models.ResourceList('variable', options);
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, custom_errback) {
22
- var self = this,
23
- id = this.id;
23
+ Variable.prototype.fetch = function(callback, customErrback) {
24
+ var id = this.id;
24
25
 
25
- if (typeof(custom_errback) === 'undefined') {
26
- custom_errback = errback; // reset to default
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
- + conjur.app.configuration.account
34
- + '/roles/allowed_to/'
35
- + privilege
36
- + '/variable/'
37
- + window.encodeURIComponent(id),
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 custom_errback(err.status);
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
- annotations: results[3].annotations
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
- (function(conjur, $, _, Backbone, React, SearchResults) {
4
+
5
+ (function(conjur, $, _, Backbone, React) {
4
6
  'use strict';
5
7
 
6
- var GroupBox = conjur.views.GroupBox,
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
- HostBox = conjur.views.HostBox,
11
- UserBox = conjur.views.UserBox;
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 http://stackoverflow.com/questions/24889934/componentinstance-setstate-undefined-in-0-11-0
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, plus I am not sure how it is supposed to work, if namespace was just reset to zero
49
- // component.setState({currentNamespace: namespace.currentNamespace, members: list.members(namespace.currentNamespace)});
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, xhr) {
77
- if (status == 403) {
78
- conjur.app.flash = 'You are not authorized to view ' + conjur.app.kind + ':' + id + '.';
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 <User data={record}/>;
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 <UserBox data={{namespaces: list.namespaces, members: list.members('')}} />;
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 <Group data={record} />;
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 <GroupBox data={{namespaces: list.namespaces, members: list.members('')}} />;
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 <Host data={record}/>;
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 <HostBox data={{namespaces: list.namespaces, members: list.members('')}} />;
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 <Layer data={record} />;
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 <LayerBox data={{namespaces: list.namespaces, members: list.members('')}} />;
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 <Variable data={record} />;
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 <VariableBox data={{namespaces: list.namespaces, members: list.members('')}} />;
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 <PolicyBox data={{members: list.members('')}} />;
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 <Policy data={record} />;
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
- })(conjur, jQuery, _, Backbone, React, SearchResults);
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
- var AnnotationsBox = React.createClass({
4
- render: function() {
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
- // TODO: sort by date (optionally)
13
- // TODO: table view
14
- var annotations_list = [];
15
- this.props.annotations.sort(function(a,b) {
16
- return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
17
- }).forEach(function(item){
18
- var itemname = item.name;
19
- var itemvalue = item.value;
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
- var dt_key = "annotation_"+itemname+"_key";
22
- var dd_key = "annotation_"+itemname+"_value";
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
- return <div>
30
- <dl className="annotations dl-horizontal">
31
- {annotations_list}
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
- </div>;
34
- }
35
- }
38
+ </div>
39
+ );
40
+ }
41
+ });
42
+
43
+ }).bind(conjur.views)
44
+ (
45
+ conjur,
46
+ React
36
47
  );
@@ -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+=" unknown event: "+e.kind+":"+e.action+"!";
146
- }
148
+ msg.push(" unknown event: "+e.kind+":"+e.action+"!");
149
+ }
147
150
 
148
151
  if (e.error!=null) {
149
- msg+=" (failed with "+e.error+")";
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) {