{"config":{"lang":["en"],"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Owen Jacobson \u00b6 Hire Me . I've been a professional software developer since the early 2000s and an enthusiastic amateur even longer, and a manager of developers since 2019. I'm also deeply interested in organizational dynamics and group consensus: software, like ourselves, lives in a society, and both serves the needs of and serves to help shape that society. Code . I program computers. I have done so all of my adult life, and expect to do so as long as I can string concepts together. Like many lifelong programmers, I periodically write up interesting things I've developed, collaborated on, or run across. My larger projects are on Github . Papers of Note . Computer science and development-adjacent papers and academic works I encourage people to read. Gossamer . In 2014, long before Mastodon was in any kind of widespread use, I sketched out an idea for a fully-distributed status sharing network based on Twitter, but without the weakness of the Twitter, Inc. corporation. I've preserved the writeup here, as it's an excellent case study in how blindness to social violence can lead to dangerous software design. Gossamer should never be implemented , because it would put vulnerable users at extreme risk . In 2020, with Mastodon well established and the shape of distributed status networks much more widely understood, a friend pushed me to revisit the idea . The best way to contact me is by email , but I'm present in many places . If you prefer that your mail not be read by others, my GPG key fingerprint is 77BDC4F16EFD607E85AAB63950232991F10DFFD0.","title":"Owen Jacobson"},{"location":"#owen-jacobson","text":"Hire Me . I've been a professional software developer since the early 2000s and an enthusiastic amateur even longer, and a manager of developers since 2019. I'm also deeply interested in organizational dynamics and group consensus: software, like ourselves, lives in a society, and both serves the needs of and serves to help shape that society. Code . I program computers. I have done so all of my adult life, and expect to do so as long as I can string concepts together. Like many lifelong programmers, I periodically write up interesting things I've developed, collaborated on, or run across. My larger projects are on Github . Papers of Note . Computer science and development-adjacent papers and academic works I encourage people to read. Gossamer . In 2014, long before Mastodon was in any kind of widespread use, I sketched out an idea for a fully-distributed status sharing network based on Twitter, but without the weakness of the Twitter, Inc. corporation. I've preserved the writeup here, as it's an excellent case study in how blindness to social violence can lead to dangerous software design. Gossamer should never be implemented , because it would put vulnerable users at extreme risk . In 2020, with Mastodon well established and the shape of distributed status networks much more widely understood, a friend pushed me to revisit the idea . The best way to contact me is by email , but I'm present in many places . If you prefer that your mail not be read by others, my GPG key fingerprint is 77BDC4F16EFD607E85AAB63950232991F10DFFD0.","title":"Owen Jacobson"},{"location":"hire-me/","text":"Hire Me \u00b6 I'm always interested in hearing from people and organizations that I can help, whether that means coming in for a few days to talk about end-to-end testing or joining your organization full-time to help turn an idea into reality. I live in and around Toronto. I am more than happy to work remotely, and I can probably help your organization learn to integrate remote work if it doesn't already know how. For Fun \u00b6 I regularly mentor people new to programming, teaching them how to craft working systems. This is less about teaching people to write code and more about teaching them why we care about source control, how to think about configuration, how to and why to automate testing, and how to think about software systems and data flow at a higher level. I strongly believe that software development needs a formal apprenticeship program, and mentoring has done a lot to validate that belief. Heroku/Salesforce (2015-Present) \u00b6 In my time with Heroku (and with Salesforce, Heroku's parent organization), I've contributed to the operation of services that let developers bring their ideas to life on the internet, both as a developer and as a manager. I've been involved in maintaining and expanding existing features, exploring and developing new products, and in cultivating my peers and my team as people and as developers. As an engineering manager, I've been responsible for building and supporting an effective, unified team. Moving into management was motivated by a desire to act as a force multiplier, which I've brought to life through coaching, process management, facilitating ongoing discussions about the direction and health of the team, and through actively being involved in my reports' progress as developers. As a lead developer, I worked on the Heroku build system , which ingests code from end users and deploys that code to applications running on the Heroku platform. As part of that work, we implemented a number of features to control abuse, support language-specific features and needs, and to develop new ways to deploy code to Heroku. FreshBooks (2009-2014) \u00b6 During the five years I was with the company, it grew from a 20-person one-room organization to a healthy, growing two-hundred-person technology company. As an early employee, I had my hand in many, many projects and helped the development team absorb the massive cultural changes that come with growth, while also building a SaaS product that let others realize their dreams. Some highlights: As the lead database administrator-slash-developer, I worked with the entire development team to balance concerns about reliability and availability with ensuring new ideas and incremental improvements could be executed without massive bureaucracy and at low risk. This extended into diverse parts of the company: alongside the operations team, I handled capacity planning, reliability, outage planning, and performance monitoring, while with the development team, I was responsible for designing processes and deploying tools to ease testing of database changes and ensuring smooth, predictable, and low-effort deployment to production and for training developers to make the best use of MySQL for their projects. As a tools developer, I built the Sparkplug framework to standardize the tools and processes for building message-driven applications, allowing the team to move away from monolithic web applications towards a more event-driven suite of interal systems. Providing a standard framework paid off well; building and deploying completely novel event handlers for FreshBooks\u2019 core systems could be completed in as little as a week, including testing and production provisioning. As an ops-ish toolsmith, I worked extensively on configuration management for both applications and the underlying servers. I lead a number of projects to reduce the risk around deployments: creating a standard development VM to ensure developers had an environment consistent with reality, automating packaging and rollout to testing servers, automating the creation of testing servers, and more. As part of this work, I built training materials and ran sessions to teach other developers how to think like a sysadmin, covering Linux, Puppet, virtualization, and other topics. Riptown Media (2006-2009) \u00b6 Riptown Media was an software development company tasked with building and maintaining a suite of gambling systems for a single client. I was brought on board as a Java developer, and rapidly expanded my role to encompass other fields. As the primary developer for poker-room back office and anti-fraud tools, I worked with the customer support and business intelligence teams to better understand their daily needs and frustrations, so that I could turn those into meaningful improvements to their tools and processes. These improvements, in turn, lead to measurable changes in the frequency and length of customer support calls, in fraud rates, and in the percieved value of internal customer intelligence. As a lead developer, my team put together the server half of an in-house casino gaming platform. We worked in tight collaboration with the client team, in-house and third-party testers, and interaction designers, and delivered our first game in under six months. Our platform was meant to reduce our reliance on third-party \u201cwhite label\u201d games vendors; internally, it was a success. Our game received zero customer-reported defects during its initial run. OSI Geospatial (2004-2006) \u00b6 At OSI Geospatial, I lead the development of a target-tracking and battlespace awareness overlay as part of a suite of operational theatre tools. In 2004, the state of the art for web-based geomatics software was not up to the task; this ended up being a custom server written in C++ and making heavy use of PostgreSQL and PostGIS for its inner workings. Contact Me \u00b6 You can get in touch by email at owen@grimoire.ca. I'd love to hear from you.","title":"Hire Me"},{"location":"hire-me/#hire-me","text":"I'm always interested in hearing from people and organizations that I can help, whether that means coming in for a few days to talk about end-to-end testing or joining your organization full-time to help turn an idea into reality. I live in and around Toronto. I am more than happy to work remotely, and I can probably help your organization learn to integrate remote work if it doesn't already know how.","title":"Hire Me"},{"location":"hire-me/#for-fun","text":"I regularly mentor people new to programming, teaching them how to craft working systems. This is less about teaching people to write code and more about teaching them why we care about source control, how to think about configuration, how to and why to automate testing, and how to think about software systems and data flow at a higher level. I strongly believe that software development needs a formal apprenticeship program, and mentoring has done a lot to validate that belief.","title":"For Fun"},{"location":"hire-me/#herokusalesforce-2015-present","text":"In my time with Heroku (and with Salesforce, Heroku's parent organization), I've contributed to the operation of services that let developers bring their ideas to life on the internet, both as a developer and as a manager. I've been involved in maintaining and expanding existing features, exploring and developing new products, and in cultivating my peers and my team as people and as developers. As an engineering manager, I've been responsible for building and supporting an effective, unified team. Moving into management was motivated by a desire to act as a force multiplier, which I've brought to life through coaching, process management, facilitating ongoing discussions about the direction and health of the team, and through actively being involved in my reports' progress as developers. As a lead developer, I worked on the Heroku build system , which ingests code from end users and deploys that code to applications running on the Heroku platform. As part of that work, we implemented a number of features to control abuse, support language-specific features and needs, and to develop new ways to deploy code to Heroku.","title":"Heroku/Salesforce (2015-Present)"},{"location":"hire-me/#freshbooks-2009-2014","text":"During the five years I was with the company, it grew from a 20-person one-room organization to a healthy, growing two-hundred-person technology company. As an early employee, I had my hand in many, many projects and helped the development team absorb the massive cultural changes that come with growth, while also building a SaaS product that let others realize their dreams. Some highlights: As the lead database administrator-slash-developer, I worked with the entire development team to balance concerns about reliability and availability with ensuring new ideas and incremental improvements could be executed without massive bureaucracy and at low risk. This extended into diverse parts of the company: alongside the operations team, I handled capacity planning, reliability, outage planning, and performance monitoring, while with the development team, I was responsible for designing processes and deploying tools to ease testing of database changes and ensuring smooth, predictable, and low-effort deployment to production and for training developers to make the best use of MySQL for their projects. As a tools developer, I built the Sparkplug framework to standardize the tools and processes for building message-driven applications, allowing the team to move away from monolithic web applications towards a more event-driven suite of interal systems. Providing a standard framework paid off well; building and deploying completely novel event handlers for FreshBooks\u2019 core systems could be completed in as little as a week, including testing and production provisioning. As an ops-ish toolsmith, I worked extensively on configuration management for both applications and the underlying servers. I lead a number of projects to reduce the risk around deployments: creating a standard development VM to ensure developers had an environment consistent with reality, automating packaging and rollout to testing servers, automating the creation of testing servers, and more. As part of this work, I built training materials and ran sessions to teach other developers how to think like a sysadmin, covering Linux, Puppet, virtualization, and other topics.","title":"FreshBooks (2009-2014)"},{"location":"hire-me/#riptown-media-2006-2009","text":"Riptown Media was an software development company tasked with building and maintaining a suite of gambling systems for a single client. I was brought on board as a Java developer, and rapidly expanded my role to encompass other fields. As the primary developer for poker-room back office and anti-fraud tools, I worked with the customer support and business intelligence teams to better understand their daily needs and frustrations, so that I could turn those into meaningful improvements to their tools and processes. These improvements, in turn, lead to measurable changes in the frequency and length of customer support calls, in fraud rates, and in the percieved value of internal customer intelligence. As a lead developer, my team put together the server half of an in-house casino gaming platform. We worked in tight collaboration with the client team, in-house and third-party testers, and interaction designers, and delivered our first game in under six months. Our platform was meant to reduce our reliance on third-party \u201cwhite label\u201d games vendors; internally, it was a success. Our game received zero customer-reported defects during its initial run.","title":"Riptown Media (2006-2009)"},{"location":"hire-me/#osi-geospatial-2004-2006","text":"At OSI Geospatial, I lead the development of a target-tracking and battlespace awareness overlay as part of a suite of operational theatre tools. In 2004, the state of the art for web-based geomatics software was not up to the task; this ended up being a custom server written in C++ and making heavy use of PostgreSQL and PostGIS for its inner workings.","title":"OSI Geospatial (2004-2006)"},{"location":"hire-me/#contact-me","text":"You can get in touch by email at owen@grimoire.ca. I'd love to hear from you.","title":"Contact Me"},{"location":"papers/","text":"Papers of Note \u00b6 Perlman, Radia (1985). \u201c An Algorithm for Distributed Computation of a Spanning Tree in an Extended LAN \u201d. ACM SIGCOMM Computer Communication Review. 15 (4): 44\u201353. doi:10.1145/318951.319004. The related Algorhyme , also by Perlman. Guy Lewis Steele, Jr.. \u201c Debunking the 'Expensive Procedure Call' Myth, or, Procedure Call Implementations Considered Harmful, or, Lambda: The Ultimate GOTO \u201d. MIT AI Lab. AI Lab Memo AIM-443. October 1977. What Every Computer Scientist Should Know About Floating-Point Arithmetic , by David Goldberg, published in the March, 1991 issue of Computing Surveys. Copyright 1991, Association for Computing Machinery, Inc. RFC 1925 . Regular Expression Matching Can Be Simple And Fast , Russ Cox's empirical research into degenerate cases in common regular expression implementations and a proposed implementation based on Thomson's NFA construction. The above-cited Thomson NFA paper on regular expressions. The Eight Fallacies of Distributed Computing . HAKMEM is another good one. It's dense but rewarding. Kahan, William (January 1965), \u201c Further remarks on reducing truncation errors \u201d, Communications of the ACM, 8 (1): 40, doi:10.1145/363707.363723","title":"Papers of Note"},{"location":"papers/#papers-of-note","text":"Perlman, Radia (1985). \u201c An Algorithm for Distributed Computation of a Spanning Tree in an Extended LAN \u201d. ACM SIGCOMM Computer Communication Review. 15 (4): 44\u201353. doi:10.1145/318951.319004. The related Algorhyme , also by Perlman. Guy Lewis Steele, Jr.. \u201c Debunking the 'Expensive Procedure Call' Myth, or, Procedure Call Implementations Considered Harmful, or, Lambda: The Ultimate GOTO \u201d. MIT AI Lab. AI Lab Memo AIM-443. October 1977. What Every Computer Scientist Should Know About Floating-Point Arithmetic , by David Goldberg, published in the March, 1991 issue of Computing Surveys. Copyright 1991, Association for Computing Machinery, Inc. RFC 1925 . Regular Expression Matching Can Be Simple And Fast , Russ Cox's empirical research into degenerate cases in common regular expression implementations and a proposed implementation based on Thomson's NFA construction. The above-cited Thomson NFA paper on regular expressions. The Eight Fallacies of Distributed Computing . HAKMEM is another good one. It's dense but rewarding. Kahan, William (January 1965), \u201c Further remarks on reducing truncation errors \u201d, Communications of the ACM, 8 (1): 40, doi:10.1145/363707.363723","title":"Papers of Note"},{"location":"code/","text":"Code \u00b6 Pieces of code and code-adjacent work, with or without exposition, that don't quite fit into the library ecosystem, but which I enjoyed writing. A Users, Roles & Privileges Scheme Using Graphs \u2014 An SQL schema and associated queries for handling permissions when roles can nest arbitrarily. Configuring Browser Apps \u2014 Notes on the available techniques for delivering runtime configuration to code running in a user's browser, and the tradeoffs involved. Writing Good Commit Messages \u2014 A style guide. Some collected advice about Git \u2014 Not the source control tool we want, but definitely the source control tool we've got, and I think we should make the best of it. I also maintain a Github account for more substantial projects.","title":"Code"},{"location":"code/#code","text":"Pieces of code and code-adjacent work, with or without exposition, that don't quite fit into the library ecosystem, but which I enjoyed writing. A Users, Roles & Privileges Scheme Using Graphs \u2014 An SQL schema and associated queries for handling permissions when roles can nest arbitrarily. Configuring Browser Apps \u2014 Notes on the available techniques for delivering runtime configuration to code running in a user's browser, and the tradeoffs involved. Writing Good Commit Messages \u2014 A style guide. Some collected advice about Git \u2014 Not the source control tool we want, but definitely the source control tool we've got, and I think we should make the best of it. I also maintain a Github account for more substantial projects.","title":"Code"},{"location":"code/commit-messages/","text":"Writing Good Commit Messages \u00b6 Rule zero: \u201cgood\u201d is defined by the standards of the project you're on. Have a look at what the existing messages look like, and try to emulate that first before doing anything else. Having said that, here are some principles I've found helpful and broadly applicable. Treat the first line of the message as a one-sentence summary. Most SCM systems have an \u201coverview\u201d command that shows shortened commit messages in bulk, so making the very beginning of the message meaningful helps make those modes more useful for finding specific commits. It's okay for this to be a \u201cwhat\u201d description if the rest of the message is a \u201cwhy\u201d description. Fill out the rest of the message with prose outlining why you made the change. Don't reiterate the contents of the change in great detail if you can avoid it: anyone who needs that can read the diff themselves, or reach out to ask for help understanding the change. A good rationale sets context for the problem being solved and addresses the ways the proposed change alters that context. If you use an issue tracker (and you should), include whatever issue-linking notes it supports right at the start of the message, where it'll be visible even in summarized commit logs. If your tracker has absurdly long issue-linking syntax, or doesn't support issue links in commits at all, include a short issue identifier at the front of the message and put the long part somewhere out of the way, such as on a line of its own at the end of the message. If you need rich commit messages (links, lists, and so on), pick one markup language and stick with it. It'll be easier to write useful commit formatters if you only have to deal with one syntax, rather than four. Personally, I use Markdown when I can, or a reduced subset of Markdown, as it's something most developers I interact with will be at least passing familiar with.","title":"Writing Good Commit Messages"},{"location":"code/commit-messages/#writing-good-commit-messages","text":"Rule zero: \u201cgood\u201d is defined by the standards of the project you're on. Have a look at what the existing messages look like, and try to emulate that first before doing anything else. Having said that, here are some principles I've found helpful and broadly applicable. Treat the first line of the message as a one-sentence summary. Most SCM systems have an \u201coverview\u201d command that shows shortened commit messages in bulk, so making the very beginning of the message meaningful helps make those modes more useful for finding specific commits. It's okay for this to be a \u201cwhat\u201d description if the rest of the message is a \u201cwhy\u201d description. Fill out the rest of the message with prose outlining why you made the change. Don't reiterate the contents of the change in great detail if you can avoid it: anyone who needs that can read the diff themselves, or reach out to ask for help understanding the change. A good rationale sets context for the problem being solved and addresses the ways the proposed change alters that context. If you use an issue tracker (and you should), include whatever issue-linking notes it supports right at the start of the message, where it'll be visible even in summarized commit logs. If your tracker has absurdly long issue-linking syntax, or doesn't support issue links in commits at all, include a short issue identifier at the front of the message and put the long part somewhere out of the way, such as on a line of its own at the end of the message. If you need rich commit messages (links, lists, and so on), pick one markup language and stick with it. It'll be easier to write useful commit formatters if you only have to deal with one syntax, rather than four. Personally, I use Markdown when I can, or a reduced subset of Markdown, as it's something most developers I interact with will be at least passing familiar with.","title":"Writing Good Commit Messages"},{"location":"code/configuring-browser-apps/","text":"Configuring Browser Apps \u00b6 I've found myself in he unexpected situation of having to write a lot of browser apps/single page apps this year. I have some thoughts on configuration. Why Bother \u00b6 Centralize environment-dependent facts to simplify management & testing Make it easy to manage app secrets. @wlonk adds: \u201cSecrets\u201d? What this means in a browser app is a bit different. Which is unpleasantly true. In a freestanding browser app, a \u201csecret\u201d is only as secret as your users and their network connections choose to make it, i.e., not very secret at all. Maybe that should read \u201cmake it easy to manage app tokens and identities ,\u201d instead. Keep config data & API tokens out of app's source control Integration point for external config sources (Aerobatic, Heroku, etc) The forces described in 12 Factor App: Dependencies and, to a lesser extent, 12 Factor App: Configuration apply just as well to web client apps as they do to freestanding services. What Gets Configured \u00b6 Yes: Base URLs of backend services Tokens and client IDs for various APIs No: \u201cEnvironments\u201d (sorry, Ember folks - I know Ember thought this through carefully, but whole-env configs make it easy to miss settings in prod or test, and encourage patterns like \u201call devs use the same backends\u201d) Delivering Configuration \u00b6 There are a few ways to get configuration into the app. Globals \u00b6
Easy to consume: it's just globals, so window.appConfig.foo will read them. This requires some discipline to use well. Have to generate a script to set them. This can be a tag or a standalone config script loaded with in them. That may be an unlikely edge case, but that only makes it a nastier trap for administrators. There are more edge cases . I strongly suspect that a hazard-free implementation requires a full-blown JS source generator. I had a look at building something out of escodegen and estemplate , but escodegen 's node version doesn't generate browser-safe code , so string literals with or in them still break the page, and converting javascript values into parse trees to feed to estemplate is some seriously tedious code. Data Attributes and Link Elements \u00b6 Flat values only. This is probably a good thing in the grand, since flat configurations are easier to reason about and much easier to document, but it makes namespacing trickier than it needs to be for groups of related config values (URL + token for a single service, for example). Have to generate the DOM to set them. This is only practical given server-side templates or DOM rendering. You can't do this with bare nginx, unless you pre-generate pages at deployment time. Config API Endpoint \u00b6 fetch('/config') /* {\"FOO_URL\": \u2026, \"FOO_TOKEN\": \u2026} */ .then(response => response.json()) .then(json => someConfigurableService); Works even with \u201cdumb\u201d servers (nginx, CloudFront) as the endpoint can be a generated JSON file on disk. If you can generate files, you can generate a JSON endpoint. Requires an additional request to fetch the configuration, and logic for injecting config data into all the relevant configurable places in the code. This request can't happen until all the app code has loaded. It's very tempting to write the config to a global. This produces some hilarious race conditions. Cookies \u00b6 See for example clientconfig : var config = require('clientconfig'); Easy to consume given the right tools; tricky to do right from scratch. Requires server-side support to send the correct cookie. Some servers will allow you to generate the right cookie once and store it in a config file; others will need custom logic, which means (effectively) you need an app server. Cookies persist and get re-sent on subsequent requests, even if the server stops delivering config cookies. Client code has to manage the cookie lifecycle carefully (clientconfig does this automatically) Size limits constrain how much configuration you can do.","title":"Configuring Browser Apps"},{"location":"code/configuring-browser-apps/#configuring-browser-apps","text":"I've found myself in he unexpected situation of having to write a lot of browser apps/single page apps this year. I have some thoughts on configuration.","title":"Configuring Browser Apps"},{"location":"code/configuring-browser-apps/#why-bother","text":"Centralize environment-dependent facts to simplify management & testing Make it easy to manage app secrets. @wlonk adds: \u201cSecrets\u201d? What this means in a browser app is a bit different. Which is unpleasantly true. In a freestanding browser app, a \u201csecret\u201d is only as secret as your users and their network connections choose to make it, i.e., not very secret at all. Maybe that should read \u201cmake it easy to manage app tokens and identities ,\u201d instead. Keep config data & API tokens out of app's source control Integration point for external config sources (Aerobatic, Heroku, etc) The forces described in 12 Factor App: Dependencies and, to a lesser extent, 12 Factor App: Configuration apply just as well to web client apps as they do to freestanding services.","title":"Why Bother"},{"location":"code/configuring-browser-apps/#what-gets-configured","text":"Yes: Base URLs of backend services Tokens and client IDs for various APIs No: \u201cEnvironments\u201d (sorry, Ember folks - I know Ember thought this through carefully, but whole-env configs make it easy to miss settings in prod or test, and encourage patterns like \u201call devs use the same backends\u201d)","title":"What Gets Configured"},{"location":"code/configuring-browser-apps/#delivering-configuration","text":"There are a few ways to get configuration into the app.","title":"Delivering Configuration"},{"location":"code/configuring-browser-apps/#globals","text":" Easy to consume: it's just globals, so window.appConfig.foo will read them. This requires some discipline to use well. Have to generate a script to set them. This can be a tag or a standalone config script loaded with in them. That may be an unlikely edge case, but that only makes it a nastier trap for administrators. There are more edge cases . I strongly suspect that a hazard-free implementation requires a full-blown JS source generator. I had a look at building something out of escodegen and estemplate , but escodegen 's node version doesn't generate browser-safe code , so string literals with or in them still break the page, and converting javascript values into parse trees to feed to estemplate is some seriously tedious code.","title":"Globals"},{"location":"code/configuring-browser-apps/#data-attributes-and-link-elements","text":" Flat values only. This is probably a good thing in the grand, since flat configurations are easier to reason about and much easier to document, but it makes namespacing trickier than it needs to be for groups of related config values (URL + token for a single service, for example). Have to generate the DOM to set them. This is only practical given server-side templates or DOM rendering. You can't do this with bare nginx, unless you pre-generate pages at deployment time.","title":"Data Attributes and Link Elements"},{"location":"code/configuring-browser-apps/#config-api-endpoint","text":"fetch('/config') /* {\"FOO_URL\": \u2026, \"FOO_TOKEN\": \u2026} */ .then(response => response.json()) .then(json => someConfigurableService); Works even with \u201cdumb\u201d servers (nginx, CloudFront) as the endpoint can be a generated JSON file on disk. If you can generate files, you can generate a JSON endpoint. Requires an additional request to fetch the configuration, and logic for injecting config data into all the relevant configurable places in the code. This request can't happen until all the app code has loaded. It's very tempting to write the config to a global. This produces some hilarious race conditions.","title":"Config API Endpoint"},{"location":"code/configuring-browser-apps/#cookies","text":"See for example clientconfig : var config = require('clientconfig'); Easy to consume given the right tools; tricky to do right from scratch. Requires server-side support to send the correct cookie. Some servers will allow you to generate the right cookie once and store it in a config file; others will need custom logic, which means (effectively) you need an app server. Cookies persist and get re-sent on subsequent requests, even if the server stops delivering config cookies. Client code has to manage the cookie lifecycle carefully (clientconfig does this automatically) Size limits constrain how much configuration you can do.","title":"Cookies"},{"location":"code/users-rolegraph-privs/","text":"A Users, Roles & Privileges Scheme Using Graphs \u00b6 The basic elements: Every agent that can interact with a system is represented by a user . Every capability the system has is authorized by a distinct privilege . Each user has a list of zero or more roles . Roles can imply further roles. This relationship is transitive: if role A implies role B, then a member of role A is a member of role B; if role B also implies role C, then a member of role A is also a member of role C. It helps if the resulting role graph is acyclic, but it's not necessary. Roles can grant privileges. A user's privileges are the union of the privileges granted by the transitive closure of their roles. create table \"user\" ( username varchar primary key -- credentials &c ); create table role ( name varchar primary key ); create table role_member ( role varchar not null references role, member varchar not null references \"user\", primary key (role, member) ); create table role_implies ( role varchar not null references role, implied_role varchar not null ); create table privilege ( privilege varchar primary key ); create table role_grants ( role varchar not null references role, privilege varchar not null references privilege, primary key (role, privilege) ); If your database supports recursive CTEs, this schema can be queried in one shot, since we can have the database do all the graph-walking along roles: with recursive user_roles (role) AS ( select role from role_member where member = 'SOME USERNAME' union select implied_role as role from user_roles join role_implies on user_roles.role = role_implies.role ) select distinct role_grants.privilege as privilege from user_roles join role_grants on user_roles.role = role_grants.role order by privilege; If not, you'll need to pull the entire graph into memory and manipulate it there: this schema doesn't give you any easy handles to identify only the roles transitively included in the role of interest, and repeatedly querying for each step of the graph requires an IO roundtrip at each step, burning whole milliseconds along the way. Realistic use cases should have fairly simple graphs: elemental privileges are grouped into concrete roles, which are in turn grouped into abstracted roles (by department, for example), which are in turn granted to users. If the average user is in tens of roles and has hundreds of privileges, the entire dataset fits in memory, and PostgreSQL performs well. In PostgreSQL, the above schema handles ~10k privileges and ~10k roles with randomly-generated graph relationships in around 100ms on my laptop, which is pretty slow but not intolerable. Perverse cases (interconnected total subgraphs, deeply-nested linear graphs) can take absurd time but do not reflect any likely permissions scheme.","title":"A Users, Roles & Privileges Scheme Using Graphs"},{"location":"code/users-rolegraph-privs/#a-users-roles-privileges-scheme-using-graphs","text":"The basic elements: Every agent that can interact with a system is represented by a user . Every capability the system has is authorized by a distinct privilege . Each user has a list of zero or more roles . Roles can imply further roles. This relationship is transitive: if role A implies role B, then a member of role A is a member of role B; if role B also implies role C, then a member of role A is also a member of role C. It helps if the resulting role graph is acyclic, but it's not necessary. Roles can grant privileges. A user's privileges are the union of the privileges granted by the transitive closure of their roles. create table \"user\" ( username varchar primary key -- credentials &c ); create table role ( name varchar primary key ); create table role_member ( role varchar not null references role, member varchar not null references \"user\", primary key (role, member) ); create table role_implies ( role varchar not null references role, implied_role varchar not null ); create table privilege ( privilege varchar primary key ); create table role_grants ( role varchar not null references role, privilege varchar not null references privilege, primary key (role, privilege) ); If your database supports recursive CTEs, this schema can be queried in one shot, since we can have the database do all the graph-walking along roles: with recursive user_roles (role) AS ( select role from role_member where member = 'SOME USERNAME' union select implied_role as role from user_roles join role_implies on user_roles.role = role_implies.role ) select distinct role_grants.privilege as privilege from user_roles join role_grants on user_roles.role = role_grants.role order by privilege; If not, you'll need to pull the entire graph into memory and manipulate it there: this schema doesn't give you any easy handles to identify only the roles transitively included in the role of interest, and repeatedly querying for each step of the graph requires an IO roundtrip at each step, burning whole milliseconds along the way. Realistic use cases should have fairly simple graphs: elemental privileges are grouped into concrete roles, which are in turn grouped into abstracted roles (by department, for example), which are in turn granted to users. If the average user is in tens of roles and has hundreds of privileges, the entire dataset fits in memory, and PostgreSQL performs well. In PostgreSQL, the above schema handles ~10k privileges and ~10k roles with randomly-generated graph relationships in around 100ms on my laptop, which is pretty slow but not intolerable. Perverse cases (interconnected total subgraphs, deeply-nested linear graphs) can take absurd time but do not reflect any likely permissions scheme.","title":"A Users, Roles & Privileges Scheme Using Graphs"},{"location":"git/","text":"Collected Advice about Git \u00b6 git-config Settings You Want \u2014 Git is highly configurable, and the defaults have gotten drastically better over the years, but there are still some non-default behaviours that I've found make life better. Notes Towards Detached Signatures in Git \u2014 An idea I had, but never fully developed, for implementing after-the-fact object signing on top of Git. This was based on a similar feature in Monotone, which I'd found very effective for annotating commits on the fly. Life With Pull Requests \u2014 Some notes I made while getting up to speed with pull requests to help my team come to grips with the workflows. Git Is Not Magic \u2014 An exploration of Git's on-disk data structures and the design choices taken very early in Git's existence. Stop using git pull for deployment! \u2014 Describing the least-painful way to use Git as a deployment tool I had worked out, circa 2014. Written in an aversarial style as a response to repeated \u201dwhy don't we just\u201ds that, while well-intentioned, came from an incomplete understanding of what git pull does. Git Survival Guide \u2014 Some words of caution about Git, git 's preferred workflows, and various recoverable mistakes.","title":"Collected Advice about Git"},{"location":"git/#collected-advice-about-git","text":"git-config Settings You Want \u2014 Git is highly configurable, and the defaults have gotten drastically better over the years, but there are still some non-default behaviours that I've found make life better. Notes Towards Detached Signatures in Git \u2014 An idea I had, but never fully developed, for implementing after-the-fact object signing on top of Git. This was based on a similar feature in Monotone, which I'd found very effective for annotating commits on the fly. Life With Pull Requests \u2014 Some notes I made while getting up to speed with pull requests to help my team come to grips with the workflows. Git Is Not Magic \u2014 An exploration of Git's on-disk data structures and the design choices taken very early in Git's existence. Stop using git pull for deployment! \u2014 Describing the least-painful way to use Git as a deployment tool I had worked out, circa 2014. Written in an aversarial style as a response to repeated \u201dwhy don't we just\u201ds that, while well-intentioned, came from an incomplete understanding of what git pull does. Git Survival Guide \u2014 Some words of caution about Git, git 's preferred workflows, and various recoverable mistakes.","title":"Collected Advice about Git"},{"location":"git/config/","text":"git-config Settings You Want \u00b6 Git comes with some fairly lkml -specific configuration defaults. You should fix this. All of the items below can be set either for your entire login account ( git config --global ) or for a specific repository ( git config ). Full documentation is under git help config , unless otherwise stated. git config user.name 'Your Full Name' and git config user.email 'your-email@example.com' , obviously. Git will remind you about this if you forget. git config merge.defaultToUpstream true - causes an unqualified git merge to merge the current branch's configured upstream branch, rather than being an error. This makes git merge much more consistent with git rebase , and as the two tools fill very similar workflow niches, it's nice to have them behave similarly. git config rebase.autosquash true - causes git rebase -i to parse magic comments created by git commit --squash=some-hash and git commit --fixup=some-hash and reorder the commit list before presenting it for further editing. See the descriptions of \u201csquash\u201d and \u201cfixup\u201d in git help rebase for details; autosquash makes amending commits other than the most recent easier and less error-prone. git config branch.autosetupmerge always - newly-created branches whose start point is a branch ( git checkout master -b some-feature , git branch some-feature origin/develop , and so on) will be configured to have the start point branch as their upstream. By default (with true rather than always ) this only happens when the start point is a remote-tracking branch. git config rerere.enabled true - enable \u201creuse recorded resolution.\u201d The git help rerere docs explain it pretty well, but the short version is that git can record how you resolve conflicts during a \u201ctest\u201d merge and reuse the same approach when resolving the same conflict later, in a \u201creal\u201d merge. For advanced users \u00b6 A few things are nice when you're getting started, but become annoying when you no longer need them. git config advice.detachedHead - if you already understand the difference between having a branch checked out and having a commit checked out, and already understand what \u201cdetatched head\u201d means, the warning on every git checkout ...some detatched thing... isn't helping anyone. This is also useful repositories used for deployment, where specific commits (from tags, for example) are regularly checked out.","title":"git-config Settings You Want"},{"location":"git/config/#git-config-settings-you-want","text":"Git comes with some fairly lkml -specific configuration defaults. You should fix this. All of the items below can be set either for your entire login account ( git config --global ) or for a specific repository ( git config ). Full documentation is under git help config , unless otherwise stated. git config user.name 'Your Full Name' and git config user.email 'your-email@example.com' , obviously. Git will remind you about this if you forget. git config merge.defaultToUpstream true - causes an unqualified git merge to merge the current branch's configured upstream branch, rather than being an error. This makes git merge much more consistent with git rebase , and as the two tools fill very similar workflow niches, it's nice to have them behave similarly. git config rebase.autosquash true - causes git rebase -i to parse magic comments created by git commit --squash=some-hash and git commit --fixup=some-hash and reorder the commit list before presenting it for further editing. See the descriptions of \u201csquash\u201d and \u201cfixup\u201d in git help rebase for details; autosquash makes amending commits other than the most recent easier and less error-prone. git config branch.autosetupmerge always - newly-created branches whose start point is a branch ( git checkout master -b some-feature , git branch some-feature origin/develop , and so on) will be configured to have the start point branch as their upstream. By default (with true rather than always ) this only happens when the start point is a remote-tracking branch. git config rerere.enabled true - enable \u201creuse recorded resolution.\u201d The git help rerere docs explain it pretty well, but the short version is that git can record how you resolve conflicts during a \u201ctest\u201d merge and reuse the same approach when resolving the same conflict later, in a \u201creal\u201d merge.","title":"git-config Settings You Want"},{"location":"git/config/#for-advanced-users","text":"A few things are nice when you're getting started, but become annoying when you no longer need them. git config advice.detachedHead - if you already understand the difference between having a branch checked out and having a commit checked out, and already understand what \u201cdetatched head\u201d means, the warning on every git checkout ...some detatched thing... isn't helping anyone. This is also useful repositories used for deployment, where specific commits (from tags, for example) are regularly checked out.","title":"For advanced users"},{"location":"git/detached-sigs/","text":"Notes Towards Detached Signatures in Git \u00b6 Git supports a limited form of object authentication: specific object categories in Git's internal model can have GPG signatures embedded in them, allowing the authorship of the objects to be verified using GPG's underlying trust model. Tag signatures can be used to verify the authenticity and integrity of the snapshot associated with a tag , and the authenticity of the tag itself, filling a niche broadly similar to code signing in binary distribution systems. Commit signatures can be used to verify the authenticity of the snapshot associated with the commit , and the authorship of the commit itself. (Conventionally, commit signatures are assumed to also authenticate either the entire line of history leading to a commit, or the diff between the commit and its first parent, or both.) Git's existing system has some tradeoffs. Signatures are embedded within the objects they sign. The signature is part of the object's identity; since Git is content-addressed, this means that an object can neither be retroactively signed nor retroactively stripped of its signature without modifying the object's identity. Git's distributed model means that these sorts of identity changes are both complicated and easily detected. Commit signatures are second-class citizens. They're a relatively recent addition to the Git suite, and both the implementation and the social conventions around them continue to evolve. Only some objects can be signed. While Git has relatively weak rules about workflow, the signature system assumes you're using one of Git's more widespread workflows by limiting your options to at most one signature, and by restricting signatures to tags and commits (leaving out blobs, trees, and refs). I believe it would be useful from an authentication standpoint to add \"detached\" signatures to Git, to allow users to make these tradeoffs differently if desired. These signatures would be stored as separate (blob) objects in a dedicated refs namespace, supporting retroactive signatures, multiple signatures for a given object, \"policy\" signatures, and authentication of arbitrary objects. The following notes are partially guided by Git's one existing \"detached metadata\" facility, git notes . Similarities are intentional; divergences will be noted where appropriate. Detached signatures are meant to interoperate with existing Git workflow as much as possible: in particular, they can be fetched and pushed like any other bit of Git metadata. A detached signature cryptographically binds three facts together into an assertion whose authenticity can be checked by anyone with access to the signatory's keys: An object (in the Git sense; a commit, tag, tree, or blob), A policy label, and A signatory (a person or agent making the assertion). These assertions can be published separately from or in tandem with the objects they apply to. Policies \u00b6 Taking a hint from Monotone, every signature includes a \"policy\" identifying how the signature is meant to be interpreted. Policies are arbitrary strings; their meaning is entirely defined by tooling and convention, not by this draft. This draft uses a single policy, author , for its examples. A signature under the author policy implies that the signatory had a hand in the authorship of the designated object. (This is compatible with existing interpretations of signed tags and commits.) (Authorship under this model is strictly self-attested: you can claim authorship of anything, and you cannot assert anyone else's authorship.) The Monotone documentation suggests a number of other useful policies related to testing and release status, automated build results, and numerous other factors. Use your imagination. What's In A Signature \u00b6 Detached signatures cover the disk representation of an object, as given by git cat-file