SlideShare a Scribd company logo
1 of 26
Giving your website a command line interface Michael Hudson-Doyle michael.hudson@linaro.org
Linaro and its mission Linaro aims to make Linux work better on ARM processors
The Problem The ARM ecosystem is very fragmented, and the kernel has a lot of copy and paste code "Gaah. Guys, this whole ARM thing is a f*cking pain in the ass." — Linus Torvalds, 17 Mar 2011 https://lwn.net/Articles/437170/
Enter Linaro! "Linaro is a not-for-profit software engineering company investing in core Linux software and tools for ARM SoCs." Also about educating the members in how to do open source development...
LAVA - Linaro Automated Validation A bit part of Linaro is about automated validation: ,[object Object]
Also benchmark toolchain improvements
Maybe even power management changes too...,[object Object]
LAVA Some scripts and tricks that can boot a board with a new kernel and run some tests. Quick Demo (ever the optimist)
LAVA And a website that lets you see whats going on
The Problem (finally!) We want to do things like trigger test runs when a kernel build finishes. This basically means some kind of Remote Procedure Call (RPC).
Paranoia For a bunch of reasons, we need some kind of security in our system: ,[object Object]
Some risk of mischief
Eventually may have test results from unreleased hardware or benchmarks with licenses that forbid publication of results,[object Object]
We didn't think about this very hard but it is well supported in most languages
Will probably add JSON-RPC support at some point for easier browser access,[object Object]
The great thing about standards... <bob2> kennethreitz: oauth         is a font of villany         and dispair  -- #python, Jun 09 11:55:08
Also doesn't solve our problem OAuth specifies that various aspects of the request are signed, but not, crucially for us, the body of the request – an important detail, because in XML-RPC the body of the request is where all the important stuff is.
Transport Layer Security, here we come If you're going as far as to cryptographically sign something, it's not much further to go to actually just encrypt it!
And what does everyone know about encryption? Don't implement it yourself (i.e. use HTTPS)
Back to Basic And if you're operating over HTTPS, you might as well just just good old RFC 2617 Basic Authentication... ... but with tokens rather than passwords
Tokens > Passwords Because we expect the RPC to be invoked from build systems and so on, there is a moderate chance of the token being leaked – so it should not let you take over the owning user's account. In the future, a token might only let you access some APIs.
Also, we use SSO... In addition we use Launchpad's SSO service for authentication, so most users don't have a LAVA password!
Show me the code! On the server side, we've built a library that lets you add a authenticating XML-RPC to a Django project: https://launchpad.net/linaro-django-xmlrpc It includes views and models (and very very simple templates) for creating and managing tokens.
Server side code example/api.py: from linaro_django_xmlrpc.models import ExposedAPI from linaro_django_xmlrpc.globals import mapper class ExampleAPI(ExposedAPI):     def whoami(self):         if self.user:             return self.user.username         else:             return None mapper.register(ExampleAPI) in your urlconf:     url(r'', include('linaro_django_xmlrpc.urls')),
Client side library This isn't properly factored yet really (it's it all mashed up with our toolkit for doing command line tools), but the code is in "lava-tool": https://launchpad.net/lava-tool It uses python-keyring for token management.
Client-side code from lava_tool.authtoken import br />     AuthenticatingServerProxy, KeyringAuthBackend auth_backend = KeyringAuthBackend() auth_backend.add_token(     "user", "http://server/RPC2/", token) sp = AuthenticatingServerProxy(     "http://user@server/RPC2/",     auth_backend=auth_backend) print server.whoami()

More Related Content

What's hot

Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
John Clayton
 
Website releases made easy with the PEAR installer - Barcelona 2008
Website releases made easy with the PEAR installer - Barcelona 2008Website releases made easy with the PEAR installer - Barcelona 2008
Website releases made easy with the PEAR installer - Barcelona 2008
Helgi Þormar Þorbjörnsson
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
csukxnr
 
Ruby Projects and Libraries
Ruby Projects and LibrariesRuby Projects and Libraries
Ruby Projects and Libraries
Vorleak Chy
 
Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009
Helgi Þormar Þorbjörnsson
 

What's hot (20)

Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
 
Php7
Php7Php7
Php7
 
2021laravelconftwslides6
2021laravelconftwslides62021laravelconftwslides6
2021laravelconftwslides6
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and PythonDEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
 
Website releases made easy with the PEAR installer - Barcelona 2008
Website releases made easy with the PEAR installer - Barcelona 2008Website releases made easy with the PEAR installer - Barcelona 2008
Website releases made easy with the PEAR installer - Barcelona 2008
 
