Devise - RSLA - 13oct2009
-
Upload
plataformatec -
Category
Technology
-
view
1.025 -
download
1
description
Transcript of Devise - RSLA - 13oct2009
![Page 1: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/1.jpg)
Plataforma 2009
Autenticação flexível com Devise
http://github.com/plataformatec/devise
![Page 2: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/2.jpg)
![Page 3: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/3.jpg)
Plataforma 2009
Soluções Existentes
![Page 4: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/4.jpg)
Plataforma 2009
Clearance
Pontos positivos• Estrutura completa, como engine (MVC)• Confirmação de conta• Recuperação de senha
Pontos negativos• Pouco flexível (apenas model User)• Não modularizado
![Page 5: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/5.jpg)
Plataforma 2009
Authlogic
Pontos positivos• Modelo bem flexível• Criptografia• Magic columns
Pontos negativos• Não é solução completa (MVC) como o Clearance• Trata a sessão como modelo
![Page 6: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/6.jpg)
Plataforma 2009
Nossa proposta
![Page 7: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/7.jpg)
Plataforma 2009
Devise
Pontos positivos• Rack based (via Warden): Rails, Metal, Sinatra• Solução completa (MVC), como engine• Múltiplos roles (logar como admin e user)• Modular e flexível
Pontos negativos• Pouca base instalada• Menos de 10 watchers no github
![Page 8: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/8.jpg)
Plataforma 2009
class User < ActiveRecord::Base devise :authenticableend
![Page 9: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/9.jpg)
Plataforma 2009
class User < ActiveRecord::Base devise :confirmableend
![Page 10: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/10.jpg)
Plataforma 2009
class User < ActiveRecord::Base devise :recoverableend
![Page 11: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/11.jpg)
Plataforma 2009
class User < ActiveRecord::Base devise :validatableend
![Page 12: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/12.jpg)
Plataforma 2009
class User < ActiveRecord::Base devise :allend
![Page 13: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/13.jpg)
Plataforma 2009
...tem mais coisa vindo
![Page 14: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/14.jpg)
Plataforma 2009
Proteção contra Brute Force
self.attempts_count = 10self.attempts_timeframe = 2.hours
![Page 15: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/15.jpg)
Plataforma 2009
Remember me
self.remember_me = 2.weeks
![Page 16: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/16.jpg)
Plataforma 2009
Migratable
create_table :users do |t| t.authenticable t.confirmableend
![Page 17: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/17.jpg)
Plataforma 2009
Magic colums
self.login_countself.last_request_atself.last_login_ip
![Page 18: Devise - RSLA - 13oct2009](https://reader035.fdocumentos.tips/reader035/viewer/2022081807/5559324dd8b42a543d8b498a/html5/thumbnails/18.jpg)
Plataforma 2009
github.com/plataformatec/devise
github.com/plataformatec/devise_example
blog.plataformatec.com.br