Show More
@@ -1130,10 +1130,10 b' class UserApiKeys(Base, BaseModel):' | |||||
1130 |
|
1130 | |||
1131 | def _get_scope(self): |
|
1131 | def _get_scope(self): | |
1132 | if self.repo: |
|
1132 | if self.repo: | |
1133 |
return |
|
1133 | return 'Repository: {}'.format(self.repo.repo_name) | |
1134 | if self.repo_group: |
|
1134 | if self.repo_group: | |
1135 | return repr(self.repo_group) + ' (recursive)' |
|
1135 | return 'RepositoryGroup: {} (recursive)'.format(self.repo_group.group_name) | |
1136 |
return ' |
|
1136 | return 'Global' | |
1137 |
|
1137 | |||
1138 | @property |
|
1138 | @property | |
1139 | def scope_humanized(self): |
|
1139 | def scope_humanized(self): |
@@ -5,31 +5,32 b'' | |||||
5 | <div class="panel-body"> |
|
5 | <div class="panel-body"> | |
6 | <div class="apikeys_wrap"> |
|
6 | <div class="apikeys_wrap"> | |
7 | <p> |
|
7 | <p> | |
8 | ${_('Each token can have a role. Token with a role can be used only in given context, ' |
|
8 | ${_('Authentication tokens can be used to interact with the API, or VCS-over-http. ' | |
|
9 | 'Each token can have a role. Token with a role can be used only in given context, ' | |||
9 | 'e.g. VCS tokens can be used together with the authtoken auth plugin for git/hg/svn operations only.')} |
|
10 | 'e.g. VCS tokens can be used together with the authtoken auth plugin for git/hg/svn operations only.')} | |
10 | </p> |
|
11 | </p> | |
11 | <table class="rctable auth_tokens"> |
|
12 | <table class="rctable auth_tokens"> | |
12 | <tr> |
|
13 | <tr> | |
13 | <th>${_('Token')}</th> |
|
14 | <th>${_('Token')}</th> | |
14 | <th>${_('Scope')}</th> |
|
|||
15 | <th>${_('Description')}</th> |
|
15 | <th>${_('Description')}</th> | |
16 | <th>${_('Role')}</th> |
|
16 | <th>${_('Role')}</th> | |
|
17 | <th>${_('Repository Scope')}</th> | |||
17 | <th>${_('Expiration')}</th> |
|
18 | <th>${_('Expiration')}</th> | |
18 | <th>${_('Action')}</th> |
|
19 | <th>${_('Action')}</th> | |
19 | </tr> |
|
20 | </tr> | |
20 | %if c.user_auth_tokens: |
|
21 | %if c.user_auth_tokens: | |
21 | %for auth_token in c.user_auth_tokens: |
|
22 | %for auth_token in c.user_auth_tokens: | |
22 | <tr class="${'expired' if auth_token.expired else ''}"> |
|
23 | <tr class="${('expired' if auth_token.expired else '')}"> | |
23 | <td class="truncate-wrap td-authtoken"> |
|
24 | <td class="truncate-wrap td-authtoken"> | |
24 | <div class="user_auth_tokens truncate autoexpand"> |
|
25 | <div class="user_auth_tokens truncate autoexpand"> | |
25 | <code>${auth_token.api_key}</code> |
|
26 | <code>${auth_token.api_key}</code> | |
26 | </div> |
|
27 | </div> | |
27 | </td> |
|
28 | </td> | |
28 | <td class="td">${auth_token.scope_humanized}</td> |
|
|||
29 | <td class="td-wrap">${auth_token.description}</td> |
|
29 | <td class="td-wrap">${auth_token.description}</td> | |
30 | <td class="td-tags"> |
|
30 | <td class="td-tags"> | |
31 | <span class="tag disabled">${auth_token.role_humanized}</span> |
|
31 | <span class="tag disabled">${auth_token.role_humanized}</span> | |
32 | </td> |
|
32 | </td> | |
|
33 | <td class="td">${auth_token.scope_humanized}</td> | |||
33 | <td class="td-exp"> |
|
34 | <td class="td-exp"> | |
34 | %if auth_token.expires == -1: |
|
35 | %if auth_token.expires == -1: | |
35 | ${_('never')} |
|
36 | ${_('never')} | |
@@ -92,6 +93,7 b'' | |||||
92 |
|
|
93 | </div> | |
93 | </div> |
|
94 | </div> | |
94 | </div> |
|
95 | </div> | |
|
96 | ||||
95 | <script> |
|
97 | <script> | |
96 | $(document).ready(function(){ |
|
98 | $(document).ready(function(){ | |
97 |
|
99 |
@@ -5,27 +5,32 b'' | |||||
5 | <div class="panel-body"> |
|
5 | <div class="panel-body"> | |
6 | <div class="apikeys_wrap"> |
|
6 | <div class="apikeys_wrap"> | |
7 | <p> |
|
7 | <p> | |
8 | ${_('Each token can have a role. Token with a role can be used only in given context, ' |
|
8 | ${_('Authentication tokens can be used to interact with the API, or VCS-over-http. ' | |
|
9 | 'Each token can have a role. Token with a role can be used only in given context, ' | |||
9 | 'e.g. VCS tokens can be used together with the authtoken auth plugin for git/hg/svn operations only.')} |
|
10 | 'e.g. VCS tokens can be used together with the authtoken auth plugin for git/hg/svn operations only.')} | |
10 | </p> |
|
11 | </p> | |
11 | <table class="rctable auth_tokens"> |
|
12 | <table class="rctable auth_tokens"> | |
12 | <tr> |
|
13 | <tr> | |
13 | <th>${_('Token')}</th> |
|
14 | <th>${_('Token')}</th> | |
14 | <th>${_('Scope')}</th> |
|
|||
15 | <th>${_('Description')}</th> |
|
15 | <th>${_('Description')}</th> | |
16 | <th>${_('Role')}</th> |
|
16 | <th>${_('Role')}</th> | |
|
17 | <th>${_('Repository Scope')}</th> | |||
17 | <th>${_('Expiration')}</th> |
|
18 | <th>${_('Expiration')}</th> | |
18 | <th>${_('Action')}</th> |
|
19 | <th>${_('Action')}</th> | |
19 | </tr> |
|
20 | </tr> | |
20 | %if c.user_auth_tokens: |
|
21 | %if c.user_auth_tokens: | |
21 | %for auth_token in c.user_auth_tokens: |
|
22 | %for auth_token in c.user_auth_tokens: | |
22 | <tr class="${'expired' if auth_token.expired else ''}"> |
|
23 | <tr class="${('expired' if auth_token.expired else '')}"> | |
23 | <td class="truncate-wrap td-authtoken"><div class="user_auth_tokens truncate autoexpand"><code>${auth_token.api_key}</code></div></td> |
|
24 | <td class="truncate-wrap td-authtoken"> | |
24 |
< |
|
25 | <div class="user_auth_tokens truncate autoexpand"> | |
|
26 | <code>${auth_token.api_key}</code> | |||
|
27 | </div> | |||
|
28 | </td> | |||
25 | <td class="td-wrap">${auth_token.description}</td> |
|
29 | <td class="td-wrap">${auth_token.description}</td> | |
26 | <td class="td-tags"> |
|
30 | <td class="td-tags"> | |
27 | <span class="tag disabled">${auth_token.role_humanized}</span> |
|
31 | <span class="tag disabled">${auth_token.role_humanized}</span> | |
28 | </td> |
|
32 | </td> | |
|
33 | <td class="td">${auth_token.scope_humanized}</td> | |||
29 | <td class="td-exp"> |
|
34 | <td class="td-exp"> | |
30 | %if auth_token.expires == -1: |
|
35 | %if auth_token.expires == -1: | |
31 | ${_('never')} |
|
36 | ${_('never')} |
General Comments 0
You need to be logged in to leave comments.
Login now