github.com/emate/nomad@v0.8.2-wo-binpacking/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
    24                class="input"
    25                type="text"
    26                placeholder="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    27                value={{token.secret}}
    28                oninput={{action (mut secret) value="target.value"}}
    29                data-test-token-secret>
    30            </div>
    31            <p class="help">Sent with every request to determine authorization</p>
    32          </div>
    33  
    34          <p class="content"><button data-test-token-submit class="button is-primary" {{action "verifyToken"}}>Set Token</button></p>
    35        {{/if}}
    36  
    37        {{#if tokenIsValid}}
    38          <div data-test-token-success class="notification is-success">
    39            <div class="columns">
    40              <div class="column">
    41                <h3 class="title is-4">Token Authenticated!</h3>
    42                <p>Your token is valid and authorized for the following policies.</p>
    43              </div>
    44            </div>
    45          </div>
    46        {{/if}}
    47  
    48        {{#if tokenIsInvalid}}
    49          <div data-test-token-error class="notification is-danger">
    50            <div class="columns">
    51              <div class="column">
    52                <h3 class="title is-4">Token Failed to Authenticate</h3>
    53                <p>The token secret you have provided does not match an existing token.</p>
    54              </div>
    55            </div>
    56          </div>
    57        {{/if}}
    58  
    59        {{#if tokenRecord}}
    60          <h3 class="title is-4">Token: {{tokenRecord.name}}</h3>
    61          <div class="content">
    62            <div>AccessorID: <code>{{tokenRecord.accessor}}</code></div>
    63            <div>SecretID: <code>{{tokenRecord.secret}}</code></div>
    64          </div>
    65          <h3 class="title is-4">Policies</h3>
    66          {{#if (eq tokenRecord.type "management")}}
    67            <div data-test-token-management-message class="boxed-section">
    68              <div class="boxed-section-body has-centered-text">
    69                The management token has all permissions
    70              </div>
    71            </div>
    72          {{else}}
    73            {{#each tokenRecord.policies as |policy|}}
    74              <div data-test-token-policy class="boxed-section">
    75                <div data-test-policy-name class="boxed-section-head">
    76                  {{policy.name}}
    77                </div>
    78                <div class="boxed-section-body">
    79                  <p data-test-policy-description class="content">
    80                    {{#if policy.description}}
    81                      {{policy.description}}
    82                    {{else}}
    83                      <em>No description</em>
    84                    {{/if}}
    85                  </p>
    86                  <pre><code data-test-policy-rules>{{policy.rules}}</code></pre>
    87                </div>
    88              </div>
    89            {{/each}}
    90          {{/if}}
    91        {{/if}}
    92      </div>
    93    </div>
    94  </section>
    95