User auth #133

wants to merge 375 commits into
Play member

This adds user authentication to requests made as a client. Play's API is used throughout the entire app whether its front end or general API requests, so authentication has to be smart.

API Auth

Each user on Play has a unique auth token. They will give this token to each Play client for it to make requests on their behalf.

In addition to these unique tokens, each Play installation also has its own unique system wide auth token. This can be used to auth and masquerade as any user on the system. When using this system wide token, a login must be provided in the request so Play knows what user the request is masquerading as.

Both of these items can be included as a header or as a query param.

User Token

When using a user's token, only the token needs to be included. It can be added to the request in the header or as a query param.

Query Param



"Authorization: 5422fd"

System Token

When using a system token, a login needs to be added to the request in addition to the system token added by the means described above. It can be added to the request in the header or as a query param.

Query Param



"X-PLAY-LOGIN: maddox"
holman and others added some commits Jan 15, 2012
@holman holman Add or remove bce83cf
@jasoncostello jasoncostello randomness a960fd9
@holman holman Update gemfile cf0032c
@holman holman shotgun in dev 70d5ba0
@holman holman Merge branch 'next' of into next 70c9fc1
@jasoncostello jasoncostello add body bg, style top bar 735b6d0
@holman holman TomDoc redis stores d5dda7f
@holman holman Merge branch 'next' of into next f1586e3
@holman holman Expand redis docs 00fb9c8
@holman holman All of the doccing cda57b1
@holman holman History is in redis. 50ba611
@jasoncostello jasoncostello experriment- colors and fonts
see how long this one lasts… alright on to things more pressing
@holman holman Rock a color test for user playcounts too fa872e5
@holman holman Fix the build with _equal 4dd6272
@holman holman Merge branch 'next' of into next 5ec40ba
@holman holman Negative ghostrider the pattern is full a7e853c
@holman holman Download placeholders fce4327
@holman holman Doesn't exist e094475
@jasoncostello jasoncostello digging into the queue structure f38fe96
@holman holman Queues 7286708
@holman holman Merge branch 'next' of into next
@holman holman space 3d20dfa
@holman holman Fix tests 5001b26
@holman holman Guard against iTunes not playing anything 27563ba
@holman holman Add and remove from queue 4e56292
@jasoncostello jasoncostello add reset, ignore fix a1a68e0
@jasoncostello jasoncostello start on horizontal layout 09f23af
@holman holman Merge branch 'next' of into next 65ecf86
@holman holman Fix tests b285d26
@holman holman Abstract helpers into their own file 22ca42b
@holman holman Pull immediate loads into helpers 00d8850
@holman holman Pull out behaviors separately too dae971e
@holman holman y u a splat a893223
@holman holman Artist views c1c99d3
@holman holman Albums too 922a010
@holman holman Fucking queues man 90ca294
@holman holman Fucking docs man e0126d6
@holman holman Song downloads! 148ddb6
@holman holman etag-cache album art 30fe931
@holman holman Optimize artist.songs f9a36c7
@holman holman Explicitly require sass so we're threadsafe ee496d5
@jasoncostello jasoncostello new layout basic positioning 9f84303
@jasoncostello jasoncostello fix merge conflict 2efb9bf
@holman holman Use to_hash instead of to_jason 76db597
@holman holman Merge branch 'next' of into next de1c868
@jasoncostello jasoncostello remove width on now playing info 2a749ba
@holman holman Merge branch 'next' of into next 19cdff6
@holman holman Optimization: don't iterate over every song aa6ae31
@holman holman Fix the build 0738dab
@holman holman Really fix the build 01677c9
@holman holman This expects more than a String path 39d9c62
@holman holman Hook up Queue and History 7c012be
@holman holman Fix tests 3775081
@holman holman Download an album 04348d3
@holman holman Link now playing album art 990ea1a
@holman holman Move frameworks and plugins to their own directory cab0770
@holman holman `rake ci` emulates what Travis sees 2aecba0
@holman holman Fix tests c64df2f
@jasoncostello jasoncostello add controller images, nuke old images 4ac2fe3
@jasoncostello jasoncostello remove album art from song queue 2762cfa
@holman holman Fuck everything about HTML5 fuck it fuck it fuck it fuck it 24b56db
@holman holman Merge branch 'next' of into next 82aed11
@holman holman Hide the input box 62f7e85
@jasoncostello jasoncostello controller spacing 7557288
@holman holman File upload c6f2387
@holman holman Merge branch 'next' of into next 21c1efa
@holman holman Don't blow up if not playing 5d82b02
@holman holman Progress. 2ab1244
@holman holman Testing this is hard. 2225111
@jasoncostello jasoncostello wii css clean up and pull in changes 0631162
@holman holman Fix sliding interaction af4ac10
@holman holman Document drag and drop behaviors bb0e471
@holman holman Hackishly fade out once dropped 08485ac
@holman holman Whitespace 3c5d3e5
@holman holman Stream support a7134ec
@holman holman Add an example stream URL dcb1bbf
@holman holman Return the stream URL 259cd10
@holman holman params[:login] for API requests 171ef31
@holman holman Guard against empty strings c0f5263
@holman holman Volume API getter and setter c4b194c
@holman holman Next returns currently playing, too 5a66f61
@holman holman Play some shit I dig 347fa29
@holman holman I like this shit 09b35f3
@holman holman Fix test 26b5faf
@holman holman Fix user views e9332f7
@holman holman Freeform queries 883cf7a
@holman holman Clear the queue 61ca7c7
@jasoncostello jasoncostello front end positioning 8469f95
@jasoncostello jasoncostello start lighter theme 098678d
@jasoncostello jasoncostello add transitions to <a> and .song div
transition is wonky on <a> tags. inconsistent behavior. wtf
@jasoncostello jasoncostello play button hover state 518d15c
@jasoncostello jasoncostello clean up transition 584293a
@holman holman Fix realtime 6357df0
@holman holman Whoa. Possibly the most important part of Play.
These things happen.
@holman holman Fix queue in realtime™ 9a2ae9f
@holman holman Fix album downloads 8a3233b
@holman holman Padding method always ensures music is queued 91d5d92
@jasoncostello jasoncostello fuck illustrator 0afb295
@holman holman True realtime URL 3787714
@holman holman Can do https too da72de7
joeyw and others added some commits Feb 12, 2012
@joeyw joeyw Add pusher, remove websockets.
This commit replaces websockets as the means of updating
whats playing right now in the web client.

GEMFILE changes
'eventmachine' removed
'pusher' added

bin/realtime replaces realtime.rb which previously updated
now_playing via websockets. It has been setup to run in a similar
mannar as bin/clean.

Play.yml has new config options for api credentials
for pusher.

pusher_app_id: __PUSHER_APP_ID__
pusher_key: __PUSHER_KEY__
pusher_secret: __PUSHER_SECRET__
@holman holman Merge pull request #94 from joeyw/next-pusher-pusher-real-good
Next use pusher instead of websockets
@holman holman Pusher can be accessed over HTTPS, too a3b7dc5
@holman holman Wait, no it can't. Just load it locally then. 7b167f7
@holman holman As always, sprockets does the work for us 496d7df
@holman holman This doesn't exist 056bcea
@holman holman Remove streaming from the browser, since we one-up'd it entirely c293a68
@holman holman Revert "Remove streaming from the browser, since we one-up'd it entir…

This reverts commit c293a68.
@holman holman Disable streaming but retain logo b0114dd
@holman holman Pad one song, not two fbc6213
@holman holman Rescue all the things dfa33b4
@holman holman Use iTunes DJ to clean the queue fa07c9d


holman and others added some commits Feb 15, 2012
@holman holman Make sure realtime never dies f6fca2d
@holman holman Let Foreman handle processes
Foreman does a better job at making sure each process is killed.
@holman holman Crack the README 94ecb00
@rtomayko rtomayko 16x9 css for TVs + media query b760bd9
@rtomayko rtomayko zoom to 1020p or any other 16:9 screen ratio from the base 720p design 98749b2
@rtomayko rtomayko use -moz-transform under firefox since zoom doesn't work aca4ca0
@holman holman Merge pull request #95 from rtomayko/next-tv
16:9 support
@holman holman Merge branch 'next' of into next 2c3b4a0
@holman holman Add program name 8f7c2c2
@holman holman More of the README 4959fa1
@holman holman typo 8038a0d
@holman holman An bootstrap b270caf
@holman holman Standardize with GitHub's `script/bootstrap` paradigm cf95511
@holman holman add a thing about user/pass on import db50fe4
@holman holman Update URLs 58bfb72
@holman holman gs 56a2030
@holman holman Start a bootstrap e9c68ef
@holman holman Improve search 09a9e13
@joeyw joeyw Add test for Helpers.songs_as_json ac9f038
@joeyw joeyw Refactor songs_as_json to return empty songs array instead of explodi…
…ng and add tests for it.

Documented song_as_json parameter requirements and result if not provided.
Added functionality to return empty array if proper parameters are not provided.
Added tests for new functionality.
@joeyw joeyw Add Pusher info and credential grabber to bootstrap. 759c9bd
@joeyw joeyw Check for redis-server instead of redis-cli in bootstrap. 8c434f2
@joeyw joeyw Fix Queue.songs bug that lists history and current song in playlist.
iTunes DJ shows a x number of song history (5 default) in the
playlist itself which causes them to be listed as queued. This
commit changes the Queue.songs method to exclude the currently
playing song and the 5 song history.
@joeyw joeyw Remove hardcoded history length. Calculate how many are actually in t…
…he history.
@holman holman Merge pull request #107 from joeyw/next-bootstrap-check-for-redis-server
Next bootstrap check for redis-server instead of redis-cli
@holman holman Merge pull request #106 from joeyw/next-bootstrap-pusher
Next bootstrap pusher
@holman holman Merge pull request #108 from joeyw/next-queue-bug-fix
Next queue bug fix
@holman holman Merge pull request #105 from joeyw/next-test-all-the-things
Next add test for Helper.songs_as_json
@holman holman Fix helpers tests
Ordering was off. Might as well just sort them instead.
@holman holman skip this in Travis ce194aa
@holman holman Travis should ignore some tests d448c38
@joeyw joeyw Add Airfoil and Speaker models for upcoming Airfoil integration.
These additions cover most of the Airfoil functionality that we will be
using. There is some functionality that has yet to be implemented,
however as the API end is built out any lacking functionality will be
realized and implemented.
@calebthompson calebthompson Clarify wtf Pusher is doing and why I want it. 8e090e0
@holman holman Merge pull request #113 from calebthompson/explain-pusher
Clarify wtf Pusher is doing and why I want it.
@joeyw joeyw Add API endpoints for Airfoil. f9220ff
@joeyw joeyw Skip speaker tests on CI. 67f03f7
@joeyw joeyw Speaker API send 501 if Airfoil isn't setup, 404 if invalid speaker ID. 6fa3864
@joeyw joeyw Set audio source to itunes on startup. 25fa545
@joeyw joeyw Add Airfoil.enabled variable. Add tests for API when Airfoil isn't se…
@holman holman script/record 4451230
@holman holman Recording tweaks cfcf6b3
@holman holman DJ endpoint ae4b7fb
@holman holman DJ 6cfa2c9
@joeyw joeyw Fix css links in layout. 2f7ccc8
@holman holman Merge pull request #117 from joeyw/next-fix-css-links
Next fix css links in layout
@tombell tombell new oauth apps url 448a887
@holman holman Merge pull request #118 from tombell/next-fix-oauth-url
Next fix oauth url
@joeyw joeyw Use unless instead of bang. ad912d8
@wfarr wfarr Update README to add note about making sure iTunes is playing
If you try to visit the play app and the iTunes DJ playlist is not already playing, the queue will just repeatedly error out.
@holman holman Merge pull request #121 from wfarr/patch-1
Small README updates for gotchas
@wfarr wfarr Update uploader to support more extensions caaf29a
@wfarr wfarr Add initial iCloud/iTunes Match support
* Tracks in the cloud can now be queued to the iTunes DJ Playlist
* Album song-searching now looks at tracks in the cloud
@holman holman Merge pull request #122 from wfarr/upload-all-the-formats
Update uploader to support more extensions
@holman holman Merge branch 'next-add-airfoil-support' of
 into joeyw-next-add-airfoil-support
@holman holman Fix exists? call 6eef9a4
@holman holman We want system audio f4446db
@holman holman Sane spacing 24535c0
@holman holman Volume endpoint is adjusted by system output 24d0d78
@holman holman Tests shouldn't touch system apps f76cdcc
@holman holman Revert "Use unless instead of bang."
This reverts commit ad912d8.
@holman holman Merge pull request #124 from wfarr/icloud-lovin
Add initial iCloud/iTunes Match support
@holman holman This doesn't do what you think it does 5520bfd
@holman holman omg fuck guis in my tests dff5ae7
@holman holman Merge branch 'next' of into next 85f0ece
@holman holman Revert "Update uploader to support more extensions"
This reverts commit caaf29a.

This also just doesn't work.

I'm curious where this was breaking for you. Had no issues on my end.

nandub and others added some commits Apr 1, 2012
@nandub nandub save the play.yml and remove exit when nicecast is not installed 790af21
@holman holman Merge pull request #128 from nandub/next
Add saving config/play.yml to script/bootstrap
@holman holman Revert "Add initial iCloud/iTunes Match support"
This reverts commit 969a2d5.

This breaks downloading and appears to not work.

Are we running different iTunes versions or something? Both of these items work on my machine.

Play member

I'm on 10.6 (40).

10.6.1 (7) here.

Play member

fuckin' itunes.

Paul Betts and others added some commits Apr 10, 2012
@maddox maddox closed this Apr 10, 2012

lol best commit comment of 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment