Skip to content

Commit c7328f9

Browse files
committed
feat(auth): add support for MCSP V2 authentication
This commit adds the MCSPV2Authenticator implementation. This authenticator will invoke the MCSP V2 POST /api/2.0/{scopeCollectionType}/{scopeId}/apikeys/token operation to obtain an access token for an apikey. Signed-off-by: Phil Adams <[email protected]>
1 parent e140488 commit c7328f9

13 files changed

+2052
-226
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# semantic-release is also run to create a new release (if
44
# warranted by the new commits being built).
55

6-
name: Build/Test/Publish
6+
name: build
77

88
on:
99
push:
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
detect-secrets:
1818
if: "!contains(github.event.head_commit.message, '[skip ci]')"
19-
name: Detect-Secrets
19+
name: detect-secrets
2020
runs-on: ubuntu-latest
2121

2222
steps:
@@ -38,8 +38,8 @@ jobs:
3838
detect-secrets -v audit --report --fail-on-unaudited --fail-on-live --fail-on-audited-real .secrets.baseline
3939
4040
build:
41+
name: build-test (go v${{ matrix.go-version }})
4142
needs: detect-secrets
42-
name: Build/Test (Go v${{ matrix.go-version }})
4343
runs-on: ubuntu-latest
4444
strategy:
4545
matrix:
@@ -64,8 +64,8 @@ jobs:
6464
run: make all
6565

6666
publish-release:
67+
name: semantic-release
6768
needs: build
68-
name: Semantic-Release
6969
if: "github.ref_name == 'main' && github.event_name != 'pull_request'"
7070
runs-on: ubuntu-latest
7171

.secrets.baseline

Lines changed: 91 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|package-lock.json|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-03-06T22:25:59Z",
6+
"generated_at": "2025-05-27T21:35:43Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -82,63 +82,63 @@
8282
"hashed_secret": "91dfd9ddb4198affc5c194cd8ce6d338fde470e2",
8383
"is_secret": false,
8484
"is_verified": false,
85-
"line_number": 83,
85+
"line_number": 84,
8686
"type": "Secret Keyword",
8787
"verified_result": null
8888
},
8989
{
9090
"hashed_secret": "e0d246cf37df7d1a561ed649d108dd14f36f28bf",
9191
"is_secret": false,
9292
"is_verified": false,
93-
"line_number": 243,
93+
"line_number": 244,
9494
"type": "Secret Keyword",
9595
"verified_result": null
9696
},
9797
{
9898
"hashed_secret": "4f51cde3ac0a5504afa4bc06859b098366592c19",
9999
"is_secret": false,
100100
"is_verified": false,
101-
"line_number": 312,
101+
"line_number": 313,
102102
"type": "Secret Keyword",
103103
"verified_result": null
104104
},
105105
{
106106
"hashed_secret": "e87559ed7decb62d0733ae251ae58d42a55291d8",
107107
"is_secret": false,
108108
"is_verified": false,
109-
"line_number": 314,
109+
"line_number": 315,
110110
"type": "Secret Keyword",
111111
"verified_result": null
112112
},
113113
{
114114
"hashed_secret": "12f4a68ed3d0863e56497c9cdb1e2e4e91d5cb68",
115115
"is_secret": false,
116116
"is_verified": false,
117-
"line_number": 381,
117+
"line_number": 382,
118118
"type": "Secret Keyword",
119119
"verified_result": null
120120
},
121121
{
122122
"hashed_secret": "c837b75d7cd93ef9c2243ca28d6e5156259fd253",
123123
"is_secret": false,
124124
"is_verified": false,
125-
"line_number": 385,
125+
"line_number": 386,
126126
"type": "Secret Keyword",
127127
"verified_result": null
128128
},
129129
{
130130
"hashed_secret": "98635b2eaa2379f28cd6d72a38299f286b81b459",
131131
"is_secret": false,
132132
"is_verified": false,
133-
"line_number": 694,
133+
"line_number": 697,
134134
"type": "Secret Keyword",
135135
"verified_result": null
136136
},
137137
{
138138
"hashed_secret": "47fcf185ee7e15fe05cae31fbe9e4ebe4a06a40d",
139139
"is_secret": false,
140140
"is_verified": false,
141-
"line_number": 837,
141+
"line_number": 961,
142142
"type": "Secret Keyword",
143143
"verified_result": null
144144
}
@@ -148,7 +148,7 @@
148148
"hashed_secret": "bc2f74c22f98f7b6ffbc2f67453dbfa99bce9a32",
149149
"is_secret": false,
150150
"is_verified": false,
151-
"line_number": 900,
151+
"line_number": 921,
152152
"type": "Secret Keyword",
153153
"verified_result": null
154154
}
@@ -287,18 +287,18 @@
287287
"verified_result": null
288288
},
289289
{
290-
"hashed_secret": "f2e7745f43b0ef0e2c2faf61d6c6a28be2965750",
290+
"hashed_secret": "333f0f8814d63e7268f80e1e65e7549137d2350c",
291291
"is_secret": false,
292292
"is_verified": false,
293-
"line_number": 91,
293+
"line_number": 95,
294294
"type": "Secret Keyword",
295295
"verified_result": null
296296
},
297297
{
298-
"hashed_secret": "333f0f8814d63e7268f80e1e65e7549137d2350c",
298+
"hashed_secret": "f2e7745f43b0ef0e2c2faf61d6c6a28be2965750",
299299
"is_secret": false,
300300
"is_verified": false,
301-
"line_number": 95,
301+
"line_number": 99,
302302
"type": "Secret Keyword",
303303
"verified_result": null
304304
}
@@ -352,15 +352,15 @@
352352
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
353353
"is_secret": false,
354354
"is_verified": false,
355-
"line_number": 47,
355+
"line_number": 48,
356356
"type": "Secret Keyword",
357357
"verified_result": null
358358
},
359359
{
360360
"hashed_secret": "8318df9ecda039deac9868adf1944a29a95c7114",
361361
"is_secret": false,
362362
"is_verified": false,
363-
"line_number": 50,
363+
"line_number": 51,
364364
"type": "Secret Keyword",
365365
"verified_result": null
366366
}
@@ -370,15 +370,15 @@
370370
"hashed_secret": "3c81615afb40d1889fc2e1fff551a8b59b4e80ce",
371371
"is_secret": false,
372372
"is_verified": false,
373-
"line_number": 103,
373+
"line_number": 104,
374374
"type": "Secret Keyword",
375375
"verified_result": null
376376
},
377377
{
378378
"hashed_secret": "8b142a91cfb6e617618ad437cedf74a6745f8926",
379379
"is_secret": false,
380380
"is_verified": false,
381-
"line_number": 146,
381+
"line_number": 147,
382382
"type": "Secret Keyword",
383383
"verified_result": null
384384
}
@@ -785,7 +785,7 @@
785785
"verified_result": null
786786
}
787787
],
788-
"core/mcsp_authenticator.go": [
788+
"core/mcsp_v1_authenticator.go": [
789789
{
790790
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
791791
"is_secret": false,
@@ -795,7 +795,7 @@
795795
"verified_result": null
796796
}
797797
],
798-
"core/mcsp_authenticator_test.go": [
798+
"core/mcsp_v1_authenticator_test.go": [
799799
{
800800
"hashed_secret": "fd08cd887ed1de2f2d3e175117ff607ca65187ae",
801801
"is_secret": false,
@@ -829,7 +829,7 @@
829829
"verified_result": null
830830
},
831831
{
832-
"hashed_secret": "4c809455939f19c33c732b56a8417e509f4885e8",
832+
"hashed_secret": "2fa5b9304c564f31008dd097866b35c60f0980d4",
833833
"is_secret": false,
834834
"is_verified": false,
835835
"line_number": 652,
@@ -845,6 +845,74 @@
845845
"verified_result": null
846846
}
847847
],
848+
"core/mcsp_v2_authenticator.go": [
849+
{
850+
"hashed_secret": "f9d5d001f81190ef57627bee87c6d5df2d1ba217",
851+
"is_secret": false,
852+
"is_verified": false,
853+
"line_number": 104,
854+
"type": "Secret Keyword",
855+
"verified_result": null
856+
},
857+
{
858+
"hashed_secret": "e19c2ac701d392407b565d6ac8078b81c83e605c",
859+
"is_secret": false,
860+
"is_verified": false,
861+
"line_number": 471,
862+
"type": "Secret Keyword",
863+
"verified_result": null
864+
}
865+
],
866+
"core/mcsp_v2_authenticator_test.go": [
867+
{
868+
"hashed_secret": "fd08cd887ed1de2f2d3e175117ff607ca65187ae",
869+
"is_secret": false,
870+
"is_verified": false,
871+
"line_number": 34,
872+
"type": "Secret Keyword",
873+
"verified_result": null
874+
},
875+
{
876+
"hashed_secret": "d03d939c22ad66a948ec8b4649add9b12b8a3cf6",
877+
"is_secret": false,
878+
"is_verified": false,
879+
"line_number": 39,
880+
"type": "JSON Web Token",
881+
"verified_result": null
882+
},
883+
{
884+
"hashed_secret": "5dcb6cb71ea20f1a58387e3d36d77bd123eb9f3b",
885+
"is_secret": false,
886+
"is_verified": false,
887+
"line_number": 40,
888+
"type": "JSON Web Token",
889+
"verified_result": null
890+
},
891+
{
892+
"hashed_secret": "c08671cefbe84838efadd488574e59117309ec4c",
893+
"is_secret": false,
894+
"is_verified": false,
895+
"line_number": 848,
896+
"type": "Secret Keyword",
897+
"verified_result": null
898+
},
899+
{
900+
"hashed_secret": "e44092184ab442f6e6a04359c165fcf45f8e90c4",
901+
"is_secret": false,
902+
"is_verified": false,
903+
"line_number": 849,
904+
"type": "Secret Keyword",
905+
"verified_result": null
906+
},
907+
{
908+
"hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed",
909+
"is_secret": false,
910+
"is_verified": false,
911+
"line_number": 875,
912+
"type": "Secret Keyword",
913+
"verified_result": null
914+
}
915+
],
848916
"core/utils_test.go": [
849917
{
850918
"hashed_secret": "0266262f439c732a31b9353ced05c9e777a07c54",
@@ -968,15 +1036,15 @@
9681036
"hashed_secret": "f2e7745f43b0ef0e2c2faf61d6c6a28be2965750",
9691037
"is_secret": false,
9701038
"is_verified": false,
971-
"line_number": 95,
1039+
"line_number": 102,
9721040
"type": "Secret Keyword",
9731041
"verified_result": null
9741042
},
9751043
{
9761044
"hashed_secret": "9e2659aa7e2b335ec6bdcf180f3b6f41f5191af5",
9771045
"is_secret": false,
9781046
"is_verified": false,
979-
"line_number": 102,
1047+
"line_number": 115,
9801048
"type": "Secret Keyword",
9811049
"verified_result": null
9821050
}

0 commit comments

Comments
 (0)