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
@@ -2,15 +2,16 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Conjur UI</title>
5
+ <meta http-equiv="content-type" content="text/html; charset=UTF8">
5
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
7
  <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic' rel='stylesheet' type='text/css'>
7
8
 
8
9
  <script src="/js/lib/pace.js"></script>
9
10
  <!-- Bootstrap -->
10
- <link href="/css/bootstrap.css" rel="stylesheet">
11
+ <link href="/build/css/vendor.css" rel="stylesheet">
11
12
 
12
13
  <!-- Some styles of our own -->
13
- <link href="/css/styles.less" rel="stylesheet/less">
14
+ <link href="/build/css/styles.css" rel="stylesheet">
14
15
 
15
16
  <%= client_libs %>
16
17
  </head>
@@ -20,7 +21,7 @@
20
21
  <div class="navbar-collapse collapse">
21
22
  <ul class="nav navbar-nav">
22
23
  <li id="nav-home" class="nav-item"><a href="/ui">Dashboard</a></li>
23
- <li id="nav-groups" class="dropdown">
24
+ <li class="dropdown">
24
25
  <a class="dropdown-toggle" data-toggle="dropdown" href="#">
25
26
  Directory <span class="caret"></span>
26
27
  </a>
@@ -35,10 +36,12 @@
35
36
  </ul>
36
37
  </li>
37
38
  <li id="nav-policies" class="nav-item"><a href="/ui/policies">Policies</a></li>
38
- <li id="nav-audit" class="nav-item"><a href="/ui/audit">Audit</a></li>
39
+ <!-- disabled until we'll have reliable search/sort support
40
+ <li id="nav-audit" class="nav-item"><a href="/ui/audit">Audit</a></li>
41
+ -->
39
42
  </ul>
40
- <div class="navbar-right" id="inlineSearchContainer">
41
- </div>
43
+ <div class="navbar-right" id="inlineSearchContainer"></div>
44
+ <div class="navbar-right" style="padding-top:14px;padding-right:10px;" id="inlineUserId"></div>
42
45
  </div>
43
46
  </div>
44
47
  <div class="alert alert-danger alert-dismissable" id="flash">
@@ -46,9 +49,8 @@
46
49
  <span class="text"></span>
47
50
  </div>
48
51
  <div id="modal">
49
-
50
- </div>
51
52
 
53
+ </div>
52
54
 
53
55
  <div id="content"></div>
54
56
  <div id="bottom" class="navbar-default">
@@ -56,7 +58,6 @@
56
58
  </div>
57
59
  </div><!-- /.container -->
58
60
 
59
-
60
- <%= client_code %>
61
+ <script src="/build/js/app.min.js"></script>
61
62
  </body>
62
63
  </html>
