Postagens

Mostrando postagens de 2018

(resolvido) Visual Studio 2017 não consegue executar comandos em repositórios git do BitBucket

Imagem
Problema Após uma atualização do Visual Studio 2017 não é possível mais executar comandos (push de commits por exemplo) em repositórios git no BitBucket. O problema aparentemente ocorre apenas para repositórios BitBucket , testei no GitLab e não foi preciso essa intervenção. Não testei outros, mas em pesquisas que fiz realmente só ocorre no citado. Obs: utilizando o cliente GitTortoise não tive problemas, mas a idéia é resolver a execução de comandos de dentro do Visual Studio. Solução A Microsoft liberou uma atualização do Git Credential Manager que resolve esse problema, mas são necessários alguns passos com a atualização dos arquivos que são acessados pelo Visual Studio. 1 - Baixar e instalar a versão 1.18.0 (1 de outubro) do Git Credential Manager Obs.: também havia testado com a versão 1.17.1 (9 de agosto) com sucesso. https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.18.0 Bug Fixes: Ensure the Bitbucket login screen c...

Prevent Cross-Site Request Forgery (XSRF/CSRF) attacks in ASP.NET Core 2.x and jQuery

Microsoft has greatly simplified ASP.NET Core 2.x implementation of the security implementation on out-of-site request spoofing, that is, someone forging the POST / PUT from another location. By definition, for the GET and TRACE method there is no protection for this scenario. With a few simple steps you will be able to implement this level of security in your web application. 1 - In the HTML form of your application add: @Html.AntiForgeryToken() 2 - In the class Controller add the attribute: AutoValidateAntiforgeryToken So all the methods of the class will be under protection. Optionally you can work individually by adding to each method the attribute: ValidateAntiForgeryToken Also worth using the attribute: IgnoreAntiforgeryToken 4 - In the jQuery Ajax call:      beforeSend: function (xhr) {             xhr.setRequestHeader("XSRF-TOKEN", $('input:hidden[name="__RequestVerificationToken"]').val());  ...

Offline Storage for Progressive Web Apps

Imagem
Offline Storage for Progressive Web Apps The Pokedex.org Progressive Web App uses IndexedDB for application state and the Pokemon data set while the Cache API is used for URL addressable resources. 2016 will hopefully be the year we build for  network resilience . Internet connections can be  flakey  or non-existent on the go, which is why offline support and reliable performance are common features in  Progressive Web Apps . In this post, I’ll summarize some ideas around  offline data storage   for PWAs — think the JSON payloads, images and general static data required to provide a  meaningful  experience offline. A recommendation for storing data offline: For  URL addressable resources , use the  Cache API  (part of  Service Worker ). For all other data, use  IndexedDB  (with a  Promises  wrapper). Some quick answers to common questions on why: Both APIs are asynchr...