SlideShare a Scribd company logo
1 of 16
ErlHive Safe Erlang Reloaded An angle on community web development Ulf Wiger, Ericsson AB
The Goal ,[object Object],[object Object],[object Object],[object Object]
The Frustration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Tuple Store ,[object Object],[object Object],[object Object],[object Object],[object Object],Authentication, etc. tuple store DB HTTP
Stored modules extend the vision Authentication, etc. erlhive DB Public code and data Private code and data Safe, web-based community web application development User A User E
Back-end Concepts ,[object Object],[object Object],[object Object]
Classes of Variable ,[object Object],[object Object],[object Object],[object Object]
Access control ,[object Object],[object Object],In the public area: Read/call Read/write/delete/call Modules Append Append/read/delete Streams Read Read/write/delete Scalars & arrays Other Users Owner
Safe code execution ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Code example -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {time, calendar:universal_time()},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. Owned by user <<”ulf”>> Owned by user <<”joe”>> 1> erlhive:with_user(   <<”ulf”>>,   fun(M) ->   M:set_variable(ex3_pub, [{class, module},{area, public}]),   M:store_module(ex3_pub, ”-module(ex3_pub)....”)   end).
Code example -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {time, calendar:universal_time()},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. Package syntax for calling other users’ modules ” Meta functions” for introspection
Execution -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {time, calendar:universal_time()},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. 2> erlhive:with_user(   <<”joe”>>,   fun(M) ->   M:apply(erlhive.joe.ex3_joe, f, [])   end). [{’?MODULE’, ’erlhive.joe.ex3_joe’},  {caller, <<”joe”>>},  {from_module, ’erlhive.user’},  {owner, <<”joe”>>},  {ex3_pub, [{’?MODULE’, ’erlhive.ulf.ex3_pub’},   {time, {{2006,11,9},{16,53,17}},    {caller, <<”joe”>>},   {owner, <<”ulf”>>},   {ex3_priv, [{’?MODULE’, ’erlhive.ulf.ex3_priv’},   {caller, <<”ulf”>>},   {from_module, ’erlhive.ulf.ex3_pub’},   {owner, <<”ulf”>>}]}]}]
Execution -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. 2> erlhive:with_user(   <<”joe”>>,   fun(M) ->   M:apply(erlhive.ulf.ex3_priv, f, [])   end). ** exited: {aborted, {{undef,[{{’erlhive.ulf.ex3_priv’,   <<”joe”>>,   ’erlhive.user’}, f, 0},   {erlhive,with_watchdog,1},   ...]}, ...} Cannot call another user’s private modules. Restricted calls appear as undefs.
Profiling -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. 2> erlhive:profile(   <<”joe”>>,   fun(M) ->   M:apply(ex3_joe, f, [])   end). { [{’?MODULE’,’erlhive.joe.ex3_joe’},   ...], [{trace,<0.403.0>,call,{erlhive_user,apply,4}},  {trace,<0.403.0>,call,{’erlhive.joe.ex3_joe’,f,1}},  {trace,<0.403.0>,call,{’erlhive.ulf.ex3_pub’,f,1}},  {trace,<0.403.0>,return_to,{’erlhive.ulf.ex3_pub’,f,1}},  {trace ,<0.403.0>,return_to,{’erlhive.ulf.ex3_pub’,f,1}}]} A censored call trace. Can be followed by a specific trace on ’visible’ modules. (work in progress...)
Status ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions?

More Related Content

Similar to ErlHive Safe Erlang Reloaded

Requiring your own files.pptx
Requiring your own files.pptxRequiring your own files.pptx
Requiring your own files.pptx
Lovely Professional University
 
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptxINTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
DeepasCSE
 

Similar to ErlHive Safe Erlang Reloaded (20)

Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Django Good Practices
Django Good PracticesDjango Good Practices
Django Good Practices
 
Unbundling the JavaScript module bundler - Road to Coderful
Unbundling the JavaScript module bundler - Road to CoderfulUnbundling the JavaScript module bundler - Road to Coderful
Unbundling the JavaScript module bundler - Road to Coderful
 
Unbundling the JavaScript module bundler - DublinJS July 2018
Unbundling the JavaScript module bundler - DublinJS July 2018Unbundling the JavaScript module bundler - DublinJS July 2018
Unbundling the JavaScript module bundler - DublinJS July 2018
 
Getting modular with OSGI
Getting modular with OSGIGetting modular with OSGI
Getting modular with OSGI
 
Global objects in Node.pdf
Global objects in Node.pdfGlobal objects in Node.pdf
Global objects in Node.pdf
 
Hooks and Events in Drupal 8
Hooks and Events in Drupal 8Hooks and Events in Drupal 8
Hooks and Events in Drupal 8
 
Requiring your own files.pptx
Requiring your own files.pptxRequiring your own files.pptx
Requiring your own files.pptx
 
Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7 Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Mastering Python lesson 4_functions_parameters_arguments
Mastering Python lesson 4_functions_parameters_argumentsMastering Python lesson 4_functions_parameters_arguments
Mastering Python lesson 4_functions_parameters_arguments
 
OOP in C#
OOP in C#OOP in C#
OOP in C#
 
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptxINTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introduction
 
Drupal 8 Hooks
Drupal 8 HooksDrupal 8 Hooks
Drupal 8 Hooks
 
Java 7: Quo vadis?
Java 7: Quo vadis?Java 7: Quo vadis?
Java 7: Quo vadis?
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

ErlHive Safe Erlang Reloaded

  • 1. ErlHive Safe Erlang Reloaded An angle on community web development Ulf Wiger, Ericsson AB
  • 2.
  • 3.
  • 4.
  • 5. Stored modules extend the vision Authentication, etc. erlhive DB Public code and data Private code and data Safe, web-based community web application development User A User E
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Code example -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {time, calendar:universal_time()}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. Owned by user <<”ulf”>> Owned by user <<”joe”>> 1> erlhive:with_user( <<”ulf”>>, fun(M) -> M:set_variable(ex3_pub, [{class, module},{area, public}]), M:store_module(ex3_pub, ”-module(ex3_pub)....”) end).
  • 11. Code example -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {time, calendar:universal_time()}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. Package syntax for calling other users’ modules ” Meta functions” for introspection
  • 12. Execution -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {time, calendar:universal_time()}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. 2> erlhive:with_user( <<”joe”>>, fun(M) -> M:apply(erlhive.joe.ex3_joe, f, []) end). [{’?MODULE’, ’erlhive.joe.ex3_joe’}, {caller, <<”joe”>>}, {from_module, ’erlhive.user’}, {owner, <<”joe”>>}, {ex3_pub, [{’?MODULE’, ’erlhive.ulf.ex3_pub’}, {time, {{2006,11,9},{16,53,17}}, {caller, <<”joe”>>}, {owner, <<”ulf”>>}, {ex3_priv, [{’?MODULE’, ’erlhive.ulf.ex3_priv’}, {caller, <<”ulf”>>}, {from_module, ’erlhive.ulf.ex3_pub’}, {owner, <<”ulf”>>}]}]}]
  • 13. Execution -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. 2> erlhive:with_user( <<”joe”>>, fun(M) -> M:apply(erlhive.ulf.ex3_priv, f, []) end). ** exited: {aborted, {{undef,[{{’erlhive.ulf.ex3_priv’, <<”joe”>>, ’erlhive.user’}, f, 0}, {erlhive,with_watchdog,1}, ...]}, ...} Cannot call another user’s private modules. Restricted calls appear as undefs.
  • 14. Profiling -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. 2> erlhive:profile( <<”joe”>>, fun(M) -> M:apply(ex3_joe, f, []) end). { [{’?MODULE’,’erlhive.joe.ex3_joe’}, ...], [{trace,<0.403.0>,call,{erlhive_user,apply,4}}, {trace,<0.403.0>,call,{’erlhive.joe.ex3_joe’,f,1}}, {trace,<0.403.0>,call,{’erlhive.ulf.ex3_pub’,f,1}}, {trace,<0.403.0>,return_to,{’erlhive.ulf.ex3_pub’,f,1}}, {trace ,<0.403.0>,return_to,{’erlhive.ulf.ex3_pub’,f,1}}]} A censored call trace. Can be followed by a specific trace on ’visible’ modules. (work in progress...)
  • 15.