Ejemplo n.º 1
0
        private string GerarUrl(coredto.empresas.TwitchInfo twitchInfo)
        {
            var urlbase = new Uri(twitchSettings.UrlApi);
            var url     = new Uri(urlbase, string.Format(twitchSettings.WhisperPathApi, twitchInfo.ChannelId));

            return(url.ToString());
        }
Ejemplo n.º 2
0
        private Dictionary <string, string> GerarHeader(coredto.empresas.TwitchInfo twitchInfo, string token)
        {
            var headers = new Dictionary <string, string>
            {
                { "Authorization", "Bearer " + token },
                { "client-id", twitchInfo.ClientId },
                { "content-type", "application/json" }
            };

            return(headers);
        }
Ejemplo n.º 3
0
        private Dictionary <string, object> GerarClaims(coredto.Perfil perfil, coredto.empresas.TwitchInfo twitchInfo)
        {
            var claims = new Dictionary <string, object>();

            claims["ex"]           = corehelper.DateTimeHelper.Timestamp(new TimeSpan(6, 0, 0));
            claims["user_id"]      = perfil.PerfilId;
            claims["role"]         = "external";
            claims["channel_id"]   = twitchInfo.ChannelId;
            claims["pubsub_perms"] = new
            {
                listen = new string[] { $"whisper-U{perfil.PerfilId}" },
                send   = new string[] { "whisper-*" }
            };

            return(claims);
        }