-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/4.x] Cherry pick: Update TypeScript to expose COSE authentic…
- Loading branch information
CCF [bot]
authored
Jun 29, 2023
1 parent
959ed5d
commit 92d08bc
Showing
9 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as ccfapp from "@microsoft/ccf-app"; | ||
|
||
// Note: this is also tested more generically on the multi_auth endpoint | ||
// of the logging application, but not with TypeScript types. | ||
export function checkUserCOSESign1Auth( | ||
request: ccfapp.Request | ||
): ccfapp.Response { | ||
if (request.caller === null || request.caller === undefined) { | ||
return { status: 401 }; | ||
} | ||
|
||
const caller = request.caller; | ||
if (caller.policy !== "user_cose_sign1") { | ||
return { status: 401 }; | ||
} | ||
|
||
const id: ccfapp.UserCOSESign1AuthnIdentity = caller; | ||
return { status: 200, body: id.id }; | ||
} |