i-come-bearing-presence

所属分类:交通/航空行业
开发工具:C#
文件大小:0KB
下载次数:0
上传日期:2023-10-18 20:56:33
上 传 者sh-1993
说明:  团队前往飞利浦休伊中心
(Teams presence to philips hue hub)

文件列表:
ComeBearingPresence.Func/ (0, 2020-12-04)
ComeBearingPresence.Func/Assets/ (0, 2020-12-04)
ComeBearingPresence.Func/Assets/authend.html (1241, 2020-12-04)
ComeBearingPresence.Func/CloudTableExtensions.cs (1653, 2020-12-04)
ComeBearingPresence.Func/ComeBearingPresence.Func.csproj (2543, 2020-12-04)
ComeBearingPresence.Func/GlobalSuppressions.cs (5524, 2020-12-04)
ComeBearingPresence.Func/Model/ (0, 2020-12-04)
ComeBearingPresence.Func/Model/TableTokenCacheItem.cs (346, 2020-12-04)
ComeBearingPresence.Func/Model/UserPresence.cs (396, 2020-12-04)
ComeBearingPresence.Func/Model/UserPresenceRequest.cs (430, 2020-12-04)
ComeBearingPresence.Func/PresencePublisher.cs (10239, 2020-12-04)
ComeBearingPresence.Func/Startup.cs (4842, 2020-12-04)
ComeBearingPresence.Func/TokenCache/ (0, 2020-12-04)
ComeBearingPresence.Func/TokenCache/ITokenCacheAccessor.cs (538, 2020-12-04)
ComeBearingPresence.Func/TokenCache/MsalClientFactory.cs (2486, 2020-12-04)
ComeBearingPresence.Func/TokenCache/MsalOptions.cs (469, 2020-12-04)
ComeBearingPresence.Func/TokenCache/PerUserTableTokenCacheAccessor.cs (3812, 2020-12-04)
ComeBearingPresence.Func/TokenCache/TokenCacheExtensions.cs (671, 2020-12-04)
ComeBearingPresence.Func/host.json (175, 2020-12-04)
ComeBearingPresence.Func/proxies.json (311, 2020-12-04)
ComeBearingPresence.sln (1888, 2020-12-04)
LocalHueHubSubscriber.Func/ (0, 2020-12-04)
LocalHueHubSubscriber.Func/.dockerignore (19, 2020-12-04)
LocalHueHubSubscriber.Func/.env.local (204, 2020-12-04)
LocalHueHubSubscriber.Func/Dockerfile (601, 2020-12-04)
LocalHueHubSubscriber.Func/Function1.cs (2458, 2020-12-04)
LocalHueHubSubscriber.Func/LocalHueHubSubscriber.Func.csproj (714, 2020-12-04)
LocalHueHubSubscriber.Func/host.json (24, 2020-12-04)

# i-come-bearing-presence An idea for publishing presence data from Teams to various subscribers. This way a single polling mechanism can send to _n_ clients with a single poller. Eventually presence will get push/change notification support in graph. # AAD requirements You'll need the `Presence.Read` permission, which requires admin consent - something that may be difficult to come by. This example is slightly different in that the function itself is handling the interactivity & token acquisition, caching tokens in MSAL in Table storage. The authorization URL is generated, including `offline_access` to get a refresh token, the user is redirected, then we consume the authorization_code via msal on the return trip. No implicit! This is all form_post. Once the tokens are acquired, it starts polling every 30 seconds for new changes to presence. There's a balance here - 30 seconds is sorta slow but running a timer function every second might be more than you're willing to spend ($0.40 at last check, for ~2.6m executions). Cost consideration is probably more important around storage txns rather than function execution, since msal's token cache accessors access more than once on a single retrieval - so each run is ~3-4 storage txns. More on the token cache - the token cache should be _per user_ in msal, but we lack an effective way to know the user without a hydrated `Account` - it's sort of chicken and egg, although not really - things like `login_hint` could be used, since this is background work that doesn't have a user issuing actual requests to it - but more on that later. # token cache This is sort of a mess - since there is no way I can see to use a cache lookup key per request, instead I've gone with the nuclear option of transient CCAs for each user, with a wrapper around the `BeforeAccess` and `AfterAccess` setters to configure them to a specific key. It's messy and I really don't like constantly creating and trashing those CCAs, but it's 2020 and memory is cheap, i guess :/

近期下载者

相关文件


收藏者