github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/templates/settings/tokens.hbs (about) 1 {{title "Tokens"}} 2 <section class="section"> 3 <h1 class="title">Access Control Tokens</h1> 4 <div class="columns"> 5 <div class="column is-two-thirds"> 6 <p class="message">Clusters that use Access Control Lists require tokens to perform certain tasks. By providing a token <strong>Secret ID</strong>, each future request will be authenticated, potentially authorizing read access to additional information. By providing a token <strong>Accessor ID</strong>, the policies and rules for the token will be listed.</p> 7 8 <div class="notification is-info"> 9 <div class="columns"> 10 <div class="column"> 11 <h3 class="title is-4">Token Storage</h3> 12 <p>Tokens are stored client-side in <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage">local storage</a>. This will persist your token across sessions. You can manually clear your token here.</p> 13 </div> 14 <div class="column is-centered is-minimum"> 15 <button class="button is-info" {{action "clearTokenProperties"}}>Clear Token</button> 16 </div> 17 </div> 18 </div> 19 20 {{#if (not tokenIsValid)}} 21 <div class="field"> 22 <label class="label">Secret ID</label> 23 <div class="control"> 24 <input 25 class="input" 26 type="text" 27 placeholder="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" 28 value={{token.secret}} 29 oninput={{action (mut secret) value="target.value"}} 30 data-test-token-secret> 31 </div> 32 <p class="help">Sent with every request to determine authorization</p> 33 </div> 34 35 <p class="content"><button data-test-token-submit class="button is-primary" {{action "verifyToken"}}>Set Token</button></p> 36 {{/if}} 37 38 {{#if tokenIsValid}} 39 <div data-test-token-success class="notification is-success"> 40 <div class="columns"> 41 <div class="column"> 42 <h3 class="title is-4">Token Authenticated!</h3> 43 <p>Your token is valid and authorized for the following policies.</p> 44 </div> 45 </div> 46 </div> 47 {{/if}} 48 49 {{#if tokenIsInvalid}} 50 <div data-test-token-error class="notification is-danger"> 51 <div class="columns"> 52 <div class="column"> 53 <h3 class="title is-4">Token Failed to Authenticate</h3> 54 <p>The token secret you have provided does not match an existing token.</p> 55 </div> 56 </div> 57 </div> 58 {{/if}} 59 60 {{#if tokenRecord}} 61 <h3 class="title is-4">Token: {{tokenRecord.name}}</h3> 62 <div class="content"> 63 <div>AccessorID: <code>{{tokenRecord.accessor}}</code></div> 64 <div>SecretID: <code>{{tokenRecord.secret}}</code></div> 65 </div> 66 <h3 class="title is-4">Policies</h3> 67 {{#if (eq tokenRecord.type "management")}} 68 <div data-test-token-management-message class="boxed-section"> 69 <div class="boxed-section-body has-centered-text"> 70 The management token has all permissions 71 </div> 72 </div> 73 {{else}} 74 {{#each tokenRecord.policies as |policy|}} 75 <div data-test-token-policy class="boxed-section"> 76 <div data-test-policy-name class="boxed-section-head"> 77 {{policy.name}} 78 </div> 79 <div class="boxed-section-body"> 80 <p data-test-policy-description class="content"> 81 {{#if policy.description}} 82 {{policy.description}} 83 {{else}} 84 <em>No description</em> 85 {{/if}} 86 </p> 87 <pre><code data-test-policy-rules>{{policy.rules}}</code></pre> 88 </div> 89 </div> 90 {{/each}} 91 {{/if}} 92 {{/if}} 93 </div> 94 </div> 95 </section> 96