github.com/blixtra/nomad@v0.7.2-0.20171221000451-da9a1d7bb050/ui/app/templates/settings/tokens.hbs (about) 1 <section class="section"> 2 <h1 class="title">Access Control Tokens</h1> 3 <div class="columns"> 4 <div class="column is-two-thirds"> 5 <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> 6 7 <div class="notification is-info"> 8 <div class="columns"> 9 <div class="column"> 10 <h3 class="title is-4">Token Storage</h3> 11 <p>To protect Secret IDs, tokens are stored client-side in <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage">session storage</a>. Your ACL token is automatically cleared from storage upon closing your browser window. You can also manually clear your token instead.</p> 12 </div> 13 <div class="column is-centered is-minimum"> 14 <button class="button is-info" {{action "clearTokenProperties"}}>Clear Token</button> 15 </div> 16 </div> 17 </div> 18 19 {{#if (not tokenIsValid)}} 20 <div class="field"> 21 <label class="label">Secret ID</label> 22 <div class="control"> 23 <input class="input token-secret" type="text" placeholder="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" value={{token.secret}} oninput={{action (mut secret) value="target.value"}}> 24 </div> 25 <p class="help">Sent with every request to determine authorization</p> 26 </div> 27 28 <p class="content"><button class="button is-primary token-submit" {{action "verifyToken"}}>Set Token</button></p> 29 {{/if}} 30 31 {{#if tokenIsValid}} 32 <div class="notification is-success token-success"> 33 <div class="columns"> 34 <div class="column"> 35 <h3 class="title is-4">Token Authenticated!</h3> 36 <p>Your token is valid and authorized for the following policies.</p> 37 </div> 38 </div> 39 </div> 40 {{/if}} 41 42 {{#if tokenIsInvalid}} 43 <div class="notification is-danger token-error"> 44 <div class="columns"> 45 <div class="column"> 46 <h3 class="title is-4">Token Failed to Authenticate</h3> 47 <p>The token secret you have provided does not match an existing token.</p> 48 </div> 49 </div> 50 </div> 51 {{/if}} 52 53 {{#if tokenRecord}} 54 <h3 class="title is-4">Token: {{tokenRecord.name}}</h3> 55 <div class="content"> 56 <div>AccessorID: <code>{{tokenRecord.accessor}}</code></div> 57 <div>SecretID: <code>{{tokenRecord.secret}}</code></div> 58 </div> 59 <h3 class="title is-4">Policies</h3> 60 {{#if (eq tokenRecord.type "management")}} 61 <div class="boxed-section token-management-message"> 62 <div class="boxed-section-body has-centered-text"> 63 The management token has all permissions 64 </div> 65 </div> 66 {{else}} 67 {{#each tokenRecord.policies as |policy|}} 68 <div class="boxed-section token-policy"> 69 <div class="boxed-section-head"> 70 {{policy.name}} 71 </div> 72 <div class="boxed-section-body"> 73 <p class="content"> 74 {{#if policy.description}} 75 {{policy.description}} 76 {{else}} 77 <em>No description</em> 78 {{/if}} 79 </p> 80 <pre><code>{{policy.rules}}</code></pre> 81 </div> 82 </div> 83 {{/each}} 84 {{/if}} 85 {{/if}} 86 </div> 87 </div> 88 </section> 89