-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1password improvements! - using sdk for service accounts, system cli with ambient auth otherwise - use field ids instead of paths - better error mesages - better JSdoc comments - update 1pass plugin docs General improvements - expose nested resolver branch resolution errors - general cleanup of nested/branched resolvers - adjust how plugins detect their current name/version --------- Co-authored-by: Phil Miller <[email protected]>
- Loading branch information
1 parent
4ae8cf8
commit abdaf0c
Showing
16 changed files
with
766 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,25 +7,26 @@ import { EncryptedVaultDmnoPlugin, EncryptedVaultTypes } from '@dmno/encrypted-v | |
const OnePassSecretsProd = new OnePasswordDmnoPlugin('1pass/prod', { | ||
token: configPath('OP_TOKEN'), | ||
envItemLink: 'https://start.1password.com/open/i?a=I3GUA2KU6BD3FBHA47QNBIVEV4&v=ut2dftalm3ugmxc6klavms6tfq&i=n4wmgfq77mydg5lebtroa3ykvm&h=dmnoinc.1password.com', | ||
|
||
// token: InjectPluginInputByType, | ||
// token: 'asdf', | ||
}); | ||
const OnePassSecretsDev = new OnePasswordDmnoPlugin('1pass', { | ||
token: configPath('OP_TOKEN'), | ||
envItemLink: 'https://start.1password.com/open/i?a=I3GUA2KU6BD3FBHA47QNBIVEV4&v=ut2dftalm3ugmxc6klavms6tfq&i=n4wmgfq77mydg5lebtroa3ykvm&h=dmnoinc.1password.com', | ||
envItemLink: 'https://start.1password.com/open/i?a=I3GUA2KU6BD3FBHA47QNBIVEV4&v=ut2dftalm3ugmxc6klavms6tfq&i=4u4klfhpldobgdxrcjwb2bqsta&h=dmnoinc.1password.com', | ||
// token: InjectPluginInputByType, | ||
// token: 'asdf', | ||
}); | ||
|
||
|
||
const ProdVault = new EncryptedVaultDmnoPlugin('vault/prod', { | ||
const EncryptedVaultSecrets = new EncryptedVaultDmnoPlugin('vault/prod', { | ||
key: configPath('DMNO_VAULT_KEY'), | ||
name: 'prod', | ||
}); | ||
const NonProdVault = new EncryptedVaultDmnoPlugin('vault/dev', { | ||
key: configPath('DMNO_VAULT_KEY'), | ||
name: 'dev', | ||
}); | ||
// const NonProdVault = new EncryptedVaultDmnoPlugin('vault/dev', { | ||
// key: configPath('DMNO_VAULT_KEY'), | ||
// name: 'dev', | ||
// }); | ||
|
||
|
||
|
||
|
@@ -47,8 +48,24 @@ export default defineDmnoService({ | |
OP_TOKEN: { | ||
extends: OnePasswordTypes.serviceAccountToken, | ||
}, | ||
OP_TOKEN_PROD: { | ||
extends: OnePasswordTypes.serviceAccountToken, | ||
// OP_TOKEN_PROD: { | ||
// extends: OnePasswordTypes.serviceAccountToken, | ||
// }, | ||
|
||
OP_ITEM_1: { | ||
value: switchBy('DMNO_ENV', { | ||
_default: OnePassSecretsDev.item(), | ||
production: OnePassSecretsProd.item(), | ||
}), | ||
}, | ||
OP_ITEM_BY_ID: { | ||
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", "helturjryuy73yjbnaovlce5fu"), | ||
}, | ||
OP_ITEM_BY_REFERENCE: { | ||
value: OnePassSecretsDev.itemByReference("op://dev test/example/username"), | ||
}, | ||
|
||
SOME_API_KEY: { | ||
|
@@ -58,8 +75,6 @@ export default defineDmnoService({ | |
}), | ||
}, | ||
|
||
|
||
|
||
DMNO_VAULT_KEY: { | ||
extends: EncryptedVaultTypes.encryptionKey, | ||
// required: true | ||
|
@@ -71,16 +86,16 @@ export default defineDmnoService({ | |
}, | ||
|
||
VAULT_ITEM_1: { | ||
value: ProdVault.item(), | ||
value: EncryptedVaultSecrets.item(), | ||
}, | ||
VAULT_ITEM_WITH_SWITCH: { | ||
value: switchByNodeEnv({ | ||
_default: NonProdVault.item(), | ||
_default: EncryptedVaultSecrets.item(), | ||
staging: switchBy('CONTEXT', { | ||
'branch-preview': ProdVault.item(), | ||
'pr-preview': ProdVault.item(), | ||
'branch-preview': EncryptedVaultSecrets.item(), | ||
'pr-preview': EncryptedVaultSecrets.item(), | ||
}), | ||
production: ProdVault.item() | ||
production: EncryptedVaultSecrets.item() | ||
}), | ||
}, | ||
|
||
|
@@ -92,7 +107,6 @@ export default defineDmnoService({ | |
extends: DmnoBaseTypes.email({ | ||
normalize: true, | ||
}), | ||
// required: true, | ||
value: '[email protected]' | ||
}, | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.