conjur-asset-ui 1.3.0 → 1.3.1

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 +3 -1
  3. data/.jshintrc +41 -0
  4. data/Gemfile +3 -1
  5. data/README.md +34 -0
  6. data/Rakefile +69 -1
  7. data/bower.json +93 -0
  8. data/conjur-asset-ui.gemspec +1 -1
  9. data/features/navigation_bar.feature +31 -0
  10. data/features/step_definitions/custom_step.rb +32 -0
  11. data/features/support/env.rb +38 -0
  12. data/features/support/hooks.rb +30 -0
  13. data/features/support/world.rb +17 -0
  14. data/gulpfile.js +140 -0
  15. data/lib/conjur/command/ui.rb +1 -1
  16. data/lib/conjur/webserver/server.rb +14 -9
  17. data/lib/conjur-asset-ui-version.rb +1 -1
  18. data/package.json +47 -0
  19. data/preprocessor.js +7 -0
  20. data/public/_client_libs.html +2 -15
  21. data/public/css/styles.less +170 -4
  22. data/public/index.html.erb +5 -7
  23. data/public/js/init.js +183 -97
  24. data/public/js/lib/sorted-set.no-require.js +3 -28
  25. data/public/js/models/groupRecord.js +12 -11
  26. data/public/js/models/hostRecord.js +6 -7
  27. data/public/js/models/layerRecord.js +12 -11
  28. data/public/js/models/namespace.js +2 -0
  29. data/public/js/models/policyList.js +3 -1
  30. data/public/js/models/policyRecord.js +6 -7
  31. data/public/js/models/record.js +24 -23
  32. data/public/js/models/resourceList.js +28 -10
  33. data/public/js/models/userList.js +7 -2
  34. data/public/js/models/userRecord.js +7 -8
  35. data/public/js/models/variableList.js +18 -7
  36. data/public/js/models/variableRecord.js +13 -12
  37. data/public/js/routers.js +72 -26
  38. data/public/js/views/annotations.js +38 -27
  39. data/public/js/views/audit.js +23 -17
  40. data/public/js/views/chart.js +471 -0
  41. data/public/js/views/dashboard.js +94 -58
  42. data/public/js/views/generic.js +16 -9
  43. data/public/js/views/group.js +94 -55
  44. data/public/js/views/groups.js +3 -7
  45. data/public/js/views/host.js +75 -44
  46. data/public/js/views/hosts.js +2 -6
  47. data/public/js/views/layer.js +127 -82
  48. data/public/js/views/layers.js +2 -6
  49. data/public/js/views/mixins/search.js +12 -5
  50. data/public/js/views/mixins/tabs.js +95 -55
  51. data/public/js/views/navSearch.js +16 -5
  52. data/public/js/views/owned.js +14 -8
  53. data/public/js/views/permissions.js +244 -178
  54. data/public/js/views/policies.js +2 -4
  55. data/public/js/views/policy.js +65 -38
  56. data/public/js/views/resource.js +49 -34
  57. data/public/js/views/role.js +52 -37
  58. data/public/js/views/searchResults.js +205 -138
  59. data/public/js/views/time.js +26 -13
  60. data/public/js/views/user.js +178 -55
  61. data/public/js/views/users.js +2 -7
  62. data/public/js/views/variable.js +226 -45
  63. data/public/js/views/variables.js +4 -8
  64. metadata +20 -20
  65. data/public/_client_code.html +0 -42
  66. data/public/css/bootstrap.css +0 -7
  67. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  68. data/public/fonts/glyphicons-halflings-regular.svg +0 -229
  69. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  70. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  71. data/public/js/lib/JSXTransformer.js +0 -10862
  72. data/public/js/lib/async.js +0 -958
  73. data/public/js/lib/backbone.js +0 -2
  74. data/public/js/lib/bootstrap.js +0 -6
  75. data/public/js/lib/less.js +0 -16
  76. data/public/js/lib/moment.js +0 -7768
  77. data/public/js/lib/react-bootstrap.js +0 -5346
  78. data/public/js/lib/react-bootstrap.min.js +0 -4
  79. data/public/js/lib/underscore-min.js +0 -6
  80. data/public/js/lib/underscore.string.min.js +0 -1
  81. data/public/js/main.js +0 -57
@@ -1,3 +1,5 @@
1
+ /* global conjur, jQuery, async */
2
+
1
3
  (function(conjur, $, async, errback) {
2
4
  'use strict';
3
5
 
@@ -18,12 +20,11 @@
18
20
  Group.prototype = Object.create(Generic.prototype);
19
21
  Group.prototype.constructor = Group;
20
22
 
21
- Group.prototype.fetch = function(callback, custom_errback) {
22
- var self = this,
23
- id = this.id;
23
+ Group.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
  async.parallel([
@@ -31,11 +32,11 @@
31
32
  this.ownedResources.bind(this),
32
33
  function(cb) {
33
34
  $.ajax({
34
- url: '/api/authz/'
35
- + conjur.app.configuration.account
36
- + '/roles/group/'
37
- + id
38
- + '?members',
35
+ url: '/api/authz/' +
36
+ conjur.app.configuration.account +
37
+ '/roles/group/' +
38
+ id +
39
+ '?members',
39
40
  success: function(result) {
40
41
  cb(null, result);
41
42
  },
@@ -46,7 +47,7 @@
46
47
  this.resource.bind(this)
47
48
  ], function(err, results) {
48
49
  if (err) {
49
- return custom_errback(err.status);
50
+ return customErrback(err.status);
50
51
  }
51
52
 
52
53
  callback({
@@ -1,3 +1,5 @@
1
+ /* global conjur, async */
2
+
1
3
  (function(conjur, async, errback) {
2
4
  'use strict';
3
5
 
@@ -18,12 +20,9 @@
18
20
  Host.prototype = Object.create(Generic.prototype);
19
21
  Host.prototype.constructor = Host;
20
22
 
21
- Host.prototype.fetch = function(callback, custom_errback) {
22
- var self = this,
23
- id = this.id;
24
-
25
- if (typeof(custom_errback) === 'undefined') {
26
- custom_errback = errback; // reset to default
23
+ Host.prototype.fetch = function(callback, customErrback) {
24
+ if (typeof(customErrback) === 'undefined') {
25
+ customErrback = errback; // reset to default
27
26
  }
28
27
 
29
28
  async.parallel([
@@ -33,7 +32,7 @@
33
32
  this.resource.bind(this)
34
33
  ], function(err, results) {
35
34
  if (err) {
36
- return custom_errback(err.status);
35
+ return customErrback(err.status);
37
36
  }
38
37
 
39
38
  callback({
@@ -1,3 +1,5 @@
1
+ /* global conjur, jQuery, _, async */
2
+
1
3
  (function(conjur, $, _, async, errback) {
2
4
  'use strict';
3
5
 
@@ -18,22 +20,21 @@
18
20
  Layer.prototype = Object.create(Generic.prototype);
19
21
  Layer.prototype.constructor = Layer;
20
22
 
21
- Layer.prototype.fetch = function(callback, custom_errback) {
22
- var self = this,
23
- id = this.id;
23
+ Layer.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(role) {
30
31
  return function(cb) {
31
32
  $.ajax({
32
- url: '/api/authz/'
33
- + conjur.app.configuration.account
34
- + '/roles/'
35
- + role
36
- + '?members',
33
+ url: '/api/authz/' +
34
+ conjur.app.configuration.account +
35
+ '/roles/' +
36
+ role +
37
+ '?members',
37
38
  success: function(result) {
38
39
  cb(null, result);
39
40
  },
@@ -51,7 +52,7 @@
51
52
  this.resource.bind(this)
52
53
  ], function(err, results) {
53
54
  if (err) {
54
- return custom_errback(err.status);
55
+ return customErrback(err.status);
55
56
  }
56
57
 
57
58
  callback({
@@ -1,3 +1,5 @@
1
+ /* global conjur */
2
+
1
3
  (function(conjur) {
2
4
  'use strict';
3
5
 
@@ -1,9 +1,11 @@
1
+ /* global conjur */
2
+
1
3
  (function(conjur) {
2
4
  'use strict';
3
5
 
4
6
  conjur.models.PolicyList = function() {
5
7
  var options = {
6
- namespaceSelector: function(member) {
8
+ namespaceSelector: function() {
7
9
  return null;
8
10
  }
9
11
  };
@@ -1,3 +1,5 @@
1
+ /* global conjur, async */
2
+
1
3
  (function(conjur, async, errback) {
2
4
  'use strict';
3
5
 
@@ -18,12 +20,9 @@
18
20
  Policy.prototype = Object.create(Generic.prototype);
19
21
  Policy.prototype.constructor = Policy;
20
22
 
21
- Policy.prototype.fetch = function(callback, custom_errback) {
22
- var self = this,
23
- id = this.id;
24
-
25
- if (typeof(custom_errback) == 'undefined') {
26
- custom_errback = errback; // reset to default
23
+ Policy.prototype.fetch = function(callback, customErrback) {
24
+ if (typeof(customErrback) === 'undefined') {
25
+ customErrback = errback; // reset to default
27
26
  }
28
27
 
29
28
  async.parallel([
@@ -32,7 +31,7 @@
32
31
  this.allRoles.bind(this)
33
32
  ], function(err, results) {
34
33
  if (err) {
35
- return custom_errback(err.status);
34
+ return customErrback(err.status);
36
35
  }
37
36
 
38
37
  callback({
@@ -1,3 +1,5 @@
1
+ /* global conjur, jQuery */
2
+
1
3
  (function(conjur, $, errback) {
2
4
  'use strict';
3
5
 
@@ -19,36 +21,35 @@
19
21
  Generic.prototype.attributes = function(callback) {
20
22
  var id = this.id;
21
23
 
22
- ajax('/api/'
23
- + conjur.utils.pluralize(this.kind)
24
- + '/'
25
- + window.encodeURIComponent(id),
24
+ ajax('/api/'+
25
+ conjur.utils.pluralize(this.kind) +
26
+ '/' +
27
+ window.encodeURIComponent(id),
26
28
  callback);
27
29
  };
28
30
 
29
31
  Generic.prototype.resource = function(callback) {
30
- ajax('/api/authz/'
31
- + conjur.app.configuration.account
32
- + '/resources/'
33
- + this.kind
34
- + '/'
35
- + window.encodeURIComponent(this.id),
32
+ ajax('/api/authz/' +
33
+ conjur.app.configuration.account +
34
+ '/resources/' +
35
+ this.kind +
36
+ '/' +
37
+ window.encodeURIComponent(this.id),
36
38
  callback);
37
39
  };
38
40
 
39
41
  Generic.prototype.ownedResources = function(callback) {
40
- var id = this.id;
41
42
  var roleid = [this.kind, this.id].join(':');
42
43
 
43
- ajax('/api/authz/'
44
- + conjur.app.configuration.account
45
- + '/resources?owner='
46
- + roleid,
44
+ ajax('/api/authz/' +
45
+ conjur.app.configuration.account +
46
+ '/resources?owner=' +
47
+ roleid,
47
48
  function(err, result) {
48
49
  if (typeof result.filter === 'function') {
49
50
  result = result.filter(function(item) {
50
51
  // assets of 'secret' kind are internal
51
- return item.id.split(':')[1] != 'secret';
52
+ return item.id.split(':')[1] !== 'secret';
52
53
  });
53
54
  }
54
55
 
@@ -57,13 +58,13 @@
57
58
  };
58
59
 
59
60
  Generic.prototype.allRoles = function(callback) {
60
- ajax('/api/authz/'
61
- + conjur.app.configuration.account
62
- + '/roles/'
63
- + window.encodeURIComponent(this.kind)
64
- + '/'
65
- + window.encodeURIComponent(this.id)
66
- + '?all',
61
+ ajax('/api/authz/' +
62
+ conjur.app.configuration.account +
63
+ '/roles/' +
64
+ window.encodeURIComponent(this.kind) +
65
+ '/' +
66
+ window.encodeURIComponent(this.id) +
67
+ '?all',
67
68
  callback);
68
69
  };
69
70
 
@@ -1,20 +1,23 @@
1
+ /* global conjur, jQuery, _ */
2
+
1
3
  (function(conjur, $, _) {
2
4
  'use strict';
3
5
 
4
- conjur.models.ResourceList = function(kind, options) {
6
+ this.ResourceList = function(kind, options) {
5
7
  var List = function() {
6
8
  this._members = null;
7
9
  this.namespaces = null;
8
10
  this.options = options || {};
9
11
 
10
- if ( !this.options.idSelector ) {
12
+ if (!this.options.idSelector) {
11
13
  this.options.idSelector = function(member) {
12
14
  var idTokens = member.id.split(':');
15
+
13
16
  return idTokens[idTokens.length-1];
14
17
  };
15
18
  }
16
19
 
17
- if ( !this.options.namespaceSelector ) {
20
+ if (!this.options.namespaceSelector) {
18
21
  this.options.namespaceSelector = function(member) {
19
22
  return member.identifier.split('/')[0];
20
23
  };
@@ -24,7 +27,7 @@
24
27
  List.prototype.members = function(namespace) {
25
28
  var result;
26
29
 
27
- if ( namespace === "" ) {
30
+ if (namespace === '') {
28
31
  result = _.clone(this._members);
29
32
  } else {
30
33
  result = this._members.filter(function(o) {
@@ -38,32 +41,47 @@
38
41
  };
39
42
 
40
43
  List.prototype.fetch = function(callback) {
41
- if ( this._members )
44
+ if (this._members) {
42
45
  return callback(this);
46
+ }
43
47
 
44
48
  var self = this;
45
49
 
46
50
  $.ajax({
47
- url: "/api/authz/" + encodeURIComponent(conjur.app.configuration.account) + "/resources/" + encodeURIComponent(kind),
51
+ url: '/api/authz/' +
52
+ window.encodeURIComponent(conjur.app.configuration.account) +
53
+ '/resources/' +
54
+ window.encodeURIComponent(kind),
48
55
  success: function(data) {
49
- var filter, idSelector;
56
+ var filter = this.options.filter;
50
57
 
51
- if ( filter = this.options.filter ) {
58
+ if (filter) {
52
59
  data = _.filter(data, filter);
53
60
  }
54
61
 
55
62
  self._members = data;
63
+
56
64
  self._members.forEach(function(member) {
57
65
  member.identifier = this.options.idSelector(member);
58
66
  }.bind(this));
59
- self.namespaces = _.unique(self._members.map(this.options.namespaceSelector)).sort();
67
+
68
+ self.namespaces = _.unique(
69
+ self._members.map(this.options.namespaceSelector)
70
+ ).sort();
71
+
60
72
  callback(self);
61
73
  }.bind(this)
62
74
  });
63
75
 
76
+ return undefined;
64
77
  };
65
78
 
66
79
  return new List();
67
80
  };
68
81
 
69
- })(conjur, jQuery, _);
82
+ }).bind(conjur.models)
83
+ (
84
+ conjur,
85
+ jQuery,
86
+ _
87
+ );
@@ -1,7 +1,9 @@
1
+ /* global conjur */
2
+
1
3
  (function(conjur) {
2
4
  'use strict';
3
5
 
4
- conjur.models.UserList = function() {
6
+ this.UserList = function() {
5
7
  var options = {
6
8
  namespaceSelector: function(member) {
7
9
  var idTokens = member.id.split('@');
@@ -17,4 +19,7 @@
17
19
  return conjur.models.ResourceList('user', options);
18
20
  };
19
21
 
20
- })(conjur);
22
+ }).bind(conjur.models)
23
+ (
24
+ conjur
25
+ );
@@ -1,3 +1,5 @@
1
+ /* global conjur, jQuery, async */
2
+
1
3
  (function(conjur, $, async, errback) {
2
4
  'use strict';
3
5
 
@@ -18,7 +20,7 @@
18
20
  User.prototype = Object.create(Generic.prototype);
19
21
  User.prototype.constructor = User;
20
22
 
21
- User.prototype.publicKeys = function(callback, custom_errback) {
23
+ User.prototype.publicKeys = function(callback) {
22
24
  $.ajax({
23
25
  url: '/api/pubkeys/' + window.encodeURIComponent(this.id),
24
26
  success: function(data) {
@@ -30,12 +32,9 @@
30
32
  });
31
33
  };
32
34
 
33
- User.prototype.fetch = function(callback, custom_errback) {
34
- var self = this,
35
- id = this.id;
36
-
37
- if (typeof(custom_errback) === 'undefined') {
38
- custom_errback = errback; // reset to default
35
+ User.prototype.fetch = function(callback, customErrback) {
36
+ if (typeof(customErrback) === 'undefined') {
37
+ customErrback = errback; // reset to default
39
38
  }
40
39
 
41
40
  async.parallel([
@@ -46,7 +45,7 @@
46
45
  this.publicKeys.bind(this)
47
46
  ], function(err, results) {
48
47
  if (err) {
49
- return custom_errback(err.status);
48
+ return customErrback(err.status);
50
49
  }
51
50
 
52
51
  callback({
@@ -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
  },
@@ -50,7 +51,7 @@
50
51
  this.resource.bind(this)
51
52
  ], function(err, results) {
52
53
  if (err) {
53
- return custom_errback(err.status);
54
+ return customErrback(err.status);
54
55
  }
55
56
 
56
57
  callback({