Skip to content

Files

Latest commit

67fa8b6 · Jun 7, 2022

History

History
16 lines (12 loc) · 771 Bytes

hello.md

File metadata and controls

16 lines (12 loc) · 771 Bytes

Oh, Hello There 👋

This API is the most simple - it simply returns to you a greating followed by your name and role. The OBLV enclave proxy adds the header fields X-OBLV-User-Name and X-OBLV-User-Role during the authentication and authorization of traffic into the enclave. You can read from them in FastAPI easily like this:

@router.get("/")
def hello(
    x_oblv_user_name: str = Header(default=None),
    x_oblv_user_role: str = Header(default=None)
):
  # main logic

⚠️ Note: you'll see in the example code we validate the are not None. While this should never be the case for incoming traffic, it's best to minimize the trust dependancies when possible.

The full code can be found here.