dkubb changed the topic of #datamapper to: Datamapper v1.2.0 | Mailing List: http://is.gd/aa9D | Logs: http://is.gd/qWAL7V | DataMapper 2 Renamed to ROM, see #rom-rb for development
Sylvain2 has quit [Quit: Leaving.]
Sylvain1 has joined #datamapper
Sylvain1 has quit [Ping timeout: 245 seconds]
rsim has joined #datamapper
ckrailo has quit [Quit: Computer has gone to sleep.]
rsim has quit [Ping timeout: 240 seconds]
bobocopy has joined #datamapper
v0n has joined #datamapper
knowtheory has quit [Quit: Computer has gone to sleep]
jeremyevans has quit [Quit: leaving]
knowtheory has joined #datamapper
tillsc_ has joined #datamapper
tillsc has quit [Ping timeout: 256 seconds]
knowtheory has quit [Quit: Computer has gone to sleep]
zombor has quit [Remote host closed the connection]
jeremyevans has joined #datamapper
dkubb has quit [Ping timeout: 264 seconds]
zombor has joined #datamapper
gix- has quit [Quit: Client exiting]
knowtheory has joined #datamapper
gix has joined #datamapper
zombor has quit [Ping timeout: 264 seconds]
bobocopy has quit [Quit: Leaving.]
dkubb has joined #datamapper
kurko__ has quit [Quit: Computer has gone to sleep.]
snusnu has quit [Quit: Leaving.]
Sylvain1 has joined #datamapper
rsim has joined #datamapper
v0n has quit [Ping timeout: 264 seconds]
rsim has quit [Ping timeout: 240 seconds]
Sylvain1 has quit [Remote host closed the connection]
zombor has joined #datamapper
zombor has quit [Ping timeout: 245 seconds]
rsim has joined #datamapper
tillsc_ has quit [Quit: Linkinus - http://linkinus.com]
tillsc has joined #datamapper
rsim has quit [Ping timeout: 240 seconds]
lnormous has quit [Read error: Operation timed out]
mbj has joined #datamapper
snusnu has joined #datamapper
postmodern has quit [Quit: Leaving]
rsim has joined #datamapper
solnic has joined #datamapper
solnic has quit [Quit: Leaving...]
solnic has joined #datamapper
mikecmpbll has joined #datamapper
solnic has quit [Ping timeout: 264 seconds]
solnic has joined #datamapper
gix has quit [Ping timeout: 264 seconds]
mbj has quit [Ping timeout: 245 seconds]
snusnu has quit [Quit: Leaving.]
snusnu has joined #datamapper
mbj has joined #datamapper
solnic has quit [Quit: Leaving...]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
the_hack has joined #datamapper
mikecmpbll has joined #datamapper
theCrab has joined #datamapper
solnic has joined #datamapper
zombor has joined #datamapper
zombor has joined #datamapper
knowtheory has quit [Quit: Computer has gone to sleep]
zombor has quit [Remote host closed the connection]
mbj has quit [Ping timeout: 240 seconds]
gix has joined #datamapper
solnic has quit [Quit: Leaving...]
solnic has joined #datamapper
mbj has joined #datamapper
solnic has quit [Quit: Leaving...]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mikecmpbll has joined #datamapper
solnic has joined #datamapper
solnic has quit [Remote host closed the connection]
solnic has joined #datamapper
solnic_ has joined #datamapper
solnic has quit [Ping timeout: 245 seconds]
solnic_ has quit [Remote host closed the connection]
solnic has joined #datamapper
the_hack has quit [Quit: Leaving...]
mbj has quit [Ping timeout: 248 seconds]
zombor has joined #datamapper
zombor has quit [Changing host]
zombor has joined #datamapper
kurko__ has joined #datamapper
kurko__ has quit [Max SendQ exceeded]
kurko__ has joined #datamapper
maxzda has joined #datamapper
v0n has joined #datamapper
maxzda has quit [Quit: Leaving]
maxzda_ has joined #datamapper
maxzda_ is now known as maxzda
maxzda is now known as maxzda_
maxzda_ is now known as maxzda__
maxzda__ is now known as maxzda_
maxzda_ is now known as maxzda
maxzda has left #datamapper ["Leaving"]
v0n has quit [Read error: Operation timed out]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
solnic has quit [Quit: Leaving...]
myobie has joined #datamapper
solnic has joined #datamapper
rsim has quit [Quit: Leaving.]
v0n has joined #datamapper
bobocopy has joined #datamapper
myobie has quit [Quit: myobie]
lnormous has joined #datamapper
ckrailo has joined #datamapper
mikecmpbll has joined #datamapper
myobie has joined #datamapper
mbj has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
snusnu has quit [Quit: Leaving.]
snusnu has joined #datamapper
theCrab has quit [Quit: Sleeping -_-]
postmodern has joined #datamapper
solnic has quit [Quit: Leaving...]
Sylvain1 has joined #datamapper
mbj_ has joined #datamapper
mbj has quit [Ping timeout: 256 seconds]
bobocopy has quit [Quit: Leaving.]
bobocopy has joined #datamapper
solnic has joined #datamapper
solnic_ has joined #datamapper
solnic has quit [Read error: Connection reset by peer]
solnic_ has quit [Client Quit]
solnic has joined #datamapper
solnic has quit [Read error: Connection reset by peer]
solnic has joined #datamapper
solnic has quit [Remote host closed the connection]
solnic has joined #datamapper
rsim has joined #datamapper
mbj_ is now known as mbj
tillsc has quit [Quit: Linkinus - http://linkinus.com]
tillsc has joined #datamapper
mralk3 has joined #datamapper
<mralk3> i have a bit of code that is checking to see if a user name exists in my database. has_key? is showing as deprecated, what would be an alternative to that to check if a user name exists in my database?
<onewheelskyward> if user = Users.first(username: supplied_username) ?
<mralk3> alrighty, i was using some old code someone posted. trying to validate a user against a bcrypt encrypted password
snusnu has quit [Ping timeout: 256 seconds]
snusnu has joined #datamapper
<mralk3> hm well i suppose i should have saved the password hash too :X
<mralk3> err salt
<namelessjon> mralk3: BCrypt embeds the salt in the string you save to the db
<Cinchy__> [URL] Authentication with Sinatra
<mralk3> im at the part where the app is logging in
<mralk3> not sure how to get the hash
<mralk3> i have it creating users already
<onewheelskyward> Ok.
<mralk3> http://pastebin.com/Ws7UnHH1 is what i have
<onewheelskyward> So you'll need to grab the salt and re-encrypt the entered password and compare.
<onewheelskyward> Ah
<onewheelskyward> I see your mistake.
<onewheelskyward> On line 5, perform the bcrypt on @user.salt and then push it to a local variable.
<onewheelskyward> Then compare @user.password with calculated_password
<onewheelskyward> Are you using ruby 1.9.x?
<mralk3> yes
<onewheelskyward> You can also do the new fangled key/value syntax: .first(username: params[:username])
<onewheelskyward> fyi. :)
<onewheelskyward> I like it better than the hash rocket, though hash rocket is more fun to say.
<mralk3> yeah .first(username: params[:username]) makes more sense
zombor has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 260 seconds]
v0n has joined #datamapper
<mralk3> onewheelskyward: would something like http://pastebin.com/biHrLkEp work?
<mralk3> or maybe drop line 7 and compare @user.password to password_hash
v0n has quit [Ping timeout: 264 seconds]
<onewheelskyward> You don't want to generate a new salt, that will always yield a different result. You want to use the salt generated when the user was created.
<onewheelskyward> You need to bcrypt the supplied password with the original salt and compare the values with what's in the database.
<namelessjon> There's a really easy way to do it actually
<mralk3> yeah i have a different page in sinatra generating the salt
<namelessjon> mralk3: Don't generate salts yourself, either
<mralk3> so i suppose i need to make a method that will do the salt
<mralk3> sorry guys im new to ruby so im kinda dragging my feet a bit
<namelessjon> will work
<namelessjon> mralk3: ^^
<mralk3> how would that compare the bcrypt string to the entered pasword?
<namelessjon> Because the bcrypt gem is clever, and takes advantage of the fact you can override == in ruby
<mralk3> i changed my user create portion to password = BCrypt::Password.create(params[:password]) so that i am not generating the salt
<namelessjon> mralk3: Use the BCryptHash type from dm-types
<namelessjon> which will make things easier for you, probably :)
<Cinchy__> [gist] Example user with a BCrypt password (at gist.github.com, namelessjon on 2011-06-21 22:14)
<mralk3> like that?
<mralk3> lol
v0n has joined #datamapper
<namelessjon> mralk3: Something like that might be appropriate, yes
<namelessjon> I'd forgotten I wrote that
<mralk3> i found it on google just searching BcryptHash + dm-types
<namelessjon> Though as dkubb notes in the comments, I probably should update it to use dm-types
<onewheelskyward> oh yeah, that'd be rad. property :password, BCrypt
* namelessjon goes to do that.
<mralk3> https://groups.google.com/forum/#!topic/datamapper/hguoxncwYmk any idea where that code went? shows it doesnt exist on github
<namelessjon> It now lives in dm-types
Cinchy__ is now known as Cinchy
<onewheelskyward> namelessjon++
<onewheelskyward> I'll likely use that soon.
<mralk3> i was going to use the sinatra-authentication gem, but i figure its better to learn to make your own auth system and do your own security testing
<mralk3> seeing as that gem is so out of date
<onewheelskyward> Actually, I'd say it's better not to do your own security testing.
<onewheelskyward> If you're building a well-exposed system.
<onewheelskyward> Learn from the others that have been there before.
<mralk3> i wont be the only person testing it
<namelessjon> Very much so. It's easy mess up.
<onewheelskyward> I'm not saying don't do your own security testing, just that you can build on top of something that's been tested.
<mralk3> what are my options for sinatra auth systems? sinatra-athentication, warden, and i didnt see anyting else
v0n has quit [Read error: Operation timed out]
<mralk3> the rack auth is just basic http authentication
<namelessjon> omniauth, too.
<onewheelskyward> those are the ones I've found so far. Have yet to impl any of them.
rsim has quit [Quit: Leaving.]
<mralk3> i wonder if i could use some sort of authentication against my google apps domain
<mralk3> to log into my site
<namelessjon> I'd be surprised if there wasn't an omniauth strategy for that
<mralk3> google federated log in
solnic has quit [Quit: Leaving...]
<onewheelskyward> OAuth 2 draft 666
<mralk3> does it redirect to my google apps log in?
<namelessjon> Try it and see?
rsim has joined #datamapper
bobocopy has quit [Quit: Leaving.]
bobocopy has joined #datamapper
bobocopy has quit [Client Quit]
rsim has quit [Ping timeout: 241 seconds]
_whitelogger has joined #datamapper
dkubb|away has joined #datamapper
dkubb has quit [Read error: Connection reset by peer]
rsim has joined #datamapper
mbj has quit [Ping timeout: 260 seconds]
bobocopy has joined #datamapper
rsim has quit [Ping timeout: 240 seconds]
myobie has quit [Quit: myobie]
bobocopy has quit [Read error: Connection reset by peer]
bobocopy1 has joined #datamapper
rtyler has quit [Changing host]
rtyler has joined #datamapper
bobocopy1 has quit [Client Quit]
ckrailo has quit [Quit: Computer has gone to sleep.]
bobocopy has joined #datamapper