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.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -3
  3. data/CHANGELOG.md +10 -0
  4. data/Makefile +19 -0
  5. data/README.md +0 -3
  6. data/Rakefile +22 -17
  7. data/TODO.md +0 -23
  8. data/app/.csscomb.json +304 -0
  9. data/app/.eslintignore +3 -0
  10. data/app/.eslintrc +265 -0
  11. data/app/config/preprocessor.js +19 -0
  12. data/app/config/webpack.js +124 -0
  13. data/app/gulpfile.js +96 -0
  14. data/app/package.json +86 -0
  15. data/app/src/actions.js +550 -0
  16. data/app/src/app.js +83 -0
  17. data/app/src/clients/audit.js +34 -0
  18. data/app/src/clients/auth.js +24 -0
  19. data/app/src/clients/generic.js +52 -0
  20. data/app/src/clients/graph.js +7 -0
  21. data/app/src/clients/layer_members.js +18 -0
  22. data/app/src/clients/list.js +31 -0
  23. data/app/src/clients/members.js +20 -0
  24. data/app/src/clients/request.js +531 -0
  25. data/app/src/clients/search.js +5 -0
  26. data/app/src/components/app/__tests__/app-test.js +22 -0
  27. data/app/src/components/app/app.js +36 -0
  28. data/app/src/components/app/wrapper.js +17 -0
  29. data/app/src/components/audit/__tests__/table_header-test.js +22 -0
  30. data/app/src/components/audit/box.js +9 -0
  31. data/app/src/components/audit/constants.js +5 -0
  32. data/app/src/components/audit/entry.js +105 -0
  33. data/app/src/components/audit/fields_mixin.js +11 -0
  34. data/app/src/components/audit/humanize_event.js +213 -0
  35. data/app/src/components/audit/table.js +64 -0
  36. data/app/src/components/audit/table_header.js +37 -0
  37. data/app/src/components/audit/timestamp.js +28 -0
  38. data/app/src/components/auth/login.js +177 -0
  39. data/app/src/components/auth/login.less +71 -0
  40. data/app/src/components/auth/logout.js +42 -0
  41. data/app/src/components/auth/logout.less +21 -0
  42. data/app/src/components/chart/chart.js +540 -0
  43. data/app/src/components/chart/chart_helper_mixin.js +78 -0
  44. data/app/src/components/custom/list.js +3 -0
  45. data/app/src/components/custom/view.js +81 -0
  46. data/app/src/components/dashboard/activity.js +144 -0
  47. data/app/src/components/dashboard/dashboard.js +46 -0
  48. data/app/src/components/flash/flash.js +98 -0
  49. data/app/src/components/flash/flash.less +3 -0
  50. data/app/src/components/generic/__tests__/time-test.js +42 -0
  51. data/app/src/components/generic/annotations.js +39 -0
  52. data/app/src/components/generic/breadcrumbs.js +57 -0
  53. data/app/src/components/generic/foldable_audit_section.js +204 -0
  54. data/app/src/components/generic/list.js +141 -0
  55. data/app/src/components/generic/list_factory.js +41 -0
  56. data/app/src/components/generic/resource_link.js +64 -0
  57. data/app/src/components/generic/role_link.js +66 -0
  58. data/app/src/components/generic/tab_mixin.js +146 -0
  59. data/app/src/components/generic/time.js +32 -0
  60. data/app/src/components/graph/__tests__/collapse-test.js +133 -0
  61. data/app/src/components/graph/__tests__/edges-from-vertices-test.js +48 -0
  62. data/app/src/components/graph/__tests__/new-vertex-set-test.js +16 -0
  63. data/app/src/components/graph/__tests__/next-id-test.js +27 -0
  64. data/app/src/components/graph/__tests__/role-kind-from-id-test.js +24 -0
  65. data/app/src/components/graph/__tests__/vertices-from-edges-test.js +72 -0
  66. data/app/src/components/graph/graph.js +449 -0
  67. data/app/src/components/graph/graph.less +39 -0
  68. data/app/src/components/graph/helpers.js +368 -0
  69. data/app/src/components/group/list.js +3 -0
  70. data/app/src/components/group/view.js +153 -0
  71. data/app/src/components/host/activity.js +111 -0
  72. data/app/src/components/host/details.js +28 -0
  73. data/app/src/components/host/executors.js +77 -0
  74. data/app/src/components/host/host_link.js +18 -0
  75. data/app/src/components/host/list.js +3 -0
  76. data/app/src/components/host/updaters.js +77 -0
  77. data/app/src/components/host/view.js +145 -0
  78. data/app/src/components/layer/list.js +3 -0
  79. data/app/src/components/layer/view.js +197 -0
  80. data/app/src/components/navbar/__tests__/navbar-test.js +21 -0
  81. data/app/src/components/navbar/nav_search_form.js +40 -0
  82. data/app/src/components/navbar/navbar.js +96 -0
  83. data/app/src/components/notfound/notfound.js +35 -0
  84. data/app/src/components/notfound/notfound.less +21 -0
  85. data/app/src/components/owned_resources/owned_resources.js +84 -0
  86. data/app/src/components/owned_resources/owned_resources_box.js +101 -0
  87. data/app/src/components/permissions/permissions.js +138 -0
  88. data/app/src/components/permissions/permissions_table.js +101 -0
  89. data/app/src/components/policy/list.js +3 -0
  90. data/app/src/components/policy/view.js +107 -0
  91. data/app/src/components/refresh/refresh.js +29 -0
  92. data/app/src/components/refresh/refresh.less +15 -0
  93. data/app/src/components/search/group.js +43 -0
  94. data/app/src/components/search/group_heading.js +50 -0
  95. data/app/src/components/search/group_title.js +37 -0
  96. data/app/src/components/search/result_item.js +55 -0
  97. data/app/src/components/search/search.js +118 -0
  98. data/app/src/components/user/activity.js +112 -0
  99. data/app/src/components/user/details.js +30 -0
  100. data/app/src/components/user/list.js +3 -0
  101. data/app/src/components/user/pubkeys.js +118 -0
  102. data/app/src/components/user/pubkeys.less +56 -0
  103. data/app/src/components/user/view.js +143 -0
  104. data/app/src/components/variable/activity.js +101 -0
  105. data/app/src/components/variable/details.js +46 -0
  106. data/app/src/components/variable/fetchers.js +77 -0
  107. data/app/src/components/variable/list.js +3 -0
  108. data/app/src/components/variable/updaters.js +77 -0
  109. data/app/src/components/variable/view.js +115 -0
  110. data/app/src/constants.js +36 -0
  111. data/{public → app/src}/images/conjur-logo.svg +0 -0
  112. data/{public → app/src}/images/icon-client-pc.svg +0 -0
  113. data/{public → app/src}/images/icon-environment.png +0 -0
  114. data/{public → app/src}/images/icon-person.svg +0 -0
  115. data/{public → app/src}/images/icon-policy.png +0 -0
  116. data/{public → app/src}/images/icon-resource.png +0 -0
  117. data/{public → app/src}/images/icon-service-dots.svg +0 -0
  118. data/{public → app/src}/images/icon-variable.png +0 -0
  119. data/app/src/pages/index.html +27 -0
  120. data/app/src/routes.js +64 -0
  121. data/app/src/stores/app_store.js +35 -0
  122. data/app/src/stores/audit_store.js +143 -0
  123. data/app/src/stores/graph_store.js +51 -0
  124. data/app/src/stores/group_store.js +104 -0
  125. data/app/src/stores/host_store.js +111 -0
  126. data/app/src/stores/layer_store.js +115 -0
  127. data/app/src/stores/policy_store.js +88 -0
  128. data/app/src/stores/resources_store.js +115 -0
  129. data/app/src/stores/route_store.js +21 -0
  130. data/app/src/stores/search_store.js +77 -0
  131. data/app/src/stores/user_store.js +109 -0
  132. data/app/src/stores/variable_store.js +93 -0
  133. data/app/src/styles/bootstrap.less +54 -0
  134. data/{public/css → app/src/styles}/styles.less +26 -82
  135. data/app/src/utils.js +38 -0
  136. data/app/src/vendor/pace.js +2 -0
  137. data/conjur-asset-ui.gemspec +3 -4
  138. data/docker/assets-build/Dockerfile +12 -0
  139. data/docker/conjur-ui/Dockerfile +33 -0
  140. data/docker/conjur-ui/README.md +38 -0
  141. data/docker/conjur-ui/mime.types +90 -0
  142. data/docker/conjur-ui/nginx.conf +110 -0
  143. data/docker/conjur-ui/start.py +72 -0
  144. data/docker/conjur-ui/start.sh +18 -0
  145. data/docker/conjur-ui/test.env +8 -0
  146. data/lib/conjur-asset-ui-version.rb +1 -1
  147. data/lib/conjur/command/ui.rb +10 -2
  148. data/lib/conjur/webserver/home.rb +3 -3
  149. data/lib/conjur/webserver/login.rb +1 -1
  150. data/lib/conjur/webserver/server.rb +16 -4
  151. data/public/js/views/roleGraph.js +91 -0
  152. metadata +167 -105
  153. data/.jshintrc +0 -41
  154. data/bower.json +0 -98
  155. data/gulpfile.js +0 -139
  156. data/package.json +0 -47
  157. data/preprocessor.js +0 -7
  158. data/public/_client_libs.html +0 -9
  159. data/public/index.html.erb +0 -63
  160. data/public/js/init.js +0 -196
  161. data/public/js/lib/pace.js +0 -2
  162. data/public/js/lib/sorted-set.no-require.js +0 -1145
  163. data/public/js/lib/sorted-set.no-require.js.txt +0 -6
  164. data/public/js/models/groupRecord.js +0 -72
  165. data/public/js/models/hostRecord.js +0 -60
  166. data/public/js/models/layerRecord.js +0 -79
  167. data/public/js/models/namespace.js +0 -12
  168. data/public/js/models/policyList.js +0 -16
  169. data/public/js/models/policyRecord.js +0 -54
  170. data/public/js/models/record.js +0 -117
  171. data/public/js/models/resourceList.js +0 -87
  172. data/public/js/models/userList.js +0 -25
  173. data/public/js/models/userRecord.js +0 -75
  174. data/public/js/models/variableList.js +0 -27
  175. data/public/js/models/variableRecord.js +0 -77
  176. data/public/js/routers.js +0 -242
  177. data/public/js/views/annotations.js +0 -47
  178. data/public/js/views/audit.js +0 -369
  179. data/public/js/views/breadcrumbs.js +0 -62
  180. data/public/js/views/chart.js +0 -617
  181. data/public/js/views/dashboard.js +0 -146
  182. data/public/js/views/generic.js +0 -122
  183. data/public/js/views/group.js +0 -109
  184. data/public/js/views/groups.js +0 -26
  185. data/public/js/views/host.js +0 -200
  186. data/public/js/views/hosts.js +0 -26
  187. data/public/js/views/layer.js +0 -146
  188. data/public/js/views/layers.js +0 -26
  189. data/public/js/views/mixins/search.js +0 -22
  190. data/public/js/views/mixins/tabs.js +0 -154
  191. data/public/js/views/namespaces.js +0 -40
  192. data/public/js/views/navSearch.js +0 -36
  193. data/public/js/views/owned.js +0 -184
  194. data/public/js/views/permissions.js +0 -254
  195. data/public/js/views/policies.js +0 -26
  196. data/public/js/views/policy.js +0 -70
  197. data/public/js/views/resource.js +0 -59
  198. data/public/js/views/role.js +0 -63
  199. data/public/js/views/searchResults.js +0 -212
  200. data/public/js/views/sections.js +0 -226
  201. data/public/js/views/time.js +0 -39
  202. data/public/js/views/user.js +0 -297
  203. data/public/js/views/users.js +0 -26
  204. data/public/js/views/variable.js +0 -310
  205. data/public/js/views/variables.js +0 -26
  206. data/spec/javascripts/helpers/.gitkeep +0 -0
  207. data/spec/javascripts/support/jasmine.yml +0 -112
  208. data/spec/javascripts/support/jasmine_helper.rb +0 -22
  209. data/spec/javascripts/support/run.html.erb +0 -23
  210. data/spec/javascripts/views/AuditSpec.js +0 -22
  211. data/spec/javascripts/views/AuditSpec.ls +0 -18
@@ -1,25 +0,0 @@
1
- /* global conjur */
2
-
3
- (function(conjur) {
4
- 'use strict';
5
-
6
- this.UserList = function() {
7
- var options = {
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
- }
16
- }
17
- };
18
-
19
- return conjur.models.ResourceList('user', options);
20
- };
21
-
22
- }).bind(conjur.models)
23
- (
24
- conjur
25
- );
@@ -1,75 +0,0 @@
1
- /* global conjur, jQuery, async */
2
-
3
- (function(conjur, $, async, errback) {
4
- 'use strict';
5
-
6
- var Generic = this.Generic;
7
-
8
- var User = this.User = function(args) {
9
- if (!(this instanceof User)) {
10
- return new User(args);
11
- }
12
-
13
- var superArguments = Array.prototype.slice.call(arguments);
14
- superArguments.unshift('user');
15
- Generic.apply(this, superArguments);
16
-
17
- return undefined;
18
- };
19
-
20
- User.prototype = Object.create(Generic.prototype);
21
- User.prototype.constructor = User;
22
-
23
- User.prototype.publicKeys = function(callback) {
24
- $.ajax({
25
- url: '/api/pubkeys/' + window.encodeURIComponent(this.id),
26
- success: function(data) {
27
- callback(null, data.split('\n').filter(function(d) {
28
- return d.trim().length > 0;
29
- }));
30
- },
31
- error: callback
32
- });
33
- };
34
-
35
- User.prototype.fetch = function(callback, customErrback) {
36
- var self = this;
37
-
38
- if (typeof(customErrback) === 'undefined') {
39
- customErrback = errback; // reset to default
40
- }
41
-
42
- async.parallel([
43
- this.attributes.bind(this),
44
- this.ownedResources.bind(this),
45
- this.allRoles.bind(this),
46
- this.resource.bind(this),
47
- this.publicKeys.bind(this),
48
- this.auditRole.bind(this),
49
- this.auditResource.bind(this)
50
- ], function(err, results) {
51
- if (err) {
52
- return customErrback(err.status);
53
- }
54
-
55
- callback({
56
- user: results[0],
57
- owned: results[1],
58
- roles: results[2],
59
- owner: results[3].owner,
60
- annotations: results[3].annotations,
61
- pubkeys: results[4],
62
- audit: self.mergeAudit(results[5], results[6])
63
- });
64
-
65
- return undefined;
66
- });
67
- };
68
-
69
- }).bind(conjur.models.Record)
70
- (
71
- conjur,
72
- jQuery,
73
- async,
74
- conjur.utils.errback
75
- );
@@ -1,27 +0,0 @@
1
- /* global conjur */
2
-
3
- (function(conjur) {
4
- 'use strict';
5
-
6
- this.VariableList = function() {
7
- var options = {
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
- }
16
- }
17
- };
18
-
19
- var list = conjur.models.ResourceList('variable', options);
20
-
21
- return list;
22
- };
23
-
24
- }).bind(conjur.models)
25
- (
26
- conjur
27
- );
@@ -1,77 +0,0 @@
1
- /* global conjur, jQuery, async */
2
-
3
- (function(conjur, $, async, errback) {
4
- 'use strict';
5
-
6
- var Generic = this.Generic;
7
-
8
- var Variable = this.Variable = function(args) {
9
- if (!(this instanceof Variable)) {
10
- return new Variable(args);
11
- }
12
-
13
- var superArguments = Array.prototype.slice.call(arguments);
14
- superArguments.unshift('variable');
15
- Generic.apply(this, superArguments);
16
-
17
- return undefined;
18
- };
19
-
20
- Variable.prototype = Object.create(Generic.prototype);
21
- Variable.prototype.constructor = Variable;
22
-
23
- Variable.prototype.fetch = function(callback, customErrback) {
24
- var id = this.id;
25
-
26
- if (typeof(customErrback) === 'undefined') {
27
- customErrback = errback; // reset to default
28
- }
29
-
30
- function members(privilege) {
31
- return function(cb) {
32
- $.ajax({
33
- url: '/api/authz/' +
34
- conjur.app.configuration.account +
35
- '/roles/allowed_to/' +
36
- privilege +
37
- '/variable/' +
38
- window.encodeURIComponent(id),
39
- success: function(result) {
40
- cb(null, result);
41
- },
42
- error: cb
43
- });
44
- };
45
- }
46
-
47
- async.parallel([
48
- this.attributes.bind(this),
49
- members('execute'),
50
- members('update'),
51
- this.resource.bind(this),
52
- this.auditResource.bind(this)
53
- ], function(err, results) {
54
- if (err) {
55
- return customErrback(err.status);
56
- }
57
-
58
- callback({
59
- variable: results[0],
60
- fetchers: results[1],
61
- updaters: results[2],
62
- owner: results[3].owner,
63
- annotations: results[3].annotations,
64
- audit: results[4]
65
- });
66
-
67
- return undefined;
68
- });
69
- };
70
-
71
- }).bind(conjur.models.Record)
72
- (
73
- conjur,
74
- jQuery,
75
- async,
76
- conjur.utils.errback
77
- );
@@ -1,242 +0,0 @@
1
- /** @jsx React.DOM */
2
- /* global conjur, jQuery, _, Backbone, React */
3
-
4
-
5
- (function(conjur, $, _, Backbone, React) {
6
- 'use strict';
7
-
8
- var Dashboard = conjur.views.Dashboard,
9
- GroupBox = conjur.views.GroupBox,
10
- LayerBox = conjur.views.LayerBox,
11
- PolicyBox = conjur.views.PolicyBox,
12
- VariableBox = conjur.views.VariableBox,
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;
21
-
22
- conjur.Workspace = Backbone.Router.extend({
23
- routes: {
24
- '': 'dashboard',
25
- 'ui': 'dashboard',
26
- 'ui/users': 'users',
27
- 'ui/users/:user': 'user',
28
- 'ui/groups': 'groups',
29
- 'ui/groups/:group': 'group',
30
- 'ui/hosts': 'hosts',
31
- 'ui/hosts/:host': 'host',
32
- 'ui/layers': 'layers',
33
- 'ui/layers/:layer': 'layer',
34
- 'ui/variables': 'variables',
35
- 'ui/variables/:variable': 'variable',
36
- 'ui/policies': 'policies',
37
- 'ui/policies/:policy': 'policy',
38
- 'ui/audit': 'audit',
39
- 'ui/search/:search': 'search'
40
- },
41
-
42
- activateList: function(componentFunction) {
43
- /* console.log('List', kind); */
44
- this.setActiveNav(conjur.app.kind);
45
- conjur.app.namespace.currentNamespace = '';
46
-
47
- conjur.app.lists[conjur.app.kind].fetch(function(list) {
48
- var component = componentFunction(list);
49
- // doesn't make much sense due to
50
- // http://stackoverflow.com/questions/24889934/componentinstance-setstate-undefined-in-0-11-0
51
- //components[kind] = component;
52
-
53
- React.renderComponent(
54
- component,
55
- document.getElementById('content')
56
- );
57
-
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)});
63
- });
64
- },
65
-
66
- activateRecord: function(k, id, componentFunction) {
67
- conjur.app.kind = conjur.utils.pluralize(k);
68
- this.setActiveNav(conjur.app.kind);
69
-
70
- var model;
71
- var Record = conjur.models.Record;
72
-
73
- if (Record[_.capitalize(k)]) {
74
- model = new Record[_.capitalize(k)](id);
75
- } else {
76
- model = new Record.Generic(conjur.app.kind, id);
77
- }
78
-
79
- model.fetch(function(record) {
80
- var component = componentFunction(record);
81
-
82
- React.renderComponent(
83
- component,
84
- document.getElementById('content')
85
- );
86
- }, function(status, text) {
87
- if (status === 403) {
88
- conjur.app.flash = 'You are not authorized to view ' +
89
- conjur.app.kind + ':' + id + '.';
90
-
91
- window.history.back();
92
- } else {
93
- console.error('HTTP error: ', status, text);
94
- }
95
- });
96
- },
97
-
98
- setActiveNav: function(name) {
99
- $('.nav-item').removeClass('active');
100
- $('#nav-' + name).addClass('active');
101
- },
102
-
103
- dashboard: function() {
104
- React.renderComponent(
105
- <Dashboard />,
106
- document.getElementById('content')
107
- );
108
- },
109
-
110
- user: function(user) {
111
- this.activateRecord('user', user, function(record) {
112
- return (
113
- <User data={record}/>
114
- );
115
- });
116
- },
117
-
118
- users: function() {
119
- conjur.app.kind = 'users';
120
-
121
- this.activateList(function(list) {
122
- return (
123
- <UserBox data={{namespaces: list.namespaces, members: list.members('')}} />
124
- );
125
- });
126
- },
127
-
128
- group: function(group) {
129
- this.activateRecord('group', group, function(record) {
130
- return (
131
- <Group data={record} />
132
- );
133
- });
134
- },
135
-
136
- groups: function() {
137
- conjur.app.kind = 'groups';
138
-
139
- this.activateList(function(list) {
140
- return (
141
- <GroupBox data={{namespaces: list.namespaces, members: list.members('')}} />
142
- );
143
- });
144
- },
145
-
146
- host: function(host) {
147
- this.activateRecord('host', host, function(record) {
148
- return (
149
- <Host data={record}/>
150
- );
151
- });
152
- },
153
-
154
- hosts: function() {
155
- conjur.app.kind = 'hosts';
156
- var HostBox = conjur.views.HostBox;
157
-
158
- this.activateList(function(list) {
159
- return (
160
- <HostBox data={{namespaces: list.namespaces, members: list.members('')}} />
161
- );
162
- });
163
- },
164
-
165
- layer: function(layer) {
166
- this.activateRecord('layer', layer, function(record) {
167
- return (
168
- <Layer data={record} />
169
- );
170
- });
171
- },
172
-
173
- layers: function() {
174
- conjur.app.kind = 'layers';
175
-
176
- this.activateList(function(list) {
177
- return (
178
- <LayerBox data={{namespaces: list.namespaces, members: list.members('')}} />
179
- );
180
- });
181
- },
182
-
183
- variable: function(variable) {
184
- this.activateRecord('variable', variable, function(record) {
185
- return (
186
- <Variable data={record} />
187
- );
188
- });
189
- },
190
-
191
- variables: function() {
192
- conjur.app.kind = 'variables';
193
-
194
- this.activateList(function(list) {
195
- return (
196
- <VariableBox data={{namespaces: list.namespaces, members: list.members('')}} />
197
- );
198
- });
199
- },
200
-
201
- policies: function() {
202
- conjur.app.kind = 'policies';
203
-
204
- this.activateList(function(list) {
205
- return (
206
- <PolicyBox data={{members: list.members('')}} />
207
- );
208
- });
209
- },
210
-
211
- policy: function(policy) {
212
- this.activateRecord('policy', policy, function(record) {
213
- return (
214
- <Policy data={record} />
215
- );
216
- });
217
- },
218
-
219
- audit: function() {
220
- this.setActiveNav('audit');
221
-
222
- var GlobalAudit = window.GlobalAudit;
223
-
224
- React.renderComponent(
225
- <GlobalAudit/>,
226
- document.getElementById('content')
227
- );
228
- },
229
-
230
- search: function(search) {
231
- SearchResults.search(search);
232
- }
233
- });
234
-
235
- })
236
- (
237
- conjur,
238
- jQuery,
239
- _,
240
- Backbone,
241
- React
242
- );