Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Integrations
Search
Keavy McMinn
September 15, 2016
810
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Integrations
Keavy McMinn
September 15, 2016
More Decks by Keavy McMinn
See All by Keavy McMinn
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Improving your workflow with the GitHub API
keavy
9
1.2k
The Successful Shipper
keavy
8
590
How to mend a broken identity
keavy
0
290
Better work, through better feedback.
keavy
1
590
Internal Tools
keavy
9
1.6k
Must. Try. Harder.
keavy
0
650
Career Health Check
keavy
0
350
From Artist To Programmer
keavy
1
500
Featured
See All Featured
Practical Orchestrator
shlominoach
191
11k
From π to Pie charts
rasagy
0
210
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Building an army of robots
kneath
306
46k
Visualization
eitanlees
152
17k
A Soul's Torment
seathinner
6
2.9k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
430
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
440
Building a Scalable Design System with Sketch
lauravandoore
463
34k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Transcript
Integrations Keavy McMinn // Engineer b keavy
“Who opens PRs?”
repo GET /repos/:owner/:repo/pulls
repo Grants read/write access to code, commit statuses, repository invitations,
collaborators, and deployment statuses
repo Grants read/write access to code, commit statuses, repository invitations,
collaborators, and deployment statuses for public and private repositories
repo Grants read/write access to code, commit statuses, repository invitations,
collaborators, and deployment statuses for public and private repositories and organizations.
None
None
┌────┐ ┌─────────────────┐ ┌────────┐ │User│ │ Integrator │ │ GitHub │
└──┬─┘ └────────┬────────┘ └────┬───┘ │ │ │ │ User visits Integrator site │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ │ Authorize Integrator with OAuth │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ Integrator receives and stores │ │ OAuth access token for user │ │ │ ⾢ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ │ │ │ │ List accessible orgs for user │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ List accessible repos for user │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ Display list of repos to user │ │ │ ⾢ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ │ │ │ │ User selects repos to build │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ Set up hooks, create keys for │ selected repos │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ │ │
None
None
None
Uh. Where’s CI?
None
“We need this level of access because GitHub…”
“Type a quote here.”
I’ve got 99 problems, and they’re all OAuth
Scopes
Outside-in flow
Install flow efficiency
No Connection between an org and a service
Multiple accounts
Multiple accounts
None
None
“If we were building integrations from scratch, knowing what we
know now... what would we do differently?” b jasonrudolph
None
Integrations Early Access
None
Users
None
None
None
None
None
Integrator
None
None
None
None
None
None
None
Thorny areas
Checking permissions
Checking permissions
Checking permissions
Checking permissions
# A user with push access to commit status role
:status_writer do |context| ... user && repo.pushable_by?(user) end Checking permissions
# A user with push access to commit status role
:status_writer do |context| ... user && (repo.pushable_by?(user) || repo.statuses.writeable_by?(user)) end Checking permissions
# A user with push access to commit status role
:status_writer do |context| ... user && repo.resources.statuses.writeable_by?(user) end Checking permissions
Identity flow
" # $ Identity flow
Identity flow " # $
OAuth Possible solutions:
Possible solutions: Single Sign-On
OAuth-like flow
None
Led by UX
None
None
None
Trust
None
None
Alternatives now
repo Grants read/write access to code, commit statuses, repository invitations,
collaborators, and deployment statuses for public and private repositories and organizations.
None
None
┌────┐ ┌─────────────────┐ ┌────────┐ │User│ │ Integrator │ │ GitHub │
└──┬─┘ └────────┬────────┘ └────┬───┘ │ │ │ │ User visits Integrator site │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ │ Authorize Integrator with OAuth │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ Integrator receives and stores │ │ OAuth access token for user │ │ │ ⾢ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ │ │ │ │ List accessible orgs for user │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ List accessible repos for user │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ Display list of repos to user │ │ │ ⾢ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ │ │ │ │ User selects repos to build │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │ │ Set up hooks, create keys for │ selected repos │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▶ │ │ │
┌────┐ ┌─────────────────┐ ┌────────┐ │User│ │ Integrator │ │ GitHub │
└──┬─┘ └────────┬────────┘ └────┬───┘ │ │ │ │ User visits integration page │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┼ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─▶ │ │ User installs integration on selected repos │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─▶ │ │ │ Integrator receives webhook event │ │ of new installation │ │ │ ⾢ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ │ │ │ │ │
None
Octokit::Client.new( :access_token => installation_access_token )
Take action independently of a specific user Allow users to
install on an organization Allow users to install on a per repository basis Want granular permissions When to use an Integration?
Code Scanners Continuous Integration Continuous Deployment Issue Management Anything else
you can dream up! What might you use an integration for?
Take action only as a specific user Full access is
desired Using GitHub as an identity provider When to use an OAuth application?
Installations Early Access
Learn more developer.github.com platform.github.community % &
b keavy b jch b tarebyte b jmilas b kdaigle
b pifafu b cmwinters b tclem b jasonrudolph b jdpace b pengwynn b ptoomey3 b janester
Thank you