conjur-asset-ui 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -3
  3. data/Gemfile +1 -3
  4. data/README.md +0 -34
  5. data/Rakefile +1 -69
  6. data/conjur-asset-ui.gemspec +1 -1
  7. data/lib/conjur-asset-ui-version.rb +1 -1
  8. data/lib/conjur/command/ui.rb +1 -1
  9. data/lib/conjur/webserver/server.rb +8 -14
  10. data/public/_client_code.html +42 -0
  11. data/public/_client_libs.html +15 -2
  12. data/public/css/bootstrap.css +7 -0
  13. data/public/css/styles.less +4 -170
  14. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  15. data/public/fonts/glyphicons-halflings-regular.svg +229 -0
  16. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  17. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  18. data/public/index.html.erb +7 -5
  19. data/public/js/init.js +97 -183
  20. data/public/js/lib/JSXTransformer.js +10862 -0
  21. data/public/js/lib/async.js +958 -0
  22. data/public/js/lib/backbone.js +2 -0
  23. data/public/js/lib/bootstrap.js +6 -0
  24. data/public/js/lib/less.js +16 -0
  25. data/public/js/lib/moment.js +7768 -0
  26. data/public/js/lib/react-bootstrap.js +5346 -0
  27. data/public/js/lib/react-bootstrap.min.js +4 -0
  28. data/public/js/lib/sorted-set.no-require.js +28 -3
  29. data/public/js/lib/underscore-min.js +6 -0
  30. data/public/js/lib/underscore.string.min.js +1 -0
  31. data/public/js/main.js +57 -0
  32. data/public/js/models/groupRecord.js +11 -12
  33. data/public/js/models/hostRecord.js +7 -6
  34. data/public/js/models/layerRecord.js +11 -12
  35. data/public/js/models/namespace.js +0 -2
  36. data/public/js/models/policyList.js +1 -3
  37. data/public/js/models/policyRecord.js +7 -6
  38. data/public/js/models/record.js +23 -24
  39. data/public/js/models/resourceList.js +10 -28
  40. data/public/js/models/userList.js +2 -7
  41. data/public/js/models/userRecord.js +8 -7
  42. data/public/js/models/variableList.js +7 -18
  43. data/public/js/models/variableRecord.js +12 -13
  44. data/public/js/routers.js +26 -72
  45. data/public/js/views/annotations.js +27 -38
  46. data/public/js/views/audit.js +17 -23
  47. data/public/js/views/dashboard.js +58 -94
  48. data/public/js/views/generic.js +9 -16
  49. data/public/js/views/group.js +55 -94
  50. data/public/js/views/groups.js +7 -3
  51. data/public/js/views/host.js +44 -75
  52. data/public/js/views/hosts.js +6 -2
  53. data/public/js/views/layer.js +82 -127
  54. data/public/js/views/layers.js +6 -2
  55. data/public/js/views/mixins/search.js +5 -12
  56. data/public/js/views/mixins/tabs.js +55 -95
  57. data/public/js/views/navSearch.js +5 -16
  58. data/public/js/views/owned.js +8 -14
  59. data/public/js/views/permissions.js +178 -244
  60. data/public/js/views/policies.js +4 -2
  61. data/public/js/views/policy.js +38 -65
  62. data/public/js/views/resource.js +34 -49
  63. data/public/js/views/role.js +37 -52
  64. data/public/js/views/searchResults.js +138 -205
  65. data/public/js/views/time.js +13 -26
  66. data/public/js/views/user.js +55 -178
  67. data/public/js/views/users.js +7 -2
  68. data/public/js/views/variable.js +45 -226
  69. data/public/js/views/variables.js +8 -4
  70. metadata +19 -18
  71. data/.jshintrc +0 -41
  72. data/bower.json +0 -93
  73. data/features/navigation_bar.feature +0 -31
  74. data/features/step_definitions/custom_step.rb +0 -32
  75. data/features/support/env.rb +0 -38
  76. data/features/support/hooks.rb +0 -30
  77. data/features/support/world.rb +0 -17
  78. data/gulpfile.js +0 -140
  79. data/package.json +0 -47
  80. data/preprocessor.js +0 -7
  81. data/public/js/views/chart.js +0 -471
@@ -1,13 +1,17 @@
1
1
  /** @jsx React.DOM */
2
- /* global conjur, React */
3
2
 
4
3
  (function(conjur, React) {
5
4
  'use strict';
6
5
 
7
6
  var GenericList = conjur.views.GenericList;
8
7
 
9
- this.HostBox = React.createClass({
8
+ var HostBox = this.HostBox = React.createClass({
9
+ /*getInitialState: function() {
10
+ return { currentNamespace: "", members: [] };
11
+ },*/
10
12
  render: function() {
13
+ //<NamespaceFilter currentNamespace={this.props.currentNamespace}
14
+ //namespaces={this.props.data.namespaces} />
11
15
  return (
12
16
  <div className="hostBox">
13
17
  <div className="hostList">
@@ -1,137 +1,92 @@
1
1
  /** @jsx React.DOM */
2
- /* global conjur, React, ReactBootstrap, _ */
3
2
 
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
- RoleLink = conjur.views.RoleLink,
12
- HostLink = conjur.views.HostLink;
13
-
14
- var abstractRole = function(expected) {
15
- return function(role) {
16
- var tokens = role.split(':'),
17
- kind = tokens[1],
18
- abstractKinds = ['@', 'layer'],
19
- isAbstract = abstractKinds.indexOf(kind) !== -1;
20
-
21
- return isAbstract === expected;
22
- };
23
- };
24
-
25
- this.Layer = React.createClass({
26
- mixins: [Tab],
27
-
28
- render: function() {
29
- var data = this.props.data;
30
-
31
- var hosts = data.layer.hosts.map(function(host) {
32
- return (
33
- <li className="list-group-item list-group-item-noborder">
34
- <HostLink data={host} />
35
- </li>
36
- );
37
- });
38
-
39
- var admins = data.admins.filter(abstractRole(false)).map(function(role) {
40
- return (
41
- <li className="list-group-item list-group-item-noborder">
42
- <RoleLink id={role}/>
43
- </li>
44
- );
45
- });
46
-
47
- var users = data.users.filter(abstractRole(false)).map(function(role) {
48
- return (
49
- <li className="list-group-item list-group-item-noborder">
50
- <RoleLink id={role}/>
51
- </li>
52
- );
53
- });
54
-
55
- // TODO: controls to add/remove admins/users/hosts
56
- var overviewTab = (
57
- <TabPane key="overview" tab="Overview">
58
- <dl className="dl-horizontal">
59
- <dt>Owner</dt>
60
- <dd><RoleLink id={data.layer.ownerid} /></dd>
61
-
62
- <dt>Created by</dt>
63
- <dd><RoleLink id={data.layer.userid} /></dd>
64
- </dl>
65
- </TabPane>
66
- );
67
-
68
- var adminsTab = (
69
- <TabPane key="admins" tab={conjur.utils.getTabname('Admins', admins)}>
70
- <ul className="list-group">
71
- {admins}
72
- </ul>
73
- </TabPane>
74
- );
75
-
76
- var usersTab = (
77
- <TabPane key="users" tab={conjur.utils.getTabname('Users', users)}>
3
+ var Layer = React.createClass({
4
+ mixins: [conjur.views.mixins.Tab],
5
+ render: function() {
6
+ function abstractRole(expected) {
7
+ return function(role) {
8
+ var tokens = role.split(':');
9
+ var kind = tokens[1];
10
+ var abstractKinds = [ '@', 'layer' ];
11
+ var isAbstract = abstractKinds.indexOf(kind) !== -1;
12
+ return isAbstract === expected;
13
+ }
14
+ }
15
+
16
+ var layer = this.props.data.layer;
17
+
18
+ var hosts = layer.hosts.map(function (host) {
19
+ return <li className="list-group-item list-group-item-noborder">
20
+ <HostLink data={host} />
21
+ </li>
22
+ }.bind(this));
23
+ var admins = this.props.data.admins.filter(abstractRole(false)).map(function (role) {
24
+ return <li className="list-group-item list-group-item-noborder">
25
+ <RoleLink id={role}/>
26
+ </li>;
27
+ }.bind(this));
28
+ var users = this.props.data.users.filter(abstractRole(false)).map(function (role) {
29
+ return <li className="list-group-item list-group-item-noborder">
30
+ <RoleLink id={role}/>
31
+ </li>;
32
+ }.bind(this));
33
+
34
+
35
+ // TODO: controls to add/remove admins/users/hosts
36
+ var overview_tab =
37
+ <TabPane key="overview" tab="Overview">
38
+ <dl className="dl-horizontal">
39
+ <dt>Owner</dt>
40
+ <dd><RoleLink id={layer.ownerid}/></dd>
41
+ <dt>Created by</dt>
42
+ <dd><RoleLink id={layer.userid}/></dd>
43
+ </dl>
44
+ </TabPane>;
45
+ var admins_tab =
46
+ <TabPane key="admins" tab={get_tabname("Admins",admins)}>
47
+ <ul className="list-group">
48
+ {admins}
49
+ </ul>
50
+ </TabPane> ;
51
+ var users_tab =
52
+ <TabPane key="users" tab={ get_tabname("Users", users) } >
78
53
  <ul className="list-group">
79
54
  {users}
80
55
  </ul>
81
- </TabPane>
82
- );
83
-
84
- var hostsTab = (
85
- <TabPane key="hosts" tab={conjur.utils.getTabname('Hosts', hosts)}>
56
+ </TabPane>;
57
+ var hosts_tab =
58
+ <TabPane key="hosts" tab={ get_tabname("Hosts", hosts) } >
86
59
  <ul className="list-group">
87
60
  {hosts}
88
61
  </ul>
89
- </TabPane>
90
- );
91
-
92
- var auditTab = (
93
- <TabPane key="audit" tab="Recent Activity">
62
+ </TabPane>;
63
+ var audit_tab=
64
+ <TabPane key="audit" tab="Recent Activity">
94
65
  <div className="audit auditGroup">
95
- <AuditBox roles={[data.layer.roleid]}
96
- resources={[data.layer.resource_identifier]}
97
- tabview={true} />
66
+ <AuditBox roles={[layer.roleid]} resources={[layer.resource_identifier]} tabview={true} />
98
67
  </div>
99
- </TabPane>
100
- );
101
-
102
-
103
- var permissionsTab = this.permissionsTab(data.layer.roleid),
104
- membershipsTab = this.membershipsTab(data.layer.roleid),
105
- annotationsTab = this.annotationsTab(),
106
- ownedTab = this.ownedTab();
107
-
108
- var tabs = _.compact([
109
- overviewTab,
110
- adminsTab,
111
- usersTab,
112
- hostsTab,
113
- ownedTab,
114
- membershipsTab,
115
- permissionsTab,
116
- annotationsTab,
117
- auditTab
118
- ]);
119
-
120
- return (
121
- <div className="layer">
122
- <h2>Layer {data.layer.id}</h2>
123
- <TabbedArea defaultActiveKey="overview">
124
- {tabs}
125
- </TabbedArea>
126
- </div>
127
- );
128
- }
129
- });
130
-
131
- }).bind(conjur.views)
132
- (
133
- conjur,
134
- React,
135
- ReactBootstrap,
136
- _
137
- );
68
+ </TabPane>;
69
+
70
+
71
+ var permissions_tab = this.permissions_tab(layer.roleid);
72
+ var memberships_tab = this.memberships_tab(layer.roleid);
73
+ var annotations_tab = this.annotations_tab();
74
+ var owned_tab = this.owned_tab();
75
+
76
+ var tabs = _.compact( [overview_tab, admins_tab, users_tab, hosts_tab,
77
+ owned_tab, memberships_tab, permissions_tab,
78
+ annotations_tab,
79
+ audit_tab
80
+ ] );
81
+
82
+ return (
83
+ <div className="layer">
84
+ <h2>Layer {layer.id}</h2>
85
+
86
+ <TabbedArea defaultActiveKey="overview">
87
+ {tabs}
88
+ </TabbedArea>
89
+ </div>
90
+ );
91
+ }
92
+ });
@@ -1,13 +1,17 @@
1
1
  /** @jsx React.DOM */
2
- /* global conjur, React */
3
2
 
4
3
  (function(conjur, React) {
5
4
  'use strict';
6
5
 
7
6
  var GenericList = conjur.views.GenericList;
8
7
 
9
- this.LayerBox = React.createClass({
8
+ var LayerBox = this.LayerBox = React.createClass({
9
+ /* getInitialState: function() {
10
+ return { currentNamespace: "", members: [] };
11
+ }, */
10
12
  render: function() {
13
+ // <NamespaceFilter currentNamespace={this.props.currentNamespace}
14
+ // namespaces={this.props.data.namespaces} />
11
15
  return (
12
16
  <div className="layerBox">
13
17
  <div className="layerList">
@@ -1,22 +1,15 @@
1
- /* global conjur */
2
-
3
1
  (function(conjur) {
4
2
  'use strict';
5
3
 
6
- this.Search = {
7
- handleSubmit: function() {
4
+ conjur.views.mixins.Search = {
5
+ handleSubmit: function(e) {
8
6
  var search = this.refs.input.getDOMNode().value;
9
7
 
10
- if (search && search.length !== 0) {
11
- conjur.app.router.navigate('/ui/search/' + window.encodeURIComponent(search),
12
- {trigger: true});
8
+ if (search && search.length != 0) {
9
+ conjur.app.router.navigate('/ui/search/' + encodeURIComponent(search), {trigger: true});
13
10
  }
14
11
 
15
12
  return false;
16
13
  }
17
14
  };
18
-
19
- }).bind(conjur.views.mixins)
20
- (
21
- conjur
22
- );
15
+ })(conjur);
@@ -1,45 +1,40 @@
1
1
  /** @jsx React.DOM */
2
- /* global conjur, React, ReactBootstrap, _ */
3
2
 
4
- (function(conjur, React, ReactBootstrap, _) {
3
+ (function(conjur, ReactBootstrap) {
5
4
  'use strict';
6
5
 
7
- var TabPane = ReactBootstrap.TabPane,
8
- OwnedResources = conjur.views.OwnedResources,
9
- RoleLink = conjur.views.RoleLink,
10
- AnnotationsBox = conjur.views.AnnotationsBox,
11
- Permissions = conjur.views.Permissions;
6
+ var TabbedArea = ReactBootstrap.TabbedArea,
7
+ TabPane = ReactBootstrap.TabPane,
8
+ OwnedResources = conjur.views.OwnedResources;
12
9
 
13
10
  // we can't create custom TabPanes as components,
14
11
  // because they won't be recognized by TabbedArea as tabs
15
12
  // that's why we just generalize their constructors
16
- this.Tab = {
17
- containsOwnedItems: function() {
18
- return (
19
- this.props.data.owned &&
20
- this.props.data.owned.length &&
21
- this.props.data.owned.length > 0
22
- );
13
+ conjur.views.mixins.Tab = {
14
+ lexical_sorter: function(a,b) {
15
+
16
+ },
17
+
18
+ contains_owned_items: function() {
19
+ return (this.props.data.owned && this.props.data.owned.length && this.props.data.owned.length > 0 );
23
20
  },
24
21
 
25
- ownedIds: function() {
26
- if (this.containsOwnedItems()) {
27
- return this.props.data.owned.map(function(ownedItem) {
28
- return ownedItem.id;
22
+ owned_ids: function() {
23
+ if (this.contains_owned_items()) {
24
+ return this.props.data.owned.map(function(owned_item) {
25
+ return owned_item.id;
29
26
  });
30
27
  }
31
28
 
32
29
  return [];
33
30
  },
34
31
 
35
- ownedTab: function() {
36
- if (this.containsOwnedItems()) {
37
- var result = (
38
- <TabPane key="owned"
39
- tab={conjur.utils.getTabname('Owned resources', this.props.data.owned)}>
40
- <OwnedResources owned={this.props.data.owned} tabview={true} />
41
- </TabPane>
42
- );
32
+ owned_tab: function() {
33
+ if (this.contains_owned_items()) {
34
+ var result =
35
+ <TabPane key="owned" tab={get_tabname("Owned resources",this.props.data.owned)}>
36
+ <OwnedResources owned={this.props.data.owned} tabview={true} />
37
+ </TabPane>;
43
38
 
44
39
  return result;
45
40
  }
@@ -47,108 +42,73 @@
47
42
  return null;
48
43
  },
49
44
 
50
- containsNontrivialRoles: function() {
51
- return (
52
- this.props.data.roles &&
53
- this.props.data.roles.length &&
54
- this.props.data.roles.length > 1
55
- );
45
+ contains_nontrivial_roles: function() {
46
+ return (this.props.data.roles && this.props.data.roles.length && this.props.data.roles.length>1);
56
47
  },
57
48
 
58
- externalRoles: function(ownId) {
59
- if (!this.containsNontrivialRoles()) {
49
+ external_roles: function( own_id ) {
50
+ if (!this.contains_nontrivial_roles()) {
60
51
  return [];
61
52
  }
62
53
 
63
- var ownedIds = this.ownedIds();
54
+ var owned_ids = this.owned_ids();
64
55
 
65
56
  return this.props.data.roles.filter(function(roleid) {
66
57
  // do not show themself
67
- return roleid !== ownId;
58
+ return roleid!=own_id;
68
59
  }).filter(function(roleid) {
69
60
  // do not show internal roles
70
- return roleid.split(':')[1] !== '@';
61
+ return ! (roleid.split(':')[1]=='@') ;
71
62
  }).filter(function(roleid) {
72
63
  // do not show owned groups
73
- return ! _.contains(ownedIds, roleid);
64
+ return ! _.contains(owned_ids, roleid);
74
65
  });
75
66
  },
76
67
 
77
- membershipsTab: function(ownId) {
78
- if (!this.containsNontrivialRoles()) {
68
+ memberships_tab: function( own_id ) {
69
+ if (!this.contains_nontrivial_roles()) {
79
70
  return null;
80
71
  }
81
72
 
82
- var membershipLinks = this.externalRoles(ownId)
83
- .sort(function(a, b) {
84
- return a.toLowerCase().localeCompare(b.toLowerCase());
85
- })
86
- .map(function(roleid) {
87
- return (
88
- <li className="list-group-item list-group-item-noborder">
89
- <RoleLink id={roleid} />
90
- </li>
91
- );
92
- });
93
-
94
- if (membershipLinks.length === 0) {
95
- return null;
96
- }
73
+ var membership_links = this.external_roles(own_id)
74
+ .sort( function(a,b) { return a.toLowerCase().localeCompare(b.toLowerCase());} )
75
+ .map ( function(roleid) { return <li className="list-group-item list-group-item-noborder"><RoleLink id={roleid}/></li> });
76
+
77
+ if (membership_links.length==0) { return null; }
97
78
 
98
- var result = (
99
- <TabPane key="memberships"
100
- tab={conjur.utils.getTabname('Explicit memberships', membershipLinks)}>
101
- <ul className="list-group">
102
- {membershipLinks}
103
- </ul>
104
- </TabPane>
105
- );
79
+ var result =
80
+ <TabPane key="memberships" tab={get_tabname("Explicit memberships", membership_links)}>
81
+ <ul className="list-group">{membership_links}</ul>
82
+ </TabPane>;
106
83
 
107
84
  return result;
108
- },
85
+ } ,
109
86
 
110
- containsAnnotations: function() {
111
- return (
112
- this.props.data.annotations &&
113
- this.props.data.annotations.length &&
114
- this.props.data.annotations.length > 0
115
- );
87
+ contains_annotations: function() {
88
+ return (this.props.data.annotations && this.props.data.annotations.length && this.props.data.annotations.length>0);
116
89
  },
117
90
 
118
- annotationsTab: function() {
119
- if (!this.containsAnnotations()) {
91
+ annotations_tab: function() {
92
+ if (!this.contains_annotations()) {
120
93
  return null;
121
94
  }
122
95
 
123
- var result = (
124
- <TabPane key="annotations"
125
- tab={conjur.utils.getTabname('Annotations', this.props.data.annotations)}>
126
- <AnnotationsBox annotations={this.props.data.annotations} />
127
- </TabPane>
128
- );
96
+ var result =
97
+ <TabPane key="annotations" tab={get_tabname("Annotations",this.props.data.annotations)}>
98
+ <AnnotationsBox annotations={this.props.data.annotations}/>
99
+ </TabPane>;
129
100
 
130
101
  return result;
131
102
  },
132
103
 
133
- permissionsTab: function(roleid) {
134
- var result = (
135
- <TabPane key="permissions" tab="Permissions held">
136
- <Permissions owned={this.props.data.owned}
137
- roles={this.props.data.roles}
138
- role={roleid}
139
- tabview={true} />
140
- </TabPane>
141
- );
104
+ permissions_tab: function(roleid) {
105
+ var result =
106
+ <TabPane key="permissions" tab="Permissions held">
107
+ <Permissions owned={this.props.data.owned} roles={this.props.data.roles} role={roleid} tabview={true}/>
108
+ </TabPane>;
142
109
 
143
110
  return result;
144
111
  }
145
112
 
146
113
  };
147
-
148
- }).bind(conjur.views.mixins)
149
- (
150
- conjur,
151
- React,
152
- ReactBootstrap,
153
- _
154
- );
114
+ })(conjur, ReactBootstrap);