data/public/js/init.js CHANGED
@@ -1,107 +1,196 @@
1
- window.conjur = {
2
- models: {
3
- Record: {}
4
- },
5
- collections: {},
6
- views: {
7
- mixins: {}
8
- },
9
- routers: {},
10
- createEndpoints: function() {
11
- function genericEndpoint(path) {
12
- return function() {
13
- var i= 0, length = arguments.length;
14
- var localPath = [].concat(path); // clone it
15
-
16
- for(; i < length && _.isString(arguments[i]); i++) {
17
- localPath.push(arguments[i]);
18
- }
1
+ /* global _, Backbone, React, jQuery */
2
+
3
+ (function(_, Backbone, React, $) {
4
+ 'use strict';
5
+
6
+ var conjur = window.conjur = {
7
+ models: {
8
+ Record: {}
9
+ },
10
+ collections: {},
11
+ views: {
12
+ mixins: {}
13
+ },
14
+ routers: {},
15
+ createEndpoints: function() {
16
+ function genericEndpoint(path) {
17
+ return function() {
18
+ var i = 0,
19
+ length = arguments.length,
20
+ localPath = [].concat(path); // clone it
21
+
22
+ for(; i < length && _.isString(arguments[i]); i++) {
23
+ localPath.push(arguments[i]);
24
+ }
25
+
26
+ var pathString = _.flatten(localPath.map(function(p) {
27
+ return p.split('/').map(encodeURIComponent);
28
+ })).join('/');
29
+
30
+ if (i < length) {
31
+ pathString += '?' + $.param(arguments[i]);
32
+ }
33
+
34
+ if (pathString.charAt(0) !== '/') {
35
+ pathString = '/' + pathString;
36
+ }
37
+
38
+ return pathString;
39
+ };
40
+ }
41
+
42
+ conjur.app.endpoints.authz = genericEndpoint(['api/authz',
43
+ conjur.app.configuration.account]);
44
+ conjur.app.endpoints.core = genericEndpoint('api');
45
+ },
46
+ initialize: function() {
47
+ conjur.app.namespace = conjur.models.Namespace();
48
+ conjur.app.lists.groups = new conjur.models.ResourceList('group');
49
+ conjur.app.lists.layers = new conjur.models.ResourceList('layer');
50
+ conjur.app.lists.variables = new conjur.models.VariableList();
51
+ conjur.app.lists.policies = new conjur.models.PolicyList();
52
+ conjur.app.lists.users = new conjur.models.UserList();
53
+ conjur.app.lists.hosts = new conjur.models.ResourceList('host');
19
54
 
20
- var pathString = _.flatten(localPath.map(function(p) {
21
- return p.split('/').map(encodeURIComponent);
22
- })).join("/");
55
+ var cookie = conjur.utils.readCookie('conjur_configuration');
23
56
 
24
- if (i < length) {
25
- pathString += '?' + jQuery.param(arguments[i]);
57
+ conjur.app.configuration = JSON.parse(decodeURIComponent(cookie).replace(/\+/g, ' '));
58
+ conjur.app.userId = decodeURIComponent(conjur.utils.readCookie('conjur_userid'));
59
+
60
+ conjur.createEndpoints();
61
+ }
62
+ };
63
+
64
+ conjur.app = {
65
+ kind: '',
66
+ lists: {
67
+ groups: undefined,
68
+ layers: undefined,
69
+ variables: undefined,
70
+ policies: undefined,
71
+ users: undefined,
72
+ hosts: undefined
73
+ },
74
+ configuration: undefined,
75
+ userId: undefined,
76
+ // components: {},
77
+ router: undefined,
78
+ // globalIds: undefined,
79
+ endpoints: {},
80
+ flash: null
81
+ };
82
+
83
+ conjur.utils = {
84
+ errback: function(err) {
85
+ console.log('error:', err);
86
+ },
87
+ pluralize: function(kind) {
88
+ if (kind[kind.length-1] === 'y') {
89
+ return kind.slice(0, kind.length-1) + 'ies';
90
+ } else if (kind[kind.length - 1] !== 's') {
91
+ return kind + 's';
92
+ } else {
93
+ return kind;
94
+ }
95
+ },
96
+ // http://www.quirksmode.org/js/cookies.html
97
+ readCookie: function(name) {
98
+ var nameEQ = name + '=',
99
+ ca = document.cookie.split(';');
100
+
101
+ for (var i = 0; i < ca.length; i++) {
102
+ var c = ca[i];
103
+
104
+ while (c.charAt(0) === ' ') {
105
+ c = c.substring(1, c.length);
26
106
  }
27
107
 
28
- if (pathString.charAt(0) != '/') {
29
- pathString = '/' + pathString;
108
+ if (c.indexOf(nameEQ) === 0) {
109
+ return c.substring(nameEQ.length, c.length);
30
110
  }
111
+ }
31
112
 
32
- return pathString;
33
- };
34
- }
113
+ return null;
114
+ },
115
+ getTabname: function(header, set) {
116
+ if (!set || !set.length) {
117
+ return header + ' (0)';
118
+ }
35
119
 
36
- conjur.app.endpoints.authz = genericEndpoint(['api/authz', conjur.app.configuration.account]);
37
- conjur.app.endpoints.core = genericEndpoint('api');
38
- },
39
- initialize: function() {
40
- conjur.app.namespace = conjur.models.Namespace();
41
- conjur.app.lists.groups = new conjur.models.ResourceList('group');
42
- conjur.app.lists.layers = new conjur.models.ResourceList('layer');
43
- conjur.app.lists.variables = new conjur.models.VariableList();
44
- conjur.app.lists.policies = new conjur.models.PolicyList();
45
- conjur.app.lists.users = new conjur.models.UserList();
46
- conjur.app.lists.hosts = new conjur.models.ResourceList('host');
47
- conjur.app.configuration = JSON.parse(decodeURIComponent(conjur.utils.readCookie('conjur_configuration')).replace(/\+/g, ' '));
48
- conjur.app.userId = decodeURIComponent(conjur.utils.readCookie('conjur_userid'));
49
-
50
- conjur.createEndpoints();
51
- }
52
- };
53
-
54
- window.conjur.app = {
55
- kind: '',
56
- lists: {
57
- groups: undefined,
58
- layers: undefined,
59
- variables: undefined,
60
- policies: undefined,
61
- users: undefined,
62
- hosts: undefined
63
- },
64
- configuration: undefined,
65
- userId: undefined,
66
- // components: {},
67
- router: undefined,
68
- // globalIds: undefined,
69
- endpoints: {},
70
- flash: null
71
- };
72
-
73
- window.conjur.utils = {
74
- errback: function(err) {
75
- console.log('error:', err);
76
- },
77
- pluralize: function(kind) {
78
- if (kind[kind.length-1] === 'y') {
79
- return kind.slice(0, kind.length-1) + 'ies';
80
- } else if (kind[kind.length - 1] != 's') {
81
- return kind + 's';
82
- } else {
83
- return kind;
120
+ return header + ' (' + set.length + ')';
84
121
  }
85
- },
86
- // http://www.quirksmode.org/js/cookies.html
87
- readCookie: function(name) {
88
- var nameEQ = name + "=";
89
- var ca = document.cookie.split(';');
90
- for (var i = 0; i < ca.length; i++) {
91
- var c = ca[i];
92
- while (c.charAt(0) == ' ')
93
- c = c.substring(1, c.length);
94
- if (c.indexOf(nameEQ) == 0)
95
- return c.substring(nameEQ.length, c.length);
96
- }
97
- return null;
98
- }
99
- };
100
-
101
- function get_tabname(header, set) {
102
- if (!set || !set.length) {
103
- return header + " (0)";
104
122
  };
105
123
 
106
- return header + " ("+set.length+")";
107
- }
124
+ // var components = {};
125
+ // var globalIds;
126
+
127
+ // function updateNamespace(ns) {
128
+ // conjur.app.namespace.currentNamespace = ns;
129
+ // // it won't work with reactjs 11.0 -- state should be set from within component
130
+ // // components[kind].setState({currentNamespace: ns, members: lists[kind].members(ns)});
131
+ // }
132
+
133
+ $(document).ready(function() {
134
+ conjur.initialize();
135
+
136
+ _.mixin(_.str.exports());
137
+ _.mixin({deepExtend: window.underscoreDeepExtend(_)});
138
+
139
+ // Use delegation to avoid initial DOM selection and allow all matching elements to bubble
140
+ $(document).delegate('a', 'click', function(evt) {
141
+ // Get the anchor href and protcol
142
+ var href = $(this).attr('href');
143
+ var protocol = this.protocol + '//';
144
+
145
+ // Ensure the protocol is not part of URL, meaning its relative.
146
+ // Stop the event bubbling to ensure the link will not cause a page refresh.
147
+ if (typeof(href) === 'string' &&
148
+ href.slice(0, protocol.length) !== protocol &&
149
+ href[0] !== '#') {
150
+
151
+ evt.preventDefault();
152
+
153
+ // Note by using Backbone.history.navigate, router events will not be
154
+ // triggered. If this is a problem, change this to navigate on your
155
+ // router.
156
+ Backbone.history.navigate(href, {trigger:true});
157
+ }
158
+ });
159
+
160
+ conjur.app.router = new conjur.Workspace();
161
+
162
+ conjur.app.router.on('all', function(route) {
163
+ console.log('router.all', route, conjur.app.flash);
164
+
165
+ if (route !== 'route') {
166
+ return;
167
+ }
168
+
169
+ if (conjur.app.flash) {
170
+ var old = conjur.app.flash;
171
+ conjur.app.flash = null;
172
+ var $flash = $('#flash');
173
+ var $text = $('.text', $flash);
174
+ $text.text(old);
175
+ $flash.show();
176
+ } else {
177
+ $('#flash').hide();
178
+ }
179
+ });
180
+
181
+ Backbone.history.start({pushState: true});
182
+
183
+ React.renderComponent(conjur.views.NavSearchForm(null),
184
+ document.getElementById('inlineSearchContainer'));
185
+
186
+ React.renderComponent(conjur.views.RoleLink({id: conjur.app.userId}),
187
+ document.getElementById('inlineUserId'));
188
+ });
189
+
190
+ })
191
+ (
192
+ _,
193
+ Backbone,
194
+ React,
195
+ jQuery
196
+ );
@@ -364,9 +364,8 @@ var requirejs, require, define;
364
364
  //If want a value immediately, use require('id') instead -- something
365
365
  //that works in almond on the global level, but not guaranteed and
366
366
  //unlikely to work in other AMD implementations.
367
- setTimeout(function () {
368
- main(undef, deps, callback, relName);
369
- }, 4);
367
+
368
+ main(undef, deps, callback, relName);
370
369
  }
371
370
 
372
371
  return req;
@@ -505,9 +504,6 @@ define("almond", function(){});
505
504
 
506
505
  }).call(this);
507
506
 
508
- /*
509
- //@ sourceMappingURL=AbstractSortedSet.js.map
510
- */;
511
507
  (function() {
512
508
  define('SortedSet/ArrayStrategy',[],function() {
513
509
  var ArrayStrategy, Iterator, binarySearchForIndex;
@@ -631,9 +627,6 @@ define("almond", function(){});
631
627
 
632
628
  }).call(this);
633
629
 
634
- /*
635
- //@ sourceMappingURL=ArrayStrategy.js.map
636
- */;
637
630
  (function() {
638
631
  define('SortedSet/BinaryTreeIterator',[], function() {
639
632
  var BinaryTreeIterator, descendAllTheWay, moveCursor;
@@ -776,9 +769,6 @@ define("almond", function(){});
776
769
 
777
770
  }).call(this);
778
771
 
779
- /*
780
- //@ sourceMappingURL=BinaryTreeIterator.js.map
781
- */;
782
772
  (function() {
783
773
  define('SortedSet/AbstractBinaryTreeStrategy',['./BinaryTreeIterator'], function(BinaryTreeIterator) {
784
774
  var AbstractBinaryTree, binaryTreeTraverse;
@@ -848,9 +838,6 @@ define("almond", function(){});
848
838
 
849
839
  }).call(this);
850
840
 
851
- /*
852
- //@ sourceMappingURL=AbstractBinaryTreeStrategy.js.map
853
- */;
854
841
  (function() {
855
842
  var __hasProp = {}.hasOwnProperty,
856
843
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
@@ -940,9 +927,6 @@ define("almond", function(){});
940
927
 
941
928
  }).call(this);
942
929
 
943
- /*
944
- //@ sourceMappingURL=BinaryTreeStrategy.js.map
945
- */;
946
930
  (function() {
947
931
  var __hasProp = {}.hasOwnProperty,
948
932
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
@@ -1121,9 +1105,6 @@ define("almond", function(){});
1121
1105
 
1122
1106
  }).call(this);
1123
1107
 
1124
- /*
1125
- //@ sourceMappingURL=RedBlackTreeStrategy.js.map
1126
- */;
1127
1108
  (function() {
1128
1109
  var __hasProp = {}.hasOwnProperty,
1129
1110
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
@@ -1153,9 +1134,6 @@ define("almond", function(){});
1153
1134
 
1154
1135
  }).call(this);
1155
1136
 
1156
- /*
1157
- //@ sourceMappingURL=SortedSet.js.map
1158
- */;
1159
1137
  (function() {
1160
1138
  require(['./SortedSet'], function(SortedSet) {
1161
1139
  return window.SortedSet = SortedSet;
@@ -1163,8 +1141,5 @@ define("almond", function(){});
1163
1141
 
1164
1142
  }).call(this);
1165
1143
 
1166
- /*
1167
- //@ sourceMappingURL=index.js.map
1168
- */;
1169
1144
  define("index", function(){});
1170
- }());
1145
+ }());
@@ -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({
@@ -54,7 +55,8 @@
54
55
  owned: results[1],
55
56
  members: results[2],
56
57
  roles: results[3],
57
- annotations: results[4].annotations
58
+ annotations: results[4].annotations,
59
+ owner: results[4].owner
58
60
  });
59
61
 
60
62
  return undefined;