Ejemplo n.º 1
0
        public async Task <string> GetLogout()
        {
            var user = securityContext.GetUser();
            await userLogic.Logout(user.UserName);

            return(Jsoner.Ok());
        }
Ejemplo n.º 2
0
        public string GetPresignedUrl(string docId, string area, [FromBody] GetPresignedUrlDTO dto)
        {
            // Could come from request as well
            var key  = docId + "/" + area + "/" + dto.FileName;
            var user = securityContext.GetUser();

            Console.WriteLine("Fetched user's data");
            Console.WriteLine(user.GivenName);
            Console.WriteLine(user.Id);
            var metadata = new Dictionary <string, string>
            {
                { "userId", user.Id }
            };
            var url = s3.GeneratePreSignedURLForPut(key, dto, metadata);

            return(Jsoner.Convert(new { url, key }));
        }
Ejemplo n.º 3
0
        public string GetDecodedJwt()
        {
            var obj = new
            {
                user        = securityContext.GetUser(),
                docId       = securityContext.GetDocId(),
                permissions = securityContext.GetPermissions()
            };

            return(Jsoner.Convert(obj));
        }