conjur-asset-ui 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,103 +1,67 @@
1
1
  /**@jsx React.DOM*/
2
- /* global conjur, React, jQuery */
3
2
 
4
- (function(conjur, React, $) {
5
- 'use strict';
3
+ var DashboardSearchForm = React.createClass({
4
+ mixins: [ conjur.views.mixins.Search ],
6
5
 
7
- var OwnedResourcesBox = conjur.views.OwnedResourcesBox,
8
- Search = conjur.views.mixins.Search;
6
+ render: function() {
7
+ return (
8
+ <form id="dashboard-search" className="form-inline search" role="search" onSubmit={this.handleSubmit}>
9
+ <div className="form-group">
10
+ <input ref="input" type="text" className="form-control" placeholder="Search Conjur" value={this.props.searchText}>
11
+ </input>
12
+ </div>
13
+ <button type="submit" className="btn btn-default search-button">Search</button>
14
+ </form>
15
+ );
16
+ }
17
+ });
9
18
 
10
- var DashboardSearchForm = React.createClass({
11
- mixins: [Search],
19
+ var DashboardFrequent = React.createClass({
20
+ getInitialState: function() {
21
+ return {resources: [], loaded: false}
22
+ },
12
23
 
13
- render: function() {
14
- return (
15
- <form id="dashboard-search"
16
- className="form-inline search"
17
- role="search"
18
- onSubmit={this.handleSubmit}>
19
- <div className="form-group">
20
- <input ref="input"
21
- type="text"
22
- className="form-control"
23
- placeholder="Search Conjur"
24
- value={this.props.searchText} />
25
- </div>
26
- <button type="submit" className="btn btn-default search-button">
27
- Search
28
- </button>
29
- </form>
30
- );
31
- }
32
- });
24
+ componentWillMount: function() {
25
+ $.get("/api/authz/" + conjur.app.configuration.account + "/resources?owner=" + encodeURIComponent(conjur.app.userId), function(data) {
26
+ var filtered_data = data.filter( function(item) {
27
+ return item.id.split(':')[1]!="secret"; // assets of 'secret' kind are internal
28
+ });
29
+ this.setState({resources: filtered_data, loaded: true});
30
+ }.bind(this));
31
+ },
33
32
 
34
- var DashboardFrequent = React.createClass({
35
- getInitialState: function() {
36
- return {resources: [], loaded: false};
37
- },
33
+ render: function() {
34
+ var content,
35
+ OwnedResourcesBox = conjur.views.OwnedResourcesBox;
38
36
 
39
- componentWillMount: function() {
40
- $.get('/api/authz/' +
41
- conjur.app.configuration.account +
42
- '/resources?owner=' +
43
- encodeURIComponent(conjur.app.userId),
44
- function(data) {
45
- var filteredData = data.filter(function(item) {
46
- // assets of 'secret' kind are internal
47
- return item.id.split(':')[1] !== 'secret';
48
- });
37
+ if (this.state.loaded)
38
+ content = <OwnedResourcesBox resources={this.state.resources} />
39
+ else
40
+ content = <span>Loading...</span>
49
41
 
50
- this.setState({resources: filteredData, loaded: true});
51
- }.bind(this));
52
- },
42
+ return <section>
43
+ <h3>Owned assets</h3>
44
+ {content}
45
+ </section>;
46
+ }
47
+ });
53
48
 
54
- render: function() {
55
- var content;
56
-
57
- if (this.state.loaded) {
58
- content = (
59
- <OwnedResourcesBox resources={this.state.resources} />
60
- );
61
- } else {
62
- content = (
63
- <span>Loading...</span>
64
- );
65
- }
66
-
67
- return (
68
- <section>
69
- <h3>Owned assets</h3>
70
- {content}
71
- </section>
72
- );
73
- }
74
- });
75
-
76
- this.Dashboard = React.createClass({
77
- render: function() {
78
- var AuditTable = window.AuditTable;
79
-
80
- return (
81
- <div className="dashboard">
82
- <div className="row">
83
- <DashboardSearchForm />
84
- </div>
85
- <div className="row summary">
86
- <div className="col-xs-6">
87
- <DashboardFrequent />
88
- </div>
89
- <div className="col-xs-6 audit">
90
- <AuditTable src={'/api/audit/all'} caption={'Recent activity'} compact={true}/>
91
- </div>
92
- </div>
93
- </div>
94
- );
95
- }
96
- });
97
-
98
- }).bind(conjur.views)
99
- (
100
- conjur,
101
- React,
102
- jQuery
103
- );
49
+ var Dashboard = React.createClass({
50
+ render: function(){
51
+ return (
52
+ <div className="dashboard">
53
+ <div className="row">
54
+ <DashboardSearchForm />
55
+ </div>
56
+ <div className="row summary">
57
+ <div className="col-xs-6">
58
+ <DashboardFrequent />
59
+ </div>
60
+ <div className="col-xs-6 audit">
61
+ <AuditTable src={'/api/audit/all'} caption={'Recent activity'} compact={true}/>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ );
66
+ }
67
+ });
@@ -1,17 +1,14 @@
1
1
  /** @jsx React.DOM */
