@@ -13,7 +13,7 @@ export default function encryptedDirective(
1313 symmetricKey ?: DecryptedSymmetricKey ,
1414 shouldShowDeprecationNotice ?: true ,
1515) : ParsingExtension {
16- return named ( 'encryption' , ( value , _ , __ , ctx ) => {
16+ return named ( 'encryption' , ( value ) => {
1717 if ( typeof value === 'string' && value . startsWith ( 'enc:' ) ) {
1818 return async ( parse ) => {
1919 if ( shouldShowDeprecationNotice ) {
@@ -22,28 +22,9 @@ export default function encryptedDirective(
2222 ) ;
2323 }
2424
25- // we override the environment with what's specified in the key revision
26- // so you can use the same key for multiple environments
27-
28- const revision = value . split ( ':' ) [ 1 ] ;
29-
30- if ( ! revision ) {
31- throw new AppConfigError ( `Could not find key revision in encrypted value` ) ;
32- }
33-
34- const envRegex = / ^ (?: (?< env > \w * ) - ) ? (?: \d + ) $ / ;
35- const env = envRegex . exec ( revision ) ?. groups ?. env ;
36- const environmentOptions = environmentOptionsFromContext ( ctx ) ;
37-
38- if ( env && environmentOptions ) {
39- environmentOptions . override = env ;
40- }
41-
42- const decrypted = await decryptValue (
43- value ,
44- symmetricKey ,
45- env ? environmentOptions : undefined ,
46- ) ;
25+ // we don't need to pass the environment here - we use the key revision
26+ // to determine which symmetric key to use
27+ const decrypted = await decryptValue ( value , symmetricKey ) ;
4728
4829 return parse ( decrypted , { fromSecrets : true , parsedFromEncryptedValue : true } ) ;
4930 } ;
0 commit comments