Building a SaaS offering on top of Openlane
The Openlane Cloud server is used to consume the openlane server and apply an opinionated implementation on top of the the generics provided. Many, if not all, of the endpoints provided by the server use the openlane client to make requests to the openlane Server.
As an example, the v1/organizations
endpoint uses the openlane
client to create an organizational hierarchy`:
│ └── rootorg <--- top level organization
│ ├── production <-- top level environment per customer organization
│ │ ├── assets <-- buckets
│ │ ├── customers
│ │ ├── orders
│ │ ├── relationships
│ │ │ ├── internal_users <-- relationships
│ │ │ ├── marketing_subscribers
│ │ │ ├── marketplaces
│ │ │ ├── partners
│ │ │ └── vendors
│ │ └── sales
│ └── test <-- organization identical to production just named
The openlane cloud cli is used to interact with the openlane cloud server as well as some requests directly to the openlane server using the openlane client. In order to use the cli, you must have a registered user with the openlane server.
brew install theopenlane/tap/openlane-cloud
brew upgrade theopenlane/tap/openlane-cloud
openlane-cloud
the openlane-cloud cli
Usage:
openlane-cloud [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
seed the subcommands for creating demo data in openlane
organization the subcommands for working with the openlane organization
The openlane-cloud
cli has functionality to generate and load test data into openlane
using the seed
command.
Usage:
openlane-cloud seed [command]
Available Commands:
generate generate random data for seeded environment
init init a new openlane seeded environment
On a brand new database, you should run:
- Create a new user to authenticate with the openlane API, this command will fail on subsequent tries because the user will already exist.
task register
- Login as the user, create a new Personal Access Token that will be used to seed the data, generate a new data set, bulk load objects into the openlane API:
task cli:seed:all
If instead, you prefer to use the CLI commands directly, keep reading.
Using the generate
subcommand, new random data will be stored in csv files:
openlane-cloud seed generate
Generated Data
tree demodata
demodata
├── groups.csv
├── invites.csv
├── orgs.csv
└── users.csv
Using the init
subcommand, the data in the specified directory (defaults to demodata
in the current directory), the csv files will be used to generate the data.
openlane-cloud seed init
The newly created objects will be displayed when complete:
Results
> seeded environment created 100% [===============] [3s]
Seeded Environment Created:
+--------------------------------------------------------------------------------------+
| Organization |
+----------------------------+--------+-------------+-------------+----------+---------+
| ID | NAME | DESCRIPTION | PERSONALORG | CHILDREN | MEMBERS |
+----------------------------+--------+-------------+-------------+----------+---------+
| 01J06RPZ8HQRWW4AZERHKWT2YH | Plus-U | | false | 0 | 1 |
+----------------------------+--------+-------------+-------------+----------+---------+
...
See the contributing guide for more information