2
- /* global conjur, React, _ */
3
2
 
4
- (function(conjur, React, _) {
3
+ (function(conjur, React) {
5
4
  'use strict';
6
5
 
7
- var RoleLink = conjur.views.RoleLink;
8
-
9
6
  var GenericListItem = React.createClass({
10
7
  render: function() {
11
- var recordUrl = '/ui/' +
12
- this.props.data.kind +
13
- '/' +
14
- window.encodeURIComponent(this.props.data.record.identifier);
8
+ var recordUrl = '/ui/'
9
+ + this.props.data.kind
10
+ + '/'
11
+ + window.encodeURIComponent(this.props.data.record.identifier);
15
12
 
16
13
  return (
17
14
  <tr>
@@ -28,7 +25,7 @@
28
25
  }
29
26
  });
30
27
 
31
- this.GenericList = React.createClass({
28
+ var GenericList = this.GenericList = React.createClass({
32
29
  getInitialState: function() {
33
30
  return {
34
31
  sort: {
@@ -56,7 +53,7 @@
56
53
 
57
54
  var order = (this.state.sort.order === 'asc') ? 'desc' : 'asc';
58
55
 
59
- if (this.state.sort.column !== column) {
56
+ if (this.state.sort.column != column) {
60
57
  order = this.state.columns[column].defaultSortOrder;
61
58
  }
62
59
 
@@ -77,10 +74,7 @@
77
74
  });
78
75
 
79
76
  items = _.sortBy(items, this.state.sort.column);
80
-
81
- if (this.state.sort.order === 'desc') {
82
- items.reverse();
83
- }
77
+ if (this.state.sort.order === 'desc') items.reverse();
84
78
 
85
79
  var rows = items.map(function (o) {
86
80
  var componentName = _.str.capitalize(
@@ -117,6 +111,5 @@
117
111
  }).bind(conjur.views)
118
112
  (
119
113
  conjur,
120
- React,
121
- _
114
+ React
122
115
  );
@@ -1,100 +1,61 @@
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
-
13
- this.Group = React.createClass({
14
- mixins: [Tab],
15
-
16
- render: function() {
17
- var data = this.props.data;
18
-
19
- var members = data.members.map(function(member) {
20
- return (
21
- <li className="list-group-item list-group-item-noborder">
22
- <RoleLink id={member.member} />
23
- </li>
24
- );
25
- });
26
-
27
- var resourceId = [
28
- conjur.app.configuration.account,
29
- 'group',
30
- data.group.id
31
- ].join(':');
32
-
33
- var group = data.group;
34
-
35
- // TODO: refactor (common code should go to mixins)
36
- // TODO: memberships
37
- // TODO: controls for members management
38
- var overviewTab =(
39
- <TabPane key="overview" tab="Overview">
3
+ var Group = React.createClass({
4
+ mixins: [conjur.views.mixins.Tab],
5
+ render: function() {
6
+ var members = this.props.data.members.map(function (member) {
7
+ return <li className="list-group-item list-group-item-noborder">
8
+ <RoleLink id={member.member} />
9
+ </li>
10
+ }.bind(this));
11
+ var resourceId = [ conjur.app.configuration.account, 'group', this.props.data.group.id ].join(':')
12
+ var group = this.props.data.group;
13
+
14
+
15
+ // TODO: refactor (common code should go to mixins)
16
+ // TODO: memberships
17
+ // TODO: controls for members management
18
+ var overview_tab =
19
+ <TabPane key="overview" tab="Overview">
40
20
  <dl className="dl-horizontal">
41
21
  <dt>Created by</dt>
42
- <dd><RoleLink id={group.userid} /></dd>
43
-
22
+ <dd><RoleLink id={group.userid}/></dd>
44
23
  <dt>Owner</dt>
45
- <dd><RoleLink id={data.group.ownerid} /></dd>
24
+ <dd><RoleLink id={this.props.data.group.ownerid}/></dd>
46
25
  </dl>
47
- </TabPane>
48
- );
49
-
50
- var membersTab = (
51
- <TabPane key="members" tab={conjur.utils.getTabname('Members', members)}>
52
- <ul className="list-group">
53
- {members}
54
- </ul>
55
- </TabPane>
56
- );
57
-
58
- var ownedTab = this.ownedTab(),
59
- membershipsTab = this.membershipsTab(group.roleid),
60
- permissionsTab = this.permissionsTab(group.roleid),
61
- annotationsTab = this.annotationsTab();
62
-
63
- var auditTab = (
64
- <TabPane key="audit" tab="Recent Activity">
65
- <div className="audit auditGroup">
66
- <AuditBox roles={[resourceId]}
67
- resources={[resourceId]}
68
- tabview={true} />
69
- </div>
70
- </TabPane>
71
- );
72
-
73
- var tabs = _.compact([
74
- overviewTab,
75
- membersTab,
76
- ownedTab,
77
- membershipsTab,
78
- permissionsTab,
79
- annotationsTab,
80
- auditTab
81
- ]);
82
-
83
- return (
84
- <div className="group">
85
- <h2>Group {data.group.id}</h2>
86
- <TabbedArea defaultActiveKey="overview">
87
- {tabs}
88
- </TabbedArea>
89
- </div>
90
- );
91
- }
92
- });
93
-
94
- }).bind(conjur.views)
95
- (
96
- conjur,
97
- React,
98
- ReactBootstrap,
99
- _
100
- );
26
+ </TabPane>;
27
+ var members_tab =
28
+ <TabPane key="members" tab={get_tabname("Members",members)}>
29
+ <ul className="list-group">
30
+ {members}
31
+ </ul>
32
+ </TabPane>;
33
+ var owned_tab = this.owned_tab();
34
+ var memberships_tab = this.memberships_tab(group.roleid);
35
+ var permissions_tab = this.permissions_tab(group.roleid);
36
+ var annotations_tab = this.annotations_tab();
37
+
38
+ var audit_tab =
39
+ <TabPane key="audit" tab="Recent Activity">
40
+ <div className="audit auditGroup">
41
+ <AuditBox roles={[resourceId]} resources={[resourceId]} tabview={true}/>
42
+ </div>
43
+ </TabPane>;
44
+
45
+ <TabPane key="annotations" tab={get_tabname("Annotations",this.props.data.annotations)}>
46
+ <AnnotationsBox annotations={this.props.data.annotations}/>
47
+ </TabPane>;
48
+
49
+ var tabs = _.compact([overview_tab, members_tab, owned_tab, memberships_tab,
50
+ permissions_tab, annotations_tab, audit_tab]);
51
+
52
+ return (
53
+ <div className="group">
54
+ <h2>Group {this.props.data.group.id}</h2>
55
+ <TabbedArea defaultActiveKey="overview">
56
+ {tabs}
57
+ </TabbedArea>
58
+ </div>
59
+ );
60
+ }
61
+ });
@@ -1,18 +1,22 @@
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.GroupBox = React.createClass({
8
+ var GroupBox = this.GroupBox = 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="groupBox">
13
17
  <div className="groupList">
14
18
  <h2>Groups</h2>
15
- <GenericList data={{kind: 'groups', members: this.props.data.members}} />
19
+ <GenericList data={{kind: "groups", members: this.props.data.members}} />
16
20
  </div>
17
21
  </div>
18
22
  );
@@ -1,95 +1,64 @@
1
1
  /** @jsx React.DOM */
2
- /* global conjur, React, ReactBootstrap, _ */
3
2
 
4
- (function(conjur, React, ReactBootstrap, _) {
5
- 'use strict';
3
+ var HostLink = React.createClass({
4
+ hostId : function() {
5
+ return this.props.data.split(':')[2];
6
+ },
6
7
 
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
- Time = conjur.views.Time;
8
+ hostUrl: function() {
9
+ return "/ui/hosts/" + encodeURIComponent(this.hostId());
10
+ },
13
11
 
14
- this.HostLink = React.createClass({
15
- hostId : function() {
16
- return this.props.data.split(':')[2];
17
- },
12
+ render: function() {
13
+ return (
14
+ <a href={this.hostUrl()}>
15
+ {this.hostId()}
16
+ </a>
17
+ );
18
+ }
19
+ });
18
20
 
19
- hostUrl: function() {
20
- return '/ui/hosts/' + window.encodeURIComponent(this.hostId());
21
- },
21
+ var Host = React.createClass({
22
+ mixins: [conjur.views.mixins.Tab],
23
+ render: function(){
24
+ var host = this.props.data.host;
22
25
 
23
- render: function() {
24
- return (
25
- <a href={this.hostUrl()}>
26
- {this.hostId()}
27
- </a>
28
- );
29
- }
30
- });
31
-
32
- this.Host = React.createClass({
33
- mixins: [Tab],
34
-
35
- render: function() {
36
- var host = this.props.data.host;
37
-
38
- // TODO: control for 'enroll'
39
- var overviewTab = (
40
- <TabPane key="overview" tab="Overview">
26
+ // TODO: control for 'enroll'
27
+ var overview_tab =
28
+ <TabPane key="overview" tab="Overview">
41
29
  <dl className="dl-horizontal">
42
30
  <dt> Owner </dt>
43
31
  <dd> <RoleLink id={host.ownerid}/> </dd>
44
-
45
32
  <dt>Created by</dt>
46
33
  <dd><RoleLink id={host.userid}/></dd>
47
-
48
34
  <dt> Created At </dt>
49
35
  <dd> <Time timestamp={host.created_at}/> </dd>
50
36
  </dl>
51
- </TabPane>
52
- );
37
+ </TabPane>;
53
38
 
54
- var permissionsTab = this.permissionsTab(host.roleid),
55
- membershipsTab = this.membershipsTab(host.roleid),
56
- annotationsTab = this.annotationsTab(),
57
- ownedTab = this.ownedTab();
39
+ var permissions_tab = this.permissions_tab(host.roleid);
40
+ var memberships_tab = this.memberships_tab(host.roleid);
41
+ var annotations_tab = this.annotations_tab();
42
+ var owned_tab = this.owned_tab();
58
43
 
59
- var auditTab = (
60
- <TabPane key="audit" tab="Recent Activity">
44
+ var audit_tab =
45
+ <TabPane key="audit" tab="Recent Activity">
61
46
  <div className="audit auditHost">
62
- <AuditBox roles={[host.roleid]}
63
- resources={[host.resource_identifier]}
64
- tabview={true} />
47
+ <AuditBox roles={[host.roleid]} resources={[host.resource_identifier]} tabview={true}/>
65
48
  </div>
66
- </TabPane>
67
- );
68
-
69
- var tabs = _.compact([
70
- overviewTab,
71
- ownedTab,
72
- membershipsTab,
73
- permissionsTab,
74
- annotationsTab,
75
- auditTab
76
- ]);
49
+ </TabPane>;
77
50
 
78
- return (
79
- <div className="host">
80
- <h2> Host {host.id} </h2>
81
- <TabbedArea defaultActiveKey="overview">
82
- {tabs}
83
- </TabbedArea>
84
- </div>
85
- );
86
- }
87
- });
51
+ var tabs = _.compact([ overview_tab, owned_tab, memberships_tab,
52
+ permissions_tab, annotations_tab, audit_tab
53
+ ]);
88
54
 
89
- }).bind(conjur.views)
90
- (
91
- conjur,
92
- React,
93
- ReactBootstrap,
94
- _
95
- );
55
+ return (
56
+ <div className="host">
57
+ <h2> Host {host.id} </h2>
58
+ <TabbedArea defaultActiveKey="overview">
59
+ {tabs}
60
+ </TabbedArea>
61
+ </div>
62
+ );
63
+ }
64
+ })