@vizamodo/aws-sts-core 0.1.34 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/sts/issue.js +16 -2
  2. package/package.json +1 -1
package/dist/sts/issue.js CHANGED
@@ -87,7 +87,7 @@ export async function issueAwsCredentials(input) {
87
87
  "Content-Type": "application/json",
88
88
  "X-Amz-Date": amzDate,
89
89
  "X-Amz-X509-Chain": normalizedCert,
90
- "Authorization": `AWS4-X509-ECDSA-SHA256 Credential=${roleArn}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signatureHex}`
90
+ "Authorization": `AWS4-X509-ECDSA-SHA256 Credential=${profileArn}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signatureHex}`
91
91
  });
92
92
  // 6. Execution (fetch)
93
93
  try {
@@ -98,6 +98,20 @@ export async function issueAwsCredentials(input) {
98
98
  });
99
99
  if (!res.ok) {
100
100
  const errorBody = await res.text();
101
+ // ---- Local curl debug command (FULL MATERIAL - ROTATE AFTER DEBUG) ----
102
+ const localCurlCommand = [
103
+ `curl -X POST "https://${host}${path}" \\`,
104
+ ` -H "Content-Type: application/json" \\`,
105
+ ` -H "X-Amz-Date: ${amzDate}" \\`,
106
+ ` -H "X-Amz-X509-Chain: ${normalizedCert}" \\`,
107
+ ` -H "Authorization: AWS4-X509-ECDSA-SHA256 Credential=${profileArn}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signatureHex}" \\`,
108
+ ` -d '${body}'`
109
+ ].join("\n");
110
+ console.error("[aws-rejected][LOCAL-CURL-COMMAND]", localCurlCommand);
111
+ console.error("[aws-rejected][RAW-SIGNING-MATERIAL]", {
112
+ certBase64,
113
+ privateKeyPkcs8Base64
114
+ });
101
115
  console.error("[aws-rejected][FULL-REQUEST-DUMP]", {
102
116
  status: res.status,
103
117
  statusText: res.statusText,
@@ -127,7 +141,7 @@ export async function issueAwsCredentials(input) {
127
141
  "Content-Type": "application/json",
128
142
  "X-Amz-Date": amzDate,
129
143
  "X-Amz-X509-Chain": normalizedCert,
130
- "Authorization": `AWS4-X509-ECDSA-SHA256 Credential=${roleArn}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signatureHex}`
144
+ "Authorization": `AWS4-X509-ECDSA-SHA256 Credential=${profileArn}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signatureHex}`
131
145
  }
132
146
  });
133
147
  throw new InternalError("aws_rejected");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizamodo/aws-sts-core",
3
- "version": "0.1.34",
3
+ "version": "0.1.38",
4
4
  "description": "Pure AWS STS + SigV4 (X509 Roles Anywhere) core logic",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",