Fix auth file path detection, lowercase registry, and ECR OIDC support

Fix hardcoded auth file path (#47):
- Parse the "Used: <path>" line from podman's --verbose output to detect
  the actual auth file location instead of hardcoding /tmp/podman-run-<uid>.
  Podman 5.x changed the path to /tmp/storage-run-<uid>, and other
  environments use /run/containers/<uid>. The hardcoded path caused
  ENOENT errors on newer podman versions and self-hosted runners.
- Fall back to the old heuristic with a warning if parsing fails.

Automatically lowercase registry input (#44):
- Registry names must be lowercase per OCI spec. Uppercase characters in
  the registry input (e.g. from github.repository_owner) caused podman
  login to fail with "repository name must be lowercase".

Support AWS OIDC session tokens for ECR (#37):
- Read AWS_SESSION_TOKEN from environment and include it in the ECR
  client credentials. This enables authentication via temporary OIDC
  credentials from aws-actions/configure-aws-credentials, which sets
  this variable automatically.

Fixes #47
Fixes #44
Fixes #37
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Brown committed 2026-07-24 11:21:36 +01:00
1 parent b1530e72f1
commit 6be3c81128
4 files changed
+32 -13

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
require('./sourcemap-register.js');(()=>{var t={8249:(t,n,i)=>{var A;const{awsEndpointFunctions:a,emitWarningIfUnsupportedVersion:c,createDefaultUserAgentProvider:l,NODE_APP_ID_CONFIG_OPTIONS:g,getAwsRegionExtensionConfiguration:d,resolveAwsRegionExtensionConfiguration:h,resolveUserAgentConfig:f,resolveHostHeaderConfig:E,getUserAgentPlugin:p,getHostHeaderPlugin:C,getLoggerPlugin:I,getRecursionDetectionPlugin:m}=i(5152);const{getHttpAuthSchemeEndpointRuleSetPlugin:B,DefaultIdentityProviderConfig:Q,getHttpSigningPlugin:y,createPaginator:w}=i(402);const{normalizeProvider:S,getSmithyContext:b,ServiceException:R,NoOpLogger:D,emitWarningIfUnsupportedVersion:k,loadConfigsForDefaultMode:v,getDefaultExtensionConfiguration:T,resolveDefaultRuntimeConfig:N,Client:F,makeBuilder:M,createWaiter:x,checkExceptions:U,WaiterState:L,createAggregatedClient:P}=i(2658);const{Command:O}=i(2658);A=O;A=F;const{resolveDefaultsModeConfig:H,loadConfig:_,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:G,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:V,NODE_REGION_CONFIG_OPTIONS:Y,NODE_REGION_CONFIG_FILE_OPTIONS:J,resolveRegionConfig:W}=i(7291);const{BinaryDecisionDiagram:q,EndpointCache:z,decideEndpoint:$,customEndpointFunctions:j,resolveEndpointConfig:K,getEndpointPlugin:Z}=i(2085);const{parseUrl:X,getHttpHandlerExtensionConfiguration:ee,resolveHttpHandlerRuntimeConfig:te,getContentLengthPlugin:re}=i(3422);const{DEFAULT_RETRY_MODE:ne,NODE_RETRY_MODE_CONFIG_OPTIONS:se,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:oe,resolveRetryConfig:ie,getRetryPlugin:Ae}=i(3609);const{TypeRegistry:ae,getSchemaSerdePlugin:ce}=i(6890);const{resolveAwsSdkSigV4Config:le,AwsSdkSigV4Signer:ue,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:ge}=i(7523);const{defaultProvider:de}=i(5861);const{toUtf8:he,fromUtf8:fe,toBase64:Ee,fromBase64:pe,calculateBodyLength:Ce}=i(2430);const{streamCollector:Ie,NodeHttpHandler:me}=i(1279);const{AwsJson1_1Protocol:Be}=i(7288);const{Sha256:Qe}=i(9542);const defaultECRHttpAuthSchemeParametersProvider=async(t,n,i)=>({operation:b(n).operation,region:await S(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function createAwsAuthSigv4HttpAuthOption(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"ecr",region:t.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}const defaultECRHttpAuthSchemeProvider=t=>{const n=[];switch(t.operation){default:{n.push(createAwsAuthSigv4HttpAuthOption(t))}}return n};const resolveHttpAuthSchemeConfig=t=>{const n=le(t);return Object.assign(n,{authSchemePreference:S(t.authSchemePreference??[])})};const resolveClientEndpointParameters=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??false,useFipsEndpoint:t.useFipsEndpoint??false,defaultSigningName:"ecr"});const ye={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var we="3.1093.0";var Se={version:we};const be="ref";const Re=-1,De=true,ke="isSet",ve="PartitionResult",Te="stringEquals",Ne="booleanEquals",Fe="getAttr",Me={[be]:"Endpoint"},xe={fn:Fe,argv:[{[be]:ve},"name"]},Ue={[be]:ve},Le={},Pe=[{[be]:"Region"}];const Oe={conditions:[[ke,[Me]],[ke,Pe],["aws.partition",Pe,ve],[Te,[xe,"aws-eusc"]],[Te,[xe,"aws-iso-f"]],[Te,[xe,"aws-iso-e"]],[Te,[xe,"aws-iso-b"]],[Te,[xe,"aws-iso"]],[Te,[xe,"aws-cn"]],[Te,[xe,"aws-us-gov"]],[Te,[xe,"aws"]],[Ne,[{[be]:"UseFIPS"},De]],[Ne,[{fn:Fe,argv:[Ue,"supportsFIPS"]},De]],[Ne,[{[be]:"UseDualStack"},De]],[Ne,[{fn:Fe,argv:[Ue,"supportsDualStack"]},De]]],results:[[Re],[Re,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Re,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[Me,Le],["https://api.ecr.{Region}.{PartitionResult#dnsSuffix}",Le],["https://ecr.{Region}.{PartitionResult#dualStackDnsSuffix}",Le],["https://api.ecr-fips.{Region}.{PartitionResult#dnsSuffix}",Le],["https://ecr-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Le],["https://api.ecr-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Le],[Re,"FIPS and DualStack are enabled, but this partition does not support one or both"],[Re,"FIPS is enabled but this partition does not support FIPS"],["https://api.ecr.{Region}.{PartitionResult#dualStackDnsSuffix}",Le],[Re,"DualStack is enabled but this partition does not support DualStack"],[Re,"Invalid Configuration: Missing Region"]]};const He=2;const _e=1e8;const Ge=new Int32Array([-1,1,-1,0,23,3,1,4,_e+13,2,5,_e+13,3,20,6,4,20,7,5,20,8,6,20,9,7,20,10,8,20,11,9,20,12,10,20,13,11,16,14,13,15,_e+4,14,_e+11,_e+12,12,18,17,13,_e+9,_e+10,13,19,_e+6,14,_e+8,_e+9,11,22,21,13,_e+5,_e+4,13,_e+7,_e+6,11,_e+1,24,13,_e+2,_e+3]);const Ve=q.from(Ge,He,Oe.conditions,Oe.results);const Ye=new z({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]});const defaultEndpointResolver=(t,n={})=>Ye.get(t,()=>$(Ve,{endpointParams:t,logger:n.logger}));j.aws=a;class ECLine truncated
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=t=>t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=t=>t.replace(/\r?\n|\r/g,"\r\n");const A=[];const a=new Uint8Array([13,10]);f=0;let c=false;for(const[n,l]of t){if(typeof l==="string"){const t=D.encode(i+`; name="${escape(normalizeLinefeeds(n))}"`+`\r\n\r\n${normalizeLinefeeds(l)}\r\n`);A.push(t);f+=t.byteLength}else{const t=D.encode(`${i}; name="${escape(normalizeLinefeeds(n))}"`+(l.name?`; filename="${escape(l.name)}"`:"")+"\r\n"+`Content-Type: ${l.type||"application/octet-stream"}\r\n\r\n`);A.push(t,l,a);if(typeof l.size==="number"){f+=t.byteLength+l.size+a.byteLength}else{c=true}}}const l=D.encode(`--${n}--\r\n`);A.push(l);f+=l.byteLength;if(c){f=null}h=t;d=async function*(){for(const t of A){if(t.stream){yield*t.stream()}else{yield t}}};E=`multipart/form-data; boundary=${n}`}else if(c(t)){h=t;f=t.size;if(t.type){E=t.type}}else if(typeof t[Symbol.asyncIterator]==="function"){if(n){throw new TypeError("keepalive")}if(A.isDisturbed(t)||t.locked){throw new TypeError("Response body object should not be disturbed or locked")}i=t instanceof ReadableStream?t:a(t)}if(typeof h==="string"||A.isBuffer(h)){f=Buffer.byteLength(h)}if(d!=null){let n;i=new ReadableStream({async start(){n=d(t)[Symbol.asyncIterator]()},async pull(t){const{value:A,done:a}=await n.next();if(a){queueMicrotask(()=>{t.close();t.byobRequest?.respond(0)})}else{if(!Q(i)){const n=new Uint8Array(A);if(n.byteLength){t.enqueue(n)}}}return t.desiredSize>0},async cancel(t){await n.return()},type:"bytes"})}const p={stream:i,source:h,length:f};return[p,E]}function safelyExtractBody(t,n=false){if(t instanceof ReadableStream){B(!A.isDisturbed(t),"The body has already been consumed.");B(!t.locked,"The stream is locked.")}return extractBody(t,n)}function cloneBody(t,n){const[i,A]=n.stream.tee();n.stream=i;return{stream:A,length:n.length,source:n.source}}function throwIfAborted(t){if(t.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(t){const n={blob(){return consumeBody(this,t=>{let n=bodyMimeType(this);if(n===null){n=""}else if(n){n=S(n)}return new m([t],{type:n})},t)},arrayBuffer(){return consumeBody(this,t=>new Uint8Array(t).buffer,t)},text(){return consumeBody(this,E,t)},json(){return consumeBody(this,parseJSONFromBytes,t)},formData(){return consumeBody(this,t=>{const n=bodyMimeType(this);if(n!==null){switch(n.essence){case"multipart/form-data":{const i=b(t,n);if(i==="failure"){throw new TypeError("Failed to parse body as FormData.")}const A=new p;A[C]=i;return A}case"application/x-www-form-urlencoded":{const n=new URLSearchParams(t.toString());const i=new p;for(const[t,A]of n){i.append(t,A)}return i}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return consumeBody(this,t=>new Uint8Array(t),t)}};return n}function mixinBody(t){Object.assign(t.prototype,bodyMixinMethods(t))}async function consumeBody(t,n,i){I.brandCheck(t,i);if(bodyUnusable(t)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(t[C]);const A=d();const errorSteps=t=>A.reject(t);const successSteps=t=>{try{A.resolve(n(t))}catch(t){errorSteps(t)}};if(t[C].body==null){successSteps(Buffer.allocUnsafe(0));return A.promise}await h(t[C].body,successSteps,errorSteps);return A.promise}function bodyUnusable(t){const n=t[C].body;return n!=null&&(n.stream.locked||A.isDisturbed(n.stream))}function parseJSONFromBytes(t){return JSON.parse(E(t))}function bodyMimeType(t){const n=t[C].headersList;const i=f(n);if(i==="failure"){return null}return i}t.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:v,hasFinalizationRegistry:k,bodyUnusable:bodyUnusable}},4495:t=>{"use strict";const n=["GET","HEAD","POST"];const i=new Set(n);const A=[101,204,205,304];const a=[301,302,303,307,308];const c=new Set(a);const l=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];const g=new Set(l);const d=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const h=new Set(d);const f=["follow","manual","error"];const E=["GET","HEAD","OPTIONS","TRACE"];const p=new Set(E);const C=["navigate","same-origin","no-cors","cors"];const I=["omit","same-origin","include"];const m=["default","no-store","reload","no-cache","forcLine truncated
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */g[l-4]=i[0];g[l-3]=i[1];g[l-2]=i[2];g[l-1]=i[3];g[1]=c;if(c===126){g.writeUInt16BE(a,2)}else if(c===127){g[2]=g[3]=0;g.writeUIntBE(a,4,6)}g[1]|=128;for(let t=0;t<a;++t){g[l+t]=n[t]^i[t&3]}return g}}t.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(t,n,i)=>{"use strict";const{createInflateRaw:A,Z_DEFAULT_WINDOWBITS:a}=i(8522);const{isValidClientWindowBits:c}=i(8625);const{MessageSizeExceededError:l}=i(8707);const g=Buffer.from([0,0,255,255]);const d=Symbol("kBuffer");const h=Symbol("kLength");class PerMessageDeflate{#j;#d={};#K=0;constructor(t,n){this.#d.serverNoContextTakeover=t.has("server_no_context_takeover");this.#d.serverMaxWindowBits=t.get("server_max_window_bits");this.#K=n.maxPayloadSize}decompress(t,n,i){if(!this.#j){let t=a;if(this.#d.serverMaxWindowBits){if(!c(this.#d.serverMaxWindowBits)){i(new Error("Invalid server_max_window_bits"));return}t=Number.parseInt(this.#d.serverMaxWindowBits)}try{this.#j=A({windowBits:t})}catch(t){i(t);return}this.#j[d]=[];this.#j[h]=0;this.#j.on("data",t=>{this.#j[h]+=t.length;if(this.#K>0&&this.#j[h]>this.#K){i(new l);this.#j.removeAllListeners();this.#j=null;return}this.#j[d].push(t)});this.#j.on("error",t=>{this.#j=null;i(t)})}this.#j.write(t);if(n){this.#j.write(g)}this.#j.flush(()=>{if(!this.#j){return}const t=Buffer.concat(this.#j[d],this.#j[h]);this.#j[d].length=0;this.#j[h]=0;i(null,t)})}}t.exports={PerMessageDeflate:PerMessageDeflate}},1652:(t,n,i)=>{"use strict";const{Writable:A}=i(7075);const a=i(4589);const{parserStates:c,opcodes:l,states:g,emptyBuffer:d,sentCloseFrameState:h}=i(736);const{kReadyState:f,kSentClose:E,kResponse:p,kReceivedClose:C}=i(1216);const{channels:I}=i(2414);const{isValidStatusCode:m,isValidOpcode:B,failWebsocketConnection:Q,websocketMessageReceived:y,utf8Decode:w,isControlFrame:S,isTextBinaryFrame:b,isContinuationFrame:R}=i(8625);const{WebsocketFrameSend:D}=i(3264);const{closeWebSocketConnection:k}=i(6897);const{PerMessageDeflate:v}=i(9469);const{MessageSizeExceededError:T}=i(8707);function failWebsocketConnectionWithCode(t,n,i){k(t,n,i,Buffer.byteLength(i));Q(t,i)}class ByteParser extends A{#Z=[];#X=0;#ee=0;#te=false;#m=c.INFO;#re={};#ne=[];#se;#oe;#K;constructor(t,n,i={}){super();this.ws=t;this.#se=n==null?new Map:n;this.#oe=i.maxFragments??0;this.#K=i.maxPayloadSize??0;if(this.#se.has("permessage-deflate")){this.#se.set("permessage-deflate",new v(n,i))}}_write(t,n,i){this.#Z.push(t);this.#ee+=t.length;this.#te=true;this.run(i)}#ie(){if(this.#K>0&&!S(this.#re.opcode)&&this.#re.payloadLength+this.#X>this.#K){failWebsocketConnectionWithCode(this.ws,1009,"Payload size exceeds maximum allowed size");return false}return true}run(t){while(this.#te){if(this.#m===c.INFO){if(this.#ee<2){return t()}const n=this.consume(2);const i=(n[0]&128)!==0;const A=n[0]&15;const a=(n[1]&128)===128;const g=!i&&A!==l.CONTINUATION;const d=n[1]&127;const h=n[0]&64;const f=n[0]&32;const E=n[0]&16;if(!B(A)){Q(this.ws,"Invalid opcode received");return t()}if(a){Q(this.ws,"Frame cannot be masked");return t()}if(h!==0&&!this.#se.has("permessage-deflate")){Q(this.ws,"Expected RSV1 to be clear.");return}if(f!==0||E!==0){Q(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(g&&!b(A)){Q(this.ws,"Invalid frame type was fragmented.");return}if(b(A)&&this.#ne.length>0){Q(this.ws,"Expected continuation frame");return}if(this.#re.fragmented&&g){Q(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((d>125||g)&&S(A)){Q(this.ws,"Control frame either too large or fragmented");return}if(R(A)&&this.#ne.length===0&&!this.#re.compressed){Q(this.ws,"Unexpected continuation frame");return}if(d<=125){this.#re.payloadLength=d;this.#m=c.READ_DATA;if(!this.#ie()){return}}else if(d===126){this.#m=c.PAYLOADLENGTH_16}else if(d===127){this.#m=c.PAYLOADLENGTH_64}if(b(A)){this.#re.binaryType=A;this.#re.compressed=h!==0}this.#re.opcode=A;this.#re.masked=a;this.#re.fin=i;this.#re.fragmented=g}else if(this.#m===c.PAYLOADLENGTH_16){if(this.#ee<2){return t()}const n=this.consume(2);this.#re.payloadLength=n.readUInt16BE(0);this.#m=c.READ_DATA;if(!this.#ie()){return}}else if(this.#m===c.PAYLOADLENGTH_64){if(this.#ee<8){return t()}const n=this.consume(8);const i=n.readUInt32BE(0);const A=n.readUInt32BE(4);if(i!==0||A>2**31-1){Q(this.ws,"Received payload length > 2^31 bytes.");return}this.#re.payloadLength=A;this.#m=c.READ_DATA;if(!this.#ie()){return}}else if(this.#m===c.READ_DATA){if(this.#ee<this.#re.payloadLength){return t()}const n=this.consume(this.#re.payloadLength);if(S(this.#re.opcode)){this.#te=this.parseControlFrame(n);this.#m=c.INFO}else{if(!this.#re.compressed){if(!this.writeFragments(n)){return}if(this.#K>0&&this.#X>this.#K){failWebsocketConnectionWithCode(this.ws,1009,(new T).message);return}if(!this.#re.fragmented&&this.#re.fin){y(this.ws,this.#re.binaryType,this.consumeFragments())}this.#m=c.INFO}else{this.#se.get("permessage-deflate").decompress(n,this.#re.fin,(n,i)=>{if(n){const t=n instanceof T?1009:1007;Line truncated
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */g[l-4]=i[0];g[l-3]=i[1];g[l-2]=i[2];g[l-1]=i[3];g[1]=c;if(c===126){g.writeUInt16BE(a,2)}else if(c===127){g[2]=g[3]=0;g.writeUIntBE(a,4,6)}g[1]|=128;for(let t=0;t<a;++t){g[l+t]=n[t]^i[t&3]}return g}}t.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(t,n,i)=>{"use strict";const{createInflateRaw:A,Z_DEFAULT_WINDOWBITS:a}=i(8522);const{isValidClientWindowBits:c}=i(8625);const{MessageSizeExceededError:l}=i(8707);const g=Buffer.from([0,0,255,255]);const d=Symbol("kBuffer");const h=Symbol("kLength");class PerMessageDeflate{#j;#d={};#K=0;constructor(t,n){this.#d.serverNoContextTakeover=t.has("server_no_context_takeover");this.#d.serverMaxWindowBits=t.get("server_max_window_bits");this.#K=n.maxPayloadSize}decompress(t,n,i){if(!this.#j){let t=a;if(this.#d.serverMaxWindowBits){if(!c(this.#d.serverMaxWindowBits)){i(new Error("Invalid server_max_window_bits"));return}t=Number.parseInt(this.#d.serverMaxWindowBits)}try{this.#j=A({windowBits:t})}catch(t){i(t);return}this.#j[d]=[];this.#j[h]=0;this.#j.on("data",t=>{this.#j[h]+=t.length;if(this.#K>0&&this.#j[h]>this.#K){i(new l);this.#j.removeAllListeners();this.#j=null;return}this.#j[d].push(t)});this.#j.on("error",t=>{this.#j=null;i(t)})}this.#j.write(t);if(n){this.#j.write(g)}this.#j.flush(()=>{if(!this.#j){return}const t=Buffer.concat(this.#j[d],this.#j[h]);this.#j[d].length=0;this.#j[h]=0;i(null,t)})}}t.exports={PerMessageDeflate:PerMessageDeflate}},1652:(t,n,i)=>{"use strict";const{Writable:A}=i(7075);const a=i(4589);const{parserStates:c,opcodes:l,states:g,emptyBuffer:d,sentCloseFrameState:h}=i(736);const{kReadyState:f,kSentClose:E,kResponse:p,kReceivedClose:C}=i(1216);const{channels:I}=i(2414);const{isValidStatusCode:m,isValidOpcode:B,failWebsocketConnection:Q,websocketMessageReceived:y,utf8Decode:w,isControlFrame:S,isTextBinaryFrame:b,isContinuationFrame:R}=i(8625);const{WebsocketFrameSend:D}=i(3264);const{closeWebSocketConnection:k}=i(6897);const{PerMessageDeflate:v}=i(9469);const{MessageSizeExceededError:T}=i(8707);function failWebsocketConnectionWithCode(t,n,i){k(t,n,i,Buffer.byteLength(i));Q(t,i)}class ByteParser extends A{#Z=[];#X=0;#ee=0;#te=false;#m=c.INFO;#re={};#ne=[];#se;#oe;#K;constructor(t,n,i={}){super();this.ws=t;this.#se=n==null?new Map:n;this.#oe=i.maxFragments??0;this.#K=i.maxPayloadSize??0;if(this.#se.has("permessage-deflate")){this.#se.set("permessage-deflate",new v(n,i))}}_write(t,n,i){this.#Z.push(t);this.#ee+=t.length;this.#te=true;this.run(i)}#ie(){if(this.#K>0&&!S(this.#re.opcode)&&this.#re.payloadLength+this.#X>this.#K){failWebsocketConnectionWithCode(this.ws,1009,"Payload size exceeds maximum allowed size");return false}return true}run(t){while(this.#te){if(this.#m===c.INFO){if(this.#ee<2){return t()}const n=this.consume(2);const i=(n[0]&128)!==0;const A=n[0]&15;const a=(n[1]&128)===128;const g=!i&&A!==l.CONTINUATION;const d=n[1]&127;const h=n[0]&64;const f=n[0]&32;const E=n[0]&16;if(!B(A)){Q(this.ws,"Invalid opcode received");return t()}if(a){Q(this.ws,"Frame cannot be masked");return t()}if(h!==0&&!this.#se.has("permessage-deflate")){Q(this.ws,"Expected RSV1 to be clear.");return}if(f!==0||E!==0){Q(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(g&&!b(A)){Q(this.ws,"Invalid frame type was fragmented.");return}if(b(A)&&this.#ne.length>0){Q(this.ws,"Expected continuation frame");return}if(this.#re.fragmented&&g){Q(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((d>125||g)&&S(A)){Q(this.ws,"Control frame either too large or fragmented");return}if(R(A)&&this.#ne.length===0&&!this.#re.compressed){Q(this.ws,"Unexpected continuation frame");return}if(d<=125){this.#re.payloadLength=d;this.#m=c.READ_DATA;if(!this.#ie()){return}}else if(d===126){this.#m=c.PAYLOADLENGTH_16}else if(d===127){this.#m=c.PAYLOADLENGTH_64}if(b(A)){this.#re.binaryType=A;this.#re.compressed=h!==0}this.#re.opcode=A;this.#re.masked=a;this.#re.fin=i;this.#re.fragmented=g}else if(this.#m===c.PAYLOADLENGTH_16){if(this.#ee<2){return t()}const n=this.consume(2);this.#re.payloadLength=n.readUInt16BE(0);this.#m=c.READ_DATA;if(!this.#ie()){return}}else if(this.#m===c.PAYLOADLENGTH_64){if(this.#ee<8){return t()}const n=this.consume(8);const i=n.readUInt32BE(0);const A=n.readUInt32BE(4);if(i!==0||A>2**31-1){Q(this.ws,"Received payload length > 2^31 bytes.");return}this.#re.payloadLength=A;this.#m=c.READ_DATA;if(!this.#ie()){return}}else if(this.#m===c.READ_DATA){if(this.#ee<this.#re.payloadLength){return t()}const n=this.consume(this.#re.payloadLength);if(S(this.#re.opcode)){this.#te=this.parseControlFrame(n);this.#m=c.INFO}else{if(!this.#re.compressed){if(!this.writeFragments(n)){return}if(this.#K>0&&this.#X>this.#K){failWebsocketConnectionWithCode(this.ws,1009,(new T).message);return}if(!this.#re.fragmented&&this.#re.fin){y(this.ws,this.#re.binaryType,this.consumeFragments())}this.#m=c.INFO}else{this.#se.get("permessage-deflate").decompress(n,this.#re.fin,(n,i)=>{if(n){const t=n instanceof T?1009:1007;Line truncated
//# sourceMappingURL=index.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"index.js","names":["awsEndpointFunctions","emitWarningIfUnsupportedVersion","emitWarningIfUnsupportedVersion$1","createDefaultUserAgentProvider","NODE_APP_ID_CONFIG_OPTIONS","getAwsRegionExtensionConfiguration","resolveAwsRegionExtensionConfiguration","resolveUserAgentConfig","resolveHostHeaderConfig","getUserAgentPlugin","getHostHeaderPlugin","getLoggerPlugin","getRecursionDetectionPlugin","__webpack_require__","getHttpAuthSchemeEndpointRuleSetPlugin","DefaultIdentityProviderConfig","getHttpSigningPlugin","createPaginator","normalizeProvider","getSmithyContext","ServiceException","NoOpLogger","loadConfigsForDefaultMode","getDefaultExtensionConfiguration","resolveDefaultRuntimeConfig","Client","makeBuilder","createWaiter","checkExceptions","WaiterState","createAggregatedClient","Command","$Command","__webpack_unused_export__","resolveDefaultsModeConfig","loadConfig","NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS","NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS","NODE_REGION_CONFIG_OPTIONS","NODE_REGION_CONFIG_FILE_OPTIONS","resolveRegionConfig","BinaryDecisionDiagram","EndpointCache","decideEndpoint","customEndpointFunctions","resolveEndpointConfig","getEndpointPlugin","parseUrl","getHttpHandlerExtensionConfiguration","resolveHttpHandlerRuntimeConfig","getContentLengthPlugin","DEFAULT_RETRY_MODE","NODE_RETRY_MODE_CONFIG_OPTIONS","NODE_MAX_ATTEMPT_CONFIG_OPTIONS","resolveRetryConfig","getRetryPlugin","TypeRegistry","getSchemaSerdePlugin","resolveAwsSdkSigV4Config","AwsSdkSigV4Signer","NODE_AUTH_SCHEME_PREFERENCE_OPTIONS","defaultProvider","toUtf8","fromUtf8","toBase64","fromBase64","calculateBodyLength","streamCollector","NodeHttpHandler","AwsJson1_1Protocol","Sha256","defaultECRHttpAuthSchemeParametersProvider","async","config","context","input","operation","region","Error","createAwsAuthSigv4HttpAuthOption","authParameters","schemeId","signingProperties","name","propertiesExtractor","defaultECRHttpAuthSchemeProvider","options","push","resolveHttpAuthSchemeConfig","config_0","Object","assign","authSchemePreference","resolveClientEndpointParameters","useDualstackEndpoint","useFipsEndpoint","defaultSigningName","commonParams","UseFIPS","type","Endpoint","Region","UseDualStack","version","packageInfo","m","a","b","c","d","e","f","g","h","i","fn","argv","j","k","l","_data","conditions","results","root","r","nodes","Int32Array","bdd","from","cache","size","params","defaultEndpointResolver","endpointParams","get","logger","aws","ECRServiceException","constructor","super","setPrototypeOf","this","prototype","InvalidParameterException","$fault","opts","RepositoryNotFoundException","ServerException","LimitExceededException","UnableToGetUpstreamImageException","ValidationException","EmptyUploadException","InvalidLayerException","KmsException","kmsError","LayerAlreadyExistsException","LayerPartTooSmallException","UploadNotFoundException","PullThroughCacheRuleAlreadyExistsException","SecretNotFoundException","UnableToAccessSecretException","UnableToDecryptSecretValueException","UnsupportedUpstreamRegistryException","InvalidTagParameterException","RepositoryAlreadyExistsException","TooManyTagsException","TemplateAlreadyExistsException","LifecyclePolicyNotFoundException","PullThroughCacheRuleNotFoundException","RegistryPolicyNotFoundException","RepositoryNotEmptyException","TemplateNotFoundException","RepositoryPolicyNotFoundException","SigningConfigurationNotFoundException","ExclusionNotFoundException","ImageNotFoundException","ScanNotFoundException","LayerInaccessibleException","LayersNotFoundException","UnableToGetUpstreamLayerException","LifecyclePolicyPreviewNotFoundException","UnableToListUpstreamImageReferrersException","ImageAlreadyExistsException","ImageDigestDoesNotMatchException","ImageTagAlreadyExistsException","ReferencedImagesNotFoundException","BlockedByOrganizationPolicyException","ExclusionAlreadyExistsException","ImageArchivedException","UnsupportedImageTypeException","LifecyclePolicyPreviewInProgressException","ImageStorageClassUpdateNotSupportedException","InvalidLayerPartException","registryId","repositoryName","uploadId","lastValidByteReceived","_A","_AD","_ADL","_AECID","_AL","_BBOPE","_BCLA","_BCLAR","_BCLARa","_BDI","_BDIR","_BDIRa","_BGI","_BGIR","_BGIRa","_BGRSC","_BGRSCR","_BGRSCRa","_CLU","_CLUR","_CLURo","_CPTCR","_CPTCRR","_CPTCRRr","_CR","_CRCT","_CRCTR","_CRCTRr","_CRR","_CRRr","_CS","_CSA","_CSAL","_CSD","_CSL","_DI","_DIF","_DIR","_DIRS","_DIRSR","_DIRSRe","_DIRe","_DISF","_DISFR","_DISFRe","_DISS","_DISSR","_DISSRe","_DLP","_DLPR","_DLPRe","_DPTCR","_DPTCRR","_DPTCRRe","_DPTCRRes","_DPTCRResc","_DPTCRe","_DPTUE","_DPTUER","_DPTUERe","_DR","_DRCT","_DRCTR","_DRCTRe","_DRCTRes","_DRCTResc","_DRCTe","_DRP","_DRPR","_DRPRe","_DRPRel","_DRPRele","_DRPe","_DRR","_DRRe","_DRRes","_DRResc","_DRRescr","_DRRescri","_DRe","_DRes","_DSC","_DSCR","_DSCRe","_EAEE","_EC","_ECFRCT","_EISF","_EISFL","_ENFE","_EUE","_GAS","_GASR","_GASRe","_GAT","_GATR","_GATRe","_GDUFL","_GDUFLR","_GDUFLRe","Line truncated
{"version":3,"file":"index.js","names":["awsEndpointFunctions","emitWarningIfUnsupportedVersion","emitWarningIfUnsupportedVersion$1","createDefaultUserAgentProvider","NODE_APP_ID_CONFIG_OPTIONS","getAwsRegionExtensionConfiguration","resolveAwsRegionExtensionConfiguration","resolveUserAgentConfig","resolveHostHeaderConfig","getUserAgentPlugin","getHostHeaderPlugin","getLoggerPlugin","getRecursionDetectionPlugin","__webpack_require__","getHttpAuthSchemeEndpointRuleSetPlugin","DefaultIdentityProviderConfig","getHttpSigningPlugin","createPaginator","normalizeProvider","getSmithyContext","ServiceException","NoOpLogger","loadConfigsForDefaultMode","getDefaultExtensionConfiguration","resolveDefaultRuntimeConfig","Client","makeBuilder","createWaiter","checkExceptions","WaiterState","createAggregatedClient","Command","$Command","__webpack_unused_export__","resolveDefaultsModeConfig","loadConfig","NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS","NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS","NODE_REGION_CONFIG_OPTIONS","NODE_REGION_CONFIG_FILE_OPTIONS","resolveRegionConfig","BinaryDecisionDiagram","EndpointCache","decideEndpoint","customEndpointFunctions","resolveEndpointConfig","getEndpointPlugin","parseUrl","getHttpHandlerExtensionConfiguration","resolveHttpHandlerRuntimeConfig","getContentLengthPlugin","DEFAULT_RETRY_MODE","NODE_RETRY_MODE_CONFIG_OPTIONS","NODE_MAX_ATTEMPT_CONFIG_OPTIONS","resolveRetryConfig","getRetryPlugin","TypeRegistry","getSchemaSerdePlugin","resolveAwsSdkSigV4Config","AwsSdkSigV4Signer","NODE_AUTH_SCHEME_PREFERENCE_OPTIONS","defaultProvider","toUtf8","fromUtf8","toBase64","fromBase64","calculateBodyLength","streamCollector","NodeHttpHandler","AwsJson1_1Protocol","Sha256","defaultECRHttpAuthSchemeParametersProvider","async","config","context","input","operation","region","Error","createAwsAuthSigv4HttpAuthOption","authParameters","schemeId","signingProperties","name","propertiesExtractor","defaultECRHttpAuthSchemeProvider","options","push","resolveHttpAuthSchemeConfig","config_0","Object","assign","authSchemePreference","resolveClientEndpointParameters","useDualstackEndpoint","useFipsEndpoint","defaultSigningName","commonParams","UseFIPS","type","Endpoint","Region","UseDualStack","version","packageInfo","m","a","b","c","d","e","f","g","h","i","fn","argv","j","k","l","_data","conditions","results","root","r","nodes","Int32Array","bdd","from","cache","size","params","defaultEndpointResolver","endpointParams","get","logger","aws","ECRServiceException","constructor","super","setPrototypeOf","this","prototype","InvalidParameterException","$fault","opts","RepositoryNotFoundException","ServerException","LimitExceededException","UnableToGetUpstreamImageException","ValidationException","EmptyUploadException","InvalidLayerException","KmsException","kmsError","LayerAlreadyExistsException","LayerPartTooSmallException","UploadNotFoundException","PullThroughCacheRuleAlreadyExistsException","SecretNotFoundException","UnableToAccessSecretException","UnableToDecryptSecretValueException","UnsupportedUpstreamRegistryException","InvalidTagParameterException","RepositoryAlreadyExistsException","TooManyTagsException","TemplateAlreadyExistsException","LifecyclePolicyNotFoundException","PullThroughCacheRuleNotFoundException","RegistryPolicyNotFoundException","RepositoryNotEmptyException","TemplateNotFoundException","RepositoryPolicyNotFoundException","SigningConfigurationNotFoundException","ExclusionNotFoundException","ImageNotFoundException","ScanNotFoundException","LayerInaccessibleException","LayersNotFoundException","UnableToGetUpstreamLayerException","LifecyclePolicyPreviewNotFoundException","UnableToListUpstreamImageReferrersException","ImageAlreadyExistsException","ImageDigestDoesNotMatchException","ImageTagAlreadyExistsException","ReferencedImagesNotFoundException","BlockedByOrganizationPolicyException","ExclusionAlreadyExistsException","ImageArchivedException","UnsupportedImageTypeException","LifecyclePolicyPreviewInProgressException","ImageStorageClassUpdateNotSupportedException","InvalidLayerPartException","registryId","repositoryName","uploadId","lastValidByteReceived","_A","_AD","_ADL","_AECID","_AL","_BBOPE","_BCLA","_BCLAR","_BCLARa","_BDI","_BDIR","_BDIRa","_BGI","_BGIR","_BGIRa","_BGRSC","_BGRSCR","_BGRSCRa","_CLU","_CLUR","_CLURo","_CPTCR","_CPTCRR","_CPTCRRr","_CR","_CRCT","_CRCTR","_CRCTRr","_CRR","_CRRr","_CS","_CSA","_CSAL","_CSD","_CSL","_DI","_DIF","_DIR","_DIRS","_DIRSR","_DIRSRe","_DIRe","_DISF","_DISFR","_DISFRe","_DISS","_DISSR","_DISSRe","_DLP","_DLPR","_DLPRe","_DPTCR","_DPTCRR","_DPTCRRe","_DPTCRRes","_DPTCRResc","_DPTCRe","_DPTUE","_DPTUER","_DPTUERe","_DR","_DRCT","_DRCTR","_DRCTRe","_DRCTRes","_DRCTResc","_DRCTe","_DRP","_DRPR","_DRPRe","_DRPRel","_DRPRele","_DRPe","_DRR","_DRRe","_DRRes","_DRResc","_DRRescr","_DRRescri","_DRe","_DRes","_DSC","_DSCR","_DSCRe","_EAEE","_EC","_ECFRCT","_EISF","_EISFL","_ENFE","_EUE","_GAS","_GASR","_GASRe","_GAT","_GATR","_GATRe","_GDUFL","_GDUFLR","_GDUFLRe","Line truncated
+13 -4
View File
@@ -29,11 +29,20 @@ function getAccountID(registry: string): string {
}
export async function getECRToken(registry: string, username: string, password: string): Promise<ECRData> {
// Support AWS OIDC temporary credentials by including the session token
// when available (set by aws-actions/configure-aws-credentials)
const sessionToken = process.env.AWS_SESSION_TOKEN;
const credentials: { accessKeyId: string; secretAccessKey: string; sessionToken?: string } = {
accessKeyId: username,
secretAccessKey: password,
};
if (sessionToken) {
credentials.sessionToken = sessionToken;
core.info("Using AWS session token from environment for ECR authentication");
}
const ecr = new ECR({
credentials: {
accessKeyId: username,
secretAccessKey: password,
},
credentials,
region: getRegion(registry),
});
+17 -7
View File
@@ -32,7 +32,7 @@ async function run(): Promise<void> {
throw new Error("❌ Only supported on linux platform");
}
registry = core.getInput(Inputs.REGISTRY, { required: true });
registry = core.getInput(Inputs.REGISTRY, { required: true }).toLowerCase();
let username = core.getInput(Inputs.USERNAME, { required: true });
let password = core.getInput(Inputs.PASSWORD, { required: true });
const logout = core.getInput(Inputs.LOGOUT) || "true";
@@ -67,7 +67,7 @@ async function run(): Promise<void> {
if (authFilePath) {
args.push(`--authfile=${authFilePath}`);
}
await execute(await getPodmanPath(), args);
const loginResult = await execute(await getPodmanPath(), args);
core.info(`✅ Successfully logged in to ${registry} as ${username}`);
// Setting REGISTRY_AUTH_FILE environment variable as buildah needs
@@ -78,12 +78,22 @@ async function run(): Promise<void> {
podmanAuthFilePath = authFilePath;
}
else {
// process.getuid might be undefined
let authFileDir = path.join("/", "tmp", `podman-run-${process.getuid ? process.getuid() : null}`);
if (process.env.XDG_RUNTIME_DIR) {
authFileDir = process.env.XDG_RUNTIME_DIR;
// Parse the auth file path from podman's --verbose output (e.g. "Used: /path/to/auth.json")
// rather than hardcoding it, since the path varies across podman versions and environments.
const usedMatch = loginResult.stdout.match(/Used:\s+(.+)/);
if (usedMatch) {
podmanAuthFilePath = usedMatch[1].trim();
core.info(`Detected auth file from podman output: ${podmanAuthFilePath}`);
}
else {
// Fallback: construct the path from XDG_RUNTIME_DIR or the default podman location
let authFileDir = path.join("/", "tmp", `podman-run-${process.getuid ? process.getuid() : 0}`);
if (process.env.XDG_RUNTIME_DIR) {
authFileDir = process.env.XDG_RUNTIME_DIR;
}
podmanAuthFilePath = path.join(authFileDir, "containers", "auth.json");
core.warning(`Could not detect auth file path from podman output, using fallback: ${podmanAuthFilePath}`);
}
podmanAuthFilePath = path.join(authFileDir, "containers", "auth.json");
}
const REGISTRY_AUTH_ENVVAR = "REGISTRY_AUTH_FILE";
core.info(`Exporting ${REGISTRY_AUTH_ENVVAR}=${podmanAuthFilePath}`);