File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 9696 "type" : " api" ,
9797 "description" : " External key finder service for retrieving missing keys" ,
9898 "authSecret" : " KEYFINDER_SECRET" ,
99- "endpoint" : " https://api.keyfinder.example.com /v1/keys"
99+ "endpoint" : " https://api.keyfinder.example/v1/keys"
100100 }
101101 ],
102102 "injectionTargets" : {
Original file line number Diff line number Diff line change @@ -407,6 +407,13 @@ class KeyManager {
407407 console . log ( 'ℹ️ Keys remain accessible in GitHub secrets for deployment' ) ;
408408 }
409409
410+ /**
411+ * Get configuration
412+ */
413+ getConfig ( ) : Config {
414+ return this . config ;
415+ }
416+
410417 /**
411418 * Generate summary report
412419 */
@@ -481,7 +488,8 @@ async function main() {
481488
482489 // Read keys from environment
483490 const envKeys = new Map < string , string > ( ) ;
484- for ( const keyConfig of manager [ 'config' ] . requiredKeys ) {
491+ const config = manager . getConfig ( ) ;
492+ for ( const keyConfig of config . requiredKeys ) {
485493 const value = process . env [ keyConfig . name ] ;
486494 if ( value ) {
487495 envKeys . set ( keyConfig . name , value ) ;
@@ -507,8 +515,9 @@ async function main() {
507515 }
508516}
509517
510- // Run if executed directly
511- if ( import . meta. url === `file://${ process . argv [ 1 ] } ` ) {
518+ // Run if executed directly (ES module check)
519+ const isMainModule = process . argv [ 1 ] && import . meta. url . endsWith ( process . argv [ 1 ] ) ;
520+ if ( isMainModule || process . argv [ 1 ] ?. includes ( 'key-manager.ts' ) ) {
512521 main ( ) . catch ( ( error ) => {
513522 console . error ( 'Fatal error:' , error ) ;
514523 exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments