https://kotlinlang.org logo
#ktor
Title
# ktor
f

fkrauthan

09/08/2020, 4:42 AM
For my question above about passing in dynamic values to a Feature. I just found the concept of attributes. Would the idea be to inject the dynamic auth based on user session into an attribute and then read the attribute in my custom auth feature to set the correct header information? or is the attribute system intended for something else?
e

efemoney

09/08/2020, 7:41 AM
Its not intended for anything else other than whatever you deem fit.
Attributes
is a map with strongly typed keys that you can attach at any scope (application level or at the call level). Use it to tie whatever data makes sense at those levels to the scopes. I use it to hold my DI graph for example https://kotlinlang.slack.com/archives/C0A974TJ9/p1598867898018000?thread_ts=1598866210.017100&cid=C0A974TJ9
2 Views