Flyr PHP micro-framework
Flyr PHP micro-frameworkFlyr PHP micro-framework
Flyr PHP micro-framework
 
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
Remote File Inclusion / Local File Inclusion [Attack and Defense Techniques]
 
RMLL 2014 - OpenLDAP - Manage password policy
RMLL 2014 - OpenLDAP - Manage password policyRMLL 2014 - OpenLDAP - Manage password policy
RMLL 2014 - OpenLDAP - Manage password policy
 
Document Databases e RavenDB
Document Databases e RavenDBDocument Databases e RavenDB
Document Databases e RavenDB
 
LOGBack and SLF4J
LOGBack and SLF4JLOGBack and SLF4J
LOGBack and SLF4J
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
Php
PhpPhp
Php
 
Ruby Projects and Libraries
Ruby Projects and LibrariesRuby Projects and Libraries
Ruby Projects and Libraries
 
Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009
 
Another Test
Another TestAnother Test
Another Test
 
How i-won-club hack-precon-ctf-v2
How i-won-club hack-precon-ctf-v2How i-won-club hack-precon-ctf-v2
How i-won-club hack-precon-ctf-v2
 
Apache
ApacheApache
Apache
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
 
How to save log4net into database
How to save log4net into databaseHow to save log4net into database
How to save log4net into database
 

Viewers also liked (6)

How we use Twisted in Launchpad
How we use Twisted in LaunchpadHow we use Twisted in Launchpad
How we use Twisted in Launchpad
 
Projektdokumentation Kai Aras Ss08
Projektdokumentation Kai Aras Ss08Projektdokumentation Kai Aras Ss08
Projektdokumentation Kai Aras Ss08
 
An Introduction to PyPy
An Introduction to PyPyAn Introduction to PyPy
An Introduction to PyPy
 
Design patterns - Singleton&Command
Design patterns - Singleton&CommandDesign patterns - Singleton&Command
Design patterns - Singleton&Command
 
a quick Introduction to PyPy
a quick Introduction to PyPya quick Introduction to PyPy
a quick Introduction to PyPy
 
Jailbreaking iOS
Jailbreaking iOSJailbreaking iOS
Jailbreaking iOS
 

Similar to Kiwipycon command line

Intro to web services
Intro to web servicesIntro to web services
Intro to web services
Neil Ghosh
 
I can haz HTTP - Consuming and producing HTTP APIs in the Ruby ecosystem
I can haz HTTP - Consuming and producing HTTP APIs in the Ruby ecosystemI can haz HTTP - Consuming and producing HTTP APIs in the Ruby ecosystem
I can haz HTTP - Consuming and producing HTTP APIs in the Ruby ecosystem
Sidu Ponnappa
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger
 
lamp technology
lamp technologylamp technology
lamp technology
Deepa
 
Deepa ppt about lamp technology
Deepa ppt about lamp technologyDeepa ppt about lamp technology
Deepa ppt about lamp technology
Deepa
 
Lamp technology
Lamp technologyLamp technology
Lamp technology
2tharan21
 

Similar to Kiwipycon command line (20)

PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the fool
 
Function as a Service
Function as a ServiceFunction as a Service
Function as a Service
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails Final
 
Real time cloud native open source streaming of any data to apache solr
Real time cloud native open source streaming of any data to apache solrReal time cloud native open source streaming of any data to apache solr
Real time cloud native open source streaming of any data to apache solr
 
Lamp
LampLamp
Lamp
 
NodeJS
NodeJSNodeJS
NodeJS
 
Lamp Zend Security
Lamp Zend SecurityLamp Zend Security
Lamp Zend Security
 
HTTP Plugin for MySQL!
HTTP Plugin for MySQL!HTTP Plugin for MySQL!
HTTP Plugin for MySQL!
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
I can haz HTTP - Consuming and producing HTTP APIs in the Ruby ecosystem
I can haz HTTP - Consuming and producing HTTP APIs in the Ruby ecosystemI can haz HTTP - Consuming and producing HTTP APIs in the Ruby ecosystem
I can haz HTTP - Consuming and producing HTTP APIs in the Ruby ecosystem
 
Cloud Foundry API for Fun and Ops
Cloud Foundry API for Fun and OpsCloud Foundry API for Fun and Ops
Cloud Foundry API for Fun and Ops
 
Command & [e]Mission Control: Using Command and Event Buses to create a CQRS-...
Command & [e]Mission Control: Using Command and Event Buses to create a CQRS-...Command & [e]Mission Control: Using Command and Event Buses to create a CQRS-...
Command & [e]Mission Control: Using Command and Event Buses to create a CQRS-...
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
 
lamp technology
lamp technologylamp technology
lamp technology
 
Deepa ppt about lamp technology
Deepa ppt about lamp technologyDeepa ppt about lamp technology
Deepa ppt about lamp technology
 
Monitoring shootout loadays
Monitoring shootout loadaysMonitoring shootout loadays
Monitoring shootout loadays
 
Proposal
ProposalProposal
Proposal
 
Lamp technology
Lamp technologyLamp technology
Lamp technology
 
WoMakersCode 2016 - Shit Happens
WoMakersCode 2016 -  Shit HappensWoMakersCode 2016 -  Shit Happens
WoMakersCode 2016 - Shit Happens
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Kiwipycon command line

  • 1. Giving your website a command line interface Michael Hudson-Doyle michael.hudson@linaro.org
  • 2. Linaro and its mission Linaro aims to make Linux work better on ARM processors
  • 3. The Problem The ARM ecosystem is very fragmented, and the kernel has a lot of copy and paste code "Gaah. Guys, this whole ARM thing is a f*cking pain in the ass." — Linus Torvalds, 17 Mar 2011 https://lwn.net/Articles/437170/
  • 4. Enter Linaro! "Linaro is a not-for-profit software engineering company investing in core Linux software and tools for ARM SoCs." Also about educating the members in how to do open source development...
  • 5.
  • 7.
  • 8. LAVA Some scripts and tricks that can boot a board with a new kernel and run some tests. Quick Demo (ever the optimist)
  • 9. LAVA And a website that lets you see whats going on
  • 10. The Problem (finally!) We want to do things like trigger test runs when a kernel build finishes. This basically means some kind of Remote Procedure Call (RPC).
  • 11.
  • 12. Some risk of mischief
  • 13.
  • 14. We didn't think about this very hard but it is well supported in most languages
  • 15.
  • 16. The great thing about standards... <bob2> kennethreitz: oauth is a font of villany and dispair -- #python, Jun 09 11:55:08
  • 17. Also doesn't solve our problem OAuth specifies that various aspects of the request are signed, but not, crucially for us, the body of the request – an important detail, because in XML-RPC the body of the request is where all the important stuff is.
  • 18. Transport Layer Security, here we come If you're going as far as to cryptographically sign something, it's not much further to go to actually just encrypt it!
  • 19. And what does everyone know about encryption? Don't implement it yourself (i.e. use HTTPS)
  • 20. Back to Basic And if you're operating over HTTPS, you might as well just just good old RFC 2617 Basic Authentication... ... but with tokens rather than passwords
  • 21. Tokens > Passwords Because we expect the RPC to be invoked from build systems and so on, there is a moderate chance of the token being leaked – so it should not let you take over the owning user's account. In the future, a token might only let you access some APIs.
  • 22. Also, we use SSO... In addition we use Launchpad's SSO service for authentication, so most users don't have a LAVA password!
  • 23. Show me the code! On the server side, we've built a library that lets you add a authenticating XML-RPC to a Django project: https://launchpad.net/linaro-django-xmlrpc It includes views and models (and very very simple templates) for creating and managing tokens.
  • 24. Server side code example/api.py: from linaro_django_xmlrpc.models import ExposedAPI from linaro_django_xmlrpc.globals import mapper class ExampleAPI(ExposedAPI): def whoami(self): if self.user: return self.user.username else: return None mapper.register(ExampleAPI) in your urlconf: url(r'', include('linaro_django_xmlrpc.urls')),
  • 25. Client side library This isn't properly factored yet really (it's it all mashed up with our toolkit for doing command line tools), but the code is in "lava-tool": https://launchpad.net/lava-tool It uses python-keyring for token management.
  • 26. Client-side code from lava_tool.authtoken import br /> AuthenticatingServerProxy, KeyringAuthBackend auth_backend = KeyringAuthBackend() auth_backend.add_token( "user", "http://server/RPC2/", token) sp = AuthenticatingServerProxy( "http://user@server/RPC2/", auth_backend=auth_backend) print server.whoami()
  • 27. Demo (assuming the first one wasn't a disaster)
  • 28. Conclusion The lesson: Don't try to be clever – just use HTTPS and Basic auth. The code: lp:linaro-django-xmlrpc lp:lava-tool
  • 29. Thanks for listening! Any Questions?