Merge branch 'main' into test-credential-library-create-errors
This commit is contained in:
14 files changed
+65
-9
No files matched your search
@@ -8,6 +8,11 @@ import { attr } from '@ember-data/model';
|
||||
export default class GeneratedCredentialLibraryModel extends BaseModel {
|
||||
// =attributes
|
||||
|
||||
@attr('string', {
|
||||
description: 'The type of the resource, to help differentiate schemas',
|
||||
})
|
||||
type;
|
||||
|
||||
@attr('string', {
|
||||
description: 'The owning credential store ID.',
|
||||
})
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import factory from '../generated/factories/credential-library';
|
||||
import { random, system } from 'faker';
|
||||
|
||||
const types = ['vault'];
|
||||
|
||||
export default factory.extend({
|
||||
id: (i) => `credential-library-id-${i}`,
|
||||
type: (i) => types[i % types.length],
|
||||
|
||||
attributes() {
|
||||
switch (this.type) {
|
||||
case 'vault':
|
||||
return {
|
||||
http_method: 'GET',
|
||||
http_request_body: random.word(),
|
||||
path: system.directoryPath(),
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -9,6 +9,7 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('credential-library');
|
||||
const record = store.createRecord('credential-library', {
|
||||
type: 'vault',
|
||||
name: 'Name',
|
||||
description: 'Description',
|
||||
attributes: {
|
||||
@@ -20,6 +21,7 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
const snapshot = record._createSnapshot();
|
||||
const serializedRecord = serializer.serialize(snapshot);
|
||||
assert.deepEqual(serializedRecord, {
|
||||
type: 'vault',
|
||||
credential_store_id: null,
|
||||
name: 'Name',
|
||||
description: 'Description',
|
||||
@@ -40,6 +42,7 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
id: '1',
|
||||
type: 'credential-library',
|
||||
attributes: {
|
||||
type: 'vault',
|
||||
name: 'Name',
|
||||
description: 'Description',
|
||||
attributes: {
|
||||
@@ -54,6 +57,7 @@ module('Unit | Serializer | credential library', function (hooks) {
|
||||
const snapshot = record._createSnapshot();
|
||||
const serializedRecord = serializer.serialize(snapshot);
|
||||
assert.deepEqual(serializedRecord, {
|
||||
type: 'vault',
|
||||
credential_store_id: null,
|
||||
name: 'Name',
|
||||
description: 'Description',
|
||||
|
||||
@@ -288,6 +288,8 @@ credential-store:
|
||||
title: Welcome to Credential Stores
|
||||
actions:
|
||||
delete: Delete Credential Store
|
||||
types:
|
||||
vault: Vault
|
||||
credential-library:
|
||||
title: Credential Library
|
||||
title_plural: Credential Libraries
|
||||
@@ -309,3 +311,5 @@ credential-library:
|
||||
http_request_body:
|
||||
label: HTTP Method POST Request Body
|
||||
help: The body of the HTTP request the library sends to Vault when requesting credentials. Only allowed when HTTP method is set to POST.
|
||||
types:
|
||||
vault: Vault
|
||||
@@ -83,7 +83,7 @@
|
||||
"prettier": "^2.2.1",
|
||||
"qunit": "^2.13.0",
|
||||
"qunit-dom": "^1.6.0",
|
||||
"sass": "^1.26.5",
|
||||
"sass": "^1.36.0",
|
||||
"sass-lint": "^1.13.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -5,6 +5,14 @@
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t 'form.type.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
@@ -30,6 +31,13 @@
|
||||
/>
|
||||
</row.headerCell>
|
||||
<row.cell>{{credentialLibrary.name}}</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t
|
||||
(concat
|
||||
'resources.credential-library.types.' credentialLibrary.type
|
||||
)
|
||||
}}</Rose::Badge>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
|
||||
+2
-1
@@ -8,10 +8,11 @@ export default class ScopesScopeCredentialStoresCredentialStoreCredentialLibrari
|
||||
* @return {CredentialLibraryModel}
|
||||
*/
|
||||
model() {
|
||||
const { id: credential_store_id } = this.modelFor(
|
||||
const { id: credential_store_id, type } = this.modelFor(
|
||||
'scopes.scope.credential-stores.credential-store'
|
||||
);
|
||||
return this.store.createRecord('credential-library', {
|
||||
type,
|
||||
credential_store_id,
|
||||
});
|
||||
}
|
||||
|
||||
+8
@@ -4,6 +4,7 @@
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
@@ -19,6 +20,13 @@
|
||||
</LinkTo>
|
||||
<p>{{credentialLibrary.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t
|
||||
(concat
|
||||
'resources.credential-library.types.' credentialLibrary.type
|
||||
)
|
||||
}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{credentialLibrary.id}}
|
||||
|
||||
@@ -48,7 +48,11 @@
|
||||
<p>{{credentialStore.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{credentialStore.type}}</Rose::Badge>
|
||||
<Rose::Badge>{{t
|
||||
(concat
|
||||
'resources.credential-store.types.' credentialStore.type
|
||||
)
|
||||
}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'titles.actions'}}</row.headerCell>
|
||||
</header.row>
|
||||
@@ -25,6 +26,13 @@
|
||||
</LinkTo>
|
||||
<p>{{credentialLibrary.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t
|
||||
(concat
|
||||
'resources.credential-library.types.' credentialLibrary.type
|
||||
)
|
||||
}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{credentialLibrary.id}}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
"qunit": "^2.13.0",
|
||||
"qunit-dom": "^1.6.0",
|
||||
"rose": "*",
|
||||
"sass": "^1.29.0",
|
||||
"sass": "^1.36.0",
|
||||
"sass-lint": "^1.13.1",
|
||||
"sinon": "^11.1.1"
|
||||
},
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
"qunit": "^2.13.0",
|
||||
"qunit-dom": "^1.6.0",
|
||||
"rose": "*",
|
||||
"sass": "^1.29.0",
|
||||
"sass": "^1.36.0",
|
||||
"sinon": "^11.1.1",
|
||||
"stylelint": "^13.8.0",
|
||||
"stylelint-config-sass-guidelines": "^7.1.0"
|
||||
|
||||
@@ -18934,10 +18934,10 @@ sass-lint@^1.13.1:
|
||||
path-is-absolute "^1.0.0"
|
||||
util "^0.10.3"
|
||||
|
||||
sass@^1.26.5, sass@^1.29.0:
|
||||
version "1.34.1"
|
||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.34.1.tgz#30f45c606c483d47b634f1e7371e13ff773c96ef"
|
||||
integrity sha512-scLA7EIZM+MmYlej6sdVr0HRbZX5caX5ofDT9asWnUJj21oqgsC+1LuNfm0eg+vM0fCTZHhwImTiCU0sx9h9CQ==
|
||||
sass@^1.36.0:
|
||||
version "1.36.0"
|
||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.36.0.tgz#5912ef9d5d16714171ba11cb17edb274c4bbc07e"
|
||||
integrity sha512-fQzEjipfOv5kh930nu3Imzq3ie/sGDc/4KtQMJlt7RRdrkQSfe37Bwi/Rf/gfuYHsIuE1fIlDMvpyMcEwjnPvg==
|
||||
dependencies:
|
||||
chokidar ">=3.0.0 <4.0.0"
|
||||
|
||||
|
||||
Reference in new issue
Block a user