mirror of
https://github.com/status-im/consul.git
synced 2025-01-13 07:14:37 +00:00
fc14a412fd
* Add Partition to all our models * Add partitions into our serializers/fingerprinting * Make some amends to a few adapters ready for partitions * Amend blueprints to avoid linting error * Update all our repositories to include partitions, also Remove enabled/disable nspace repo and just use a nspace with conditionals * Ensure nspace and parition parameters always return '' no matter what * Ensure data-sink finds the model properly This will later be replaced by a @dataSink decorator but we are find kicking that can down the road a little more * Add all the new partition data layer * Add a way to set the title of the page from inside the route and make it accessibile via a route announcer * Make the Consul Route the default/basic one * Tweak nspace and partition abilities not to check the length * Thread partition through all the components that need it * Some ACL tweaks * Move the entire app to use partitions * Delete all the tests we no longer need * Update some Unit tests to use partition * Fix up KV title tests * Fix up a few more acceptance tests * Fixup and temporarily ignore some acceptance tests * Stop using ember-cli-page-objects fillable as it doesn't seem to work * Fix lint error * Remove old ACL related test * Add a tick after filling out forms * Fix token warning modal * Found some more places where we need a partition var * Fixup some more acceptance tests * Tokens still needs a repo service for CRUD * Remove acceptance tests we no longer need * Fixup and "FIXME ignore" a few tests * Remove an s * Disable blocking queries for KV to revert to previous release for now * Fixup adapter tests to follow async/function resolving interface * Fixup all the serializer integration tests * Fixup service/repo integration tests * Fixup deleting acceptance test * Fixup some ent tests * Make sure nspaces passes the dc through for when thats important * ...aaaand acceptance nspaces with the extra dc param
123 lines
3.9 KiB
Handlebars
123 lines
3.9 KiB
Handlebars
<Route
|
|
@name={{routeName}}
|
|
as |route|>
|
|
<DataLoader @src={{
|
|
uri '/${partition}/${nspace}/${dc}/token/${id}'
|
|
(hash
|
|
partition=route.params.partition
|
|
nspace=route.params.nspace
|
|
dc=route.params.dc
|
|
id=(or route.params.id '')
|
|
)
|
|
}}
|
|
as |loader|>
|
|
|
|
<BlockSlot @name="error">
|
|
{{#if (eq loader.error.status '401')}}
|
|
<Consul::Acl::Disabled />
|
|
{{else}}
|
|
<AppError
|
|
@error={{loader.error}}
|
|
@login={{route.model.app.login.open}}
|
|
/>
|
|
{{/if}}
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="loaded">
|
|
{{#let
|
|
|
|
route.params.dc
|
|
route.params.partition
|
|
route.params.nspace
|
|
|
|
loader.data
|
|
loader.data.isNew
|
|
as |dc partition nspace item create|}}
|
|
<AppView
|
|
@login={{route.model.app.login.open}}
|
|
>
|
|
<BlockSlot @name="notification" as |status type item error|>
|
|
<Consul::Token::Notifications
|
|
@type={{type}}
|
|
@status={{status}}
|
|
@item={{item}}
|
|
@error={{error}}
|
|
/>
|
|
</BlockSlot>
|
|
<BlockSlot @name="breadcrumbs">
|
|
<ol>
|
|
<li><a data-test-back href={{href-to 'dc.acls.tokens'}}>All Tokens</a></li>
|
|
</ol>
|
|
</BlockSlot>
|
|
<BlockSlot @name="header">
|
|
<h1>
|
|
{{#if create}}
|
|
<route.Title @title="New Token" />
|
|
{{else}}
|
|
<route.Title @title="Edit Token" />
|
|
{{/if}}
|
|
</h1>
|
|
</BlockSlot>
|
|
<BlockSlot @name="actions">
|
|
{{#if (not create)}}
|
|
{{#if (not-eq item.AccessorID token.AccessorID)}}
|
|
<ConfirmationDialog @message="Are you sure you want to use this ACL token?">
|
|
<BlockSlot @name="action" as |confirm|>
|
|
<button data-test-use type="button" {{ action confirm 'use' item }}>Use</button>
|
|
</BlockSlot>
|
|
<BlockSlot @name="dialog" as |execute cancel message|>
|
|
<p>
|
|
{{message}}
|
|
</p>
|
|
<button type="button" class="type-delete" {{action execute}}>Confirm Use</button>
|
|
<button type="button" class="type-cancel" {{action cancel}}>Cancel</button>
|
|
</BlockSlot>
|
|
</ConfirmationDialog>
|
|
{{/if}}
|
|
{{#if (can "duplicate token" item=item)}}
|
|
<button data-test-clone type="button" {{ action "clone" item }}>Duplicate</button>
|
|
{{/if}}
|
|
{{/if}}
|
|
</BlockSlot>
|
|
<BlockSlot @name="content">
|
|
{{#if (token/is-legacy item)}}
|
|
<Notice
|
|
@type="info"
|
|
as |notice|>
|
|
<notice.Header>
|
|
<h2>Update</h2>
|
|
</notice.Header>
|
|
<notice.Body>
|
|
<p>
|
|
We have upgraded our ACL system by allowing you to create reusable policies which you can then apply to tokens. Don't worry, even though this token was written in the old style, it is still valid. However, we do recommend upgrading your old tokens to the new style. Learn how in our <a href="{{env 'CONSUL_DOCS_URL'}}/guides/acl-migrate-tokens.html" target="_blank" rel="noopener noreferrer">documentation</a>.
|
|
</p>
|
|
</notice.Body>
|
|
</Notice>
|
|
{{/if}}
|
|
{{#if (not create) }}
|
|
<div class="definition-table">
|
|
<dl>
|
|
<dt>AccessorID</dt>
|
|
<dd>
|
|
<CopyButton @value={{item.AccessorID}} @name="AccessorID" @position="top-start" /> {{item.AccessorID}}
|
|
</dd>
|
|
<dt>Token</dt>
|
|
<dd>
|
|
<CopyButton @value={{item.SecretID}} @name="Token" @position="top-start" /> <SecretButton>{{item.SecretID}}</SecretButton>
|
|
</dd>
|
|
{{#if (and (not (token/is-legacy item)) (not create))}}
|
|
<dt>Scope</dt>
|
|
<dd>
|
|
{{if item.Local 'local' 'global' }}
|
|
</dd>
|
|
{{/if}}
|
|
</dl>
|
|
</div>
|
|
{{/if}}
|
|
{{ partial 'dc/acls/tokens/form'}}
|
|
</BlockSlot>
|
|
</AppView>
|
|
{{/let}}
|
|
</BlockSlot>
|
|
</DataLoader>
|
|
</Route> |