• Stars
    star
    123
  • Rank 280,377 (Top 6 %)
  • Language
    Clojure
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An integrated security system for applications built on component

bolt

“Building secure Clojure web applications needs to be easier, and requires integrated security frameworks - not standalone libraries!” – John P. Hackworth, Clojure web security is worse than you think

An integrated security system for Clojure applications based on a set of components written to the specifications of Stuart Sierra's component.

Bolt has an ambitious goal: to separate all security-related concerns from Clojure-based applications so that they can be implemented as pluggable components.

Terms

The precise meanings of the terms component, system-map and system are those in component. In summary, a component is a map of data, usually implemented as a record with associated protocols specifying functions for start/stop and others. A system is a set of these components, with the inclusion of declared dependency references into each component.

In addition, bolt uses the following terms :-

  • username - a user's short identifier, for example: bob
  • email - a user's email address
  • user - a map, containing entries that distinguish and describe a user

Discussion

Bolt provides an integrated system of components, rather than requiring developers to roll their own from smaller libraries.

Functionality can be customised by interchanging components, providing necessary flexibility for bespoke Clojure applications.

Nevertheless, 'out-of-the-box' defaults should provide good security, on par with other languages and frameworks. That is what is currently missing in the Clojure landscape and the gap that bolt aims to fill.

Differences with Friend

The key difference between bolt and Friend is that bolt is designed for use with Component based applications.

Bolt is designed specifically for modular applications, where functionality can be added through the addition of extra components.

Stuart Sierra's component library provides a balanced, elegant and "essential" foundation for bringing all these parts together into a single system, so it's a natural fit for this problem. It is also straight-forward to decompose (and therefore reason about) the system (by understanding the role that each component plays). This is an important property of any security system - if the design is difficult to comprehend but 'just works' or works 'like magic' then it limits the number of people who can understand it and point out potential weaknesses.

To provide flexibility, bolt fully embraces and consistently adopts protocol polymorphism within Clojure, enabled by Stuart's approach. This will not to everyone's taste. Alternatives, such as the use of dynamic vars, are wholly avoided. Functional programming is a beautiful thing in the small, but presents practical challenges at scale. Polymorphism is one of the cornerstones of object orientation worth stealing.

Should you use bolt?

Ultimately, whether bolt is right for you will depend on how you build your Clojure web applications. For smaller applications with a single set of Compojure routes, Friend is a better choice.

For larger applications, especially those with multiple modules and using Liberator or yada to provide a fuller REST API, bolt should be a good fit.

Name change

Bolt was formerly named Cylon.

Limitations

Bolt is not suitable for production systems until it reaches version 1.0, which will indicate that bolt has been deployed into production elsewhere and has undergone thorough peer review.

Join in the conversation

Join our Google group [email protected] for discussion about how to improve bolt.

References

https://hackworth.be/2014/03/26/clojure-web-security-is-worse-than-you-think/ https://github.com/dhruvchandna/ring-secure-headers https://github.com/weavejester/ring-anti-forgery

Acknowledgements

Aaron Bedra's seminal ClojureWest talk in 2014 – http://www.youtube.com/watch?v=CBL59w7fXw4 - this was the inspiration behind bolt.

Mastodon C for sponsoring the development on bolt, and using it in their kixi projects kixi.hecuba and kixi.stentor

Also, to Neale Swinnerton @sw1nn for the original work in adopting Stuart's component library and showing how to migrate Jig components to it.

Yodit Stanton and the rest of the opensensors.io team for putting up with the original Cylon updates (Cylon being the former name of bolt) and being the first adopters of the OAuth2 features.

Juan Antonio Ruz for designing and developing the TOTP two-factor authentication support. Additionally Juan conducted the background research and co-authored the OAuth2 support, and many other aspects of the project. Also for providing a public example of how to use bolt.

Martin Trojer and others from JUXT for a continual stream of thought-provoking ideas and good advice.

Andrey Antukh for suggestions about integration with Buddy.

Copyright & License

The MIT License (MIT)

Copyright © 2014 JUXT LTD.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

bidi

Bidirectional URI routing
Clojure
984
star
2

yada

A powerful Clojure web library, full HTTP, full async - see https://juxt.pro/yada/index.html
HTML
731
star
3

aero

A small library for explicit, intentful configuration.
Clojure
721
star
4

tick

Time as a value.
Clojure
581
star
5

edge

A Clojure application foundation from JUXT
Clojure
502
star
6

joplin

Flexible datastore migration and seeding for Clojure projects
Clojure
313
star
7

juxt-accounting

Double-entry accounting software written in Clojure with Datomic.
Clojure
280
star
8

pack.alpha

Package clojure projects
Java
259
star
9

mach

A remake of make (in ClojureScript)
Clojure
246
star
10

jig

Jig is an application harness providing a beautifully interactive development experience for Clojure projects.
Clojure
230
star
11

clip

Light structure and support for dependency injection
Clojure
224
star
12

iota

Infix operators for test assertions
Clojure
149
star
13

site

A web and API server, powered by xtdb.com
Clojure
136
star
14

modular

JavaScript
128
star
15

apex

A compendium of Clojure libraries for implementing web backends.
Clojure
124
star
16

jinx

jinx is not xml-schema (it's json-schema!)
Clojure
97
star
17

pull

Trees from tables
Clojure
96
star
18

roll

AWS Blue/Green deployment using Clojure flavoured devops
Clojure
75
star
19

reap

A Clojure library for decoding and encoding strings used by web protocols.
Clojure
68
star
20

dirwatch

A Clojure directory watcher, wrapping the JDK 7 java.nio.file.WatchService.
Clojure
67
star
21

skip

Skippy McSkipface - A general Clojure dependency tracker
Clojure
34
star
22

snap

Snapshot testing for Clojure and Clojurescript
Clojure
29
star
23

pack-datomic

Datomic Packer and Terraform setup
HCL
26
star
24

qcon2014

JavaScript
26
star
25

stoic

Marrying the Component Lifecycle pattern with distributed config.
Clojure
20
star
26

spin

Unbundling the web application-tier
Clojure
20
star
27

pick

A Clojure library for HTTP server-driven content negotiation.
Clojure
18
star
28

prop

Clojure
17
star
29

rest

A guide to coding a REST service
CSS
16
star
30

grab

A Clojure library for parsing and executing GraphQL queries.
Clojure
16
star
31

chatserver

Clojure
13
star
32

shop

The JUXT Shop - a sample application built on Crux
Clojure
11
star
33

dotfiles

Recommended dotfiles used by JUXT
Emacs Lisp
9
star
34

fuzz

Example ClojureScript Project that happens to wrap Slack
Clojure
9
star
35

ramp

Shell
8
star
36

card

Not sure what this is. A kind-of Zettelkasten?
TypeScript
8
star
37

chatclient

Clojure
8
star
38

hire

A technical interview test for potential employees
Clojure
7
star
39

rock

Hardened AMIs for Clojure deployments (Arch Linux)
Shell
7
star
40

clip-example

Example of using Clip
Clojure
7
star
41

datomic-extras

Clojure
7
star
42

lein-dockerstalk

Clojure
7
star
43

docker

Docker files
Makefile
7
star
44

draw

A DSL for SVG diagrams
Clojure
6
star
45

trag

Graph transduction
Clojure
5
star
46

radar

JUXT Clojure Technology Radar
Clojure
5
star
47

vext

Clojure
4
star
48

pack-ek

HCL
4
star
49

adoc

A Clojure wrapper for asciidoctorj
Clojure
4
star
50

msf

Volunteer work for MSF
Clojure
4
star
51

astro-website

Source for the main JUXT website
JavaScript
3
star
52

azondi

MQTT goes reactive
CSS
3
star
53

pack-riemann

HCL
3
star
54

http

3
star
55

yada.cookbook

A cookbook of yada recipes
3
star
56

component-utils

Clojure
2
star
57

blip

Small library for fetching/injecting graphql definitions
Clojure
2
star
58

flow

Clojure
2
star
59

ping

Clojure
2
star
60

modular.co-dependency

Co-dependency support for com.stuartsierra.component
Clojure
2
star
61

lein-deploy-tar

A Leiningen plugin to upload tars to a Maven repository.
Clojure
2
star
62

aleph-issue

Testing aleph
Clojure
1
star
63

mksmarthack

A Clojure data hack on MK:Smart
Clojure
1
star
64

eventing-examples

Clojure
1
star
65

training-exercises-webapp

Training exercises
Clojure
1
star
66

example-code

Example code for a recent client course
Clojure
1
star
67

home-apps

Monorepo for SPAs that use home.juxt.site as a backend
TypeScript
1
star
68

sail

Clojure
1
star
69

clojars-mirrors

Re-releasing Clojars libraries onto Maven Central
Clojure
1
star
70

XT20.conf

Public materials for XT20
1
star
71

asciidoctor-stylesheet-factory

CSS
1
star