Skip to content

Conversation

@meierj-wayscript
Copy link
Contributor

@meierj-wayscript meierj-wayscript commented Dec 15, 2021

Change description

Support looking up user detail via application key.

Tested with http trigger lair:

# my-lair-a > api.py

import os
from wayscript.triggers import http_trigger

from wayscript import context, utils

application_key = utils.get_application_key()
user = context.get_user_by_application_key(application_key)

payload = {"hello": "world", "key": os.environ.get("WAYSCRIPT_EXECUTION_USER_APPLICATION_KEY"), "user": user}
headers = {"content-type": "application/json"}
status_code = 200

http_trigger.send_response(data=payload, headers=headers, status_code=status_code)

Checklist

  • Application changes have been tested and automated tests have been added, if applicable
  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Related issues

Fixes #xxxx

jeffbuswell
jeffbuswell previously approved these changes Dec 15, 2021
Copy link
Contributor

@jeffbuswell jeffbuswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@jeffbuswell jeffbuswell dismissed their stale review December 15, 2021 18:51

missed something

Copy link
Contributor

@jeffbuswell jeffbuswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@meierj-wayscript meierj-wayscript merged commit 55abcf4 into wayscript:master Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants