Skip to content

Commit

Permalink
use field ids, better error mesages, update 1pass plugin docs
Browse files Browse the repository at this point in the history
  • Loading branch information
theoephraim committed Aug 16, 2024
1 parent d8e6e4c commit 35bc4bc
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 125 deletions.
7 changes: 7 additions & 0 deletions .changeset/big-swans-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@dmno/encrypted-vault-plugin": patch
"@dmno/1password-plugin": patch
"dmno": patch
---

1password plugin improvements, related refactoring
127 changes: 61 additions & 66 deletions example-repo/.dmno/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ export default defineDmnoService({
OP_TOKEN: {
extends: OnePasswordTypes.serviceAccountToken,
},

TEST_PROD_AUTH: {
extends: 'boolean',
},

// OP_TOKEN_PROD: {
// extends: OnePasswordTypes.serviceAccountToken,
// },
Expand All @@ -64,7 +59,7 @@ export default defineDmnoService({
value: OnePassSecretsDev.itemById("ut2dftalm3ugmxc6klavms6tfq", "bphvvrqjegfmd5yoz4buw2aequ", "username"),
},
OP_ITEM_BY_LINK: {
value: OnePassSecretsDev.itemByLink("https://start.1password.com/open/i?a=I3GUA2KU6BD3FBHA47QNBIVEV4&v=ut2dftalm3ugmxc6klavms6tfq&i=bphvvrqjegfmd5yoz4buw2aequ&h=dmnoinc.1password.com", "sectiontest/section-child"),
value: OnePassSecretsDev.itemByLink("https://start.1password.com/open/i?a=I3GUA2KU6BD3FBHA47QNBIVEV4&v=ut2dftalm3ugmxc6klavms6tfq&i=bphvvrqjegfmd5yoz4buw2aequ&h=dmnoinc.1password.com", ""),
},
OP_ITEM_BY_REFERENCE: {
value: OnePassSecretsDev.itemByReference("op://dev test/example/username"),
Expand All @@ -89,78 +84,78 @@ export default defineDmnoService({
value: 'rootonly',
},

// VAULT_ITEM_1: {
// value: ProdVault.item(),
// },
// VAULT_ITEM_WITH_SWITCH: {
// value: switchByNodeEnv({
// _default: NonProdVault.item(),
// staging: switchBy('CONTEXT', {
// 'branch-preview': ProdVault.item(),
// 'pr-preview': ProdVault.item(),
// }),
// production: ProdVault.item()
// }),
// },
VAULT_ITEM_1: {
value: ProdVault.item(),
},
VAULT_ITEM_WITH_SWITCH: {
value: switchByNodeEnv({
_default: NonProdVault.item(),
staging: switchBy('CONTEXT', {
'branch-preview': ProdVault.item(),
'pr-preview': ProdVault.item(),
}),
production: ProdVault.item()
}),
},

PICK_TEST: {
value: (ctx) => `pick-test--${DMNO_CONFIG.ROOT_ONLY}`,
},

// CONTACT_EMAIL: {
// extends: DmnoBaseTypes.email({
// normalize: true,
// }),
// // required: true,
// value: '[email protected]'
// },
CONTACT_EMAIL: {
extends: DmnoBaseTypes.email({
normalize: true,
}),
// required: true,
value: '[email protected]'
},

// SOME_IPV4: {
// extends: DmnoBaseTypes.ipAddress,
// required: true,
// value: '100.200.1.1'
// },
SOME_IPV4: {
extends: DmnoBaseTypes.ipAddress,
required: true,
value: '100.200.1.1'
},

// SOME_IPV6: {
// extends: DmnoBaseTypes.ipAddress({
// version: 6,
// normalize: true,
// }),
// required: true,
// value: '2001:0DB8:85a3:0000:0000:8a2e:0370:7334'
// },
SOME_IPV6: {
extends: DmnoBaseTypes.ipAddress({
version: 6,
normalize: true,
}),
required: true,
value: '2001:0DB8:85a3:0000:0000:8a2e:0370:7334'
},

// SOME_PORT: {
// extends: DmnoBaseTypes.port,
// required: true,
// value: '8080'
// },
SOME_PORT: {
extends: DmnoBaseTypes.port,
required: true,
value: '8080'
},

// SOME_SEMVER: {
// extends: DmnoBaseTypes.semver({
// normalize: true,
// }),
// required: true,
// value: '1.2.3-ALPHA.1'
// },
SOME_SEMVER: {
extends: DmnoBaseTypes.semver({
normalize: true,
}),
required: true,
value: '1.2.3-ALPHA.1'
},

// SOME_DATE: {
// extends: DmnoBaseTypes.isoDate,
// required: true,
// value: new Date().toISOString()
// },
SOME_DATE: {
extends: DmnoBaseTypes.isoDate,
required: true,
value: new Date().toISOString()
},

// SOME_UUID: {
// extends: DmnoBaseTypes.uuid,
// required: true,
// value: '550e8400-e29b-41d4-a716-446655440000'
// },
SOME_UUID: {
extends: DmnoBaseTypes.uuid,
required: true,
value: '550e8400-e29b-41d4-a716-446655440000'
},

// SOME_MD5: {
// extends: DmnoBaseTypes.md5,
// required: true,
// value: 'd41d8cd98f00b204e9800998ecf8427e'
// },
SOME_MD5: {
extends: DmnoBaseTypes.md5,
required: true,
value: 'd41d8cd98f00b204e9800998ecf8427e'
},
}
});

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 35bc4bc

Please sign in to comment.