Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial public import #1

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
Language: Proto
ColumnLimit: 100
SpacesInContainerLiterals: false
AllowShortFunctionsOnASingleLine: false
ReflowComments: false
...
29 changes: 29 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "CLA Assistant"
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened,closed,synchronize]

permissions:
actions: write
contents: read
pull-requests: write
statuses: write

jobs:
CLAAssistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ACCESS_TOKEN }}
with:
path-to-signatures: 'signatures/version1/cla.json'
branch: 'main'
remote-organization-name: 'bitdriftlabs'
remote-repository-name: 'bitdrift-cla'
custom-notsigned-prcomment: '<br/>Thank you for your submission, we really appreciate it. We require that $you sign our [Contributor License Agreement](https://github.com/bitdriftlabs/proto/blob/main/CLA.md) before we can accept your contribution. You can sign the CLA by posting a pull request comment in the below format.<br/>'
22 changes: 22 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: check
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: test
runs-on: ubuntu-latest
if: github.actor != 'bitdriftlabs-terraform[bot]'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/buf-lint-action@v1
- name: Format
run: tools/format.sh
- name: Check license
run: tools/check_license.sh
26 changes: 26 additions & 0 deletions .github/workflows/notify-proto-internal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Notify proto-internal about proto update
on:
push:
branches:
- main
workflow_dispatch:
jobs:
notify:
name: Notify proto-internal
runs-on: ubuntu-latest
steps:
- name: org-write-install token
id: org-write
uses: getsentry/action-github-app-token@v2
with:
app_id: ${{ secrets.ORG_PROTO_SYNC_APP_ID }}
private_key: ${{ secrets.ORG_PROTO_SYNC_APP_KEY }}
- name: Trigger CI Job in proto-internal Repo
run: |
gh workflow run $WORKFLOW_ID \
--repo bitdriftlabs/proto-internal \
env:
GH_TOKEN: ${{ steps.org-write.outputs.token }}
# `proto-submodule-update` CI job
WORKFLOW_ID: 93191253

26 changes: 26 additions & 0 deletions .github/workflows/notify-shared-core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Notify shared-core about proto update
on:
push:
branches:
- main
workflow_dispatch:
jobs:
notify:
name: Notify shared-core
runs-on: ubuntu-latest
steps:
- name: org-write-install token
id: org-write
uses: getsentry/action-github-app-token@v2
with:
app_id: ${{ secrets.ORG_PROTO_SYNC_APP_ID }}
private_key: ${{ secrets.ORG_PROTO_SYNC_APP_KEY }}
- name: Trigger CI Job in shared-core Repo
run: |
gh workflow run $WORKFLOW_ID \
--repo bitdriftlabs/shared-core \
env:
GH_TOKEN: ${{ steps.org-write.outputs.token }}
# `proto-submodule-update` CI job
WORKFLOW_ID: 78561085

19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Don't need any local builds :)
build/

# Python artifacts
*.pyc
*.egg-info

# vim generated
*.swp

# OS X's Finder creates these for state about opened windows/etc.
**/.DS_Store

# Visual Studio Code
/.vscode/

# IntelliJ
.idea
*.iml
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "protoc-gen-validate"]
path = protoc-gen-validate
url = [email protected]:envoyproxy/protoc-gen-validate.git
12 changes: 12 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

filegroup(
name = "all_protos",
srcs = glob(["**/*.proto"]),
visibility = ["//visibility:public"],
)

filegroup(
name = "all_fbs",
srcs = glob(["**/*.fbs"]),
visibility = ["//visibility:public"],
)
22 changes: 22 additions & 0 deletions CLA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

**Bitdrift Contributor License Agreement**

In order to clarify the intellectual property license granted with Contributions from any person or entity, Bitdrift, Inc. ("Bitdrift") must have a Contributor License Agreement on file that has been signed by each Contributor, indicating agreement to the license terms below.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Bitdrift. Except for the license granted herein to Bitdrift and recipients of software distributed by Bitdrift, You reserve all right, title, and interest in and to Your Contributions.

1\. Definitions.

"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Bitdrift. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Bitdrift for inclusion in, or documentation of, any of the products owned or managed by Bitdrift (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Bitdrift or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Bitdrift for the purpose of discussing and improving the Work.

2\. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Bitdrift and to recipients of software distributed by Bitdrift a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.

3\. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Bitdrift and to recipients of software distributed by Bitdrift a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.

4\. You represent that you are legally entitled to grant the above license. If you are contributing on your own individual behalf, and your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to Bitdrift, or that your employer has executed a separate Corporate CLA with Bitdrift. If you are contributing on behalf of an entity, you represent that you are authorized by that entity to make your Contributions.

5\. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.

6\. You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
164 changes: 164 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# PolyForm Shield License 1.0.0

<https://polyformproject.org/licenses/shield/1.0.0>

## Acceptance

In order to get any license under these terms, you must agree
to them as both strict obligations and conditions to all
your licenses.

## Copyright License

The licensor grants you a copyright license for the
software to do everything you might do with the software
that would otherwise infringe the licensor's copyright
in it for any permitted purpose. However, you may
only distribute the software according to [Distribution
License](#distribution-license) and make changes or new works
based on the software according to [Changes and New Works
License](#changes-and-new-works-license).

## Distribution License

The licensor grants you an additional copyright license
to distribute copies of the software. Your license
to distribute covers distributing the software with
changes and new works permitted by [Changes and New Works
License](#changes-and-new-works-license).

## Notices

You must ensure that anyone who gets a copy of any part of
the software from you also gets a copy of these terms or the
URL for them above, as well as copies of any plain-text lines
beginning with `Required Notice:` that the licensor provided
with the software. For example:

> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)

## Changes and New Works License

The licensor grants you an additional copyright license to
make changes and new works based on the software for any
permitted purpose.

## Patent License

The licensor grants you a patent license for the software that
covers patent claims the licensor can license, or becomes able
to license, that you would infringe by using the software.

## Noncompete

Any purpose is a permitted purpose, except for providing any
product that competes with the software or any product the
licensor or any of its affiliates provides using the software.

## Competition

Goods and services compete even when they provide functionality
through different kinds of interfaces or for different technical
platforms. Applications can compete with services, libraries
with plugins, frameworks with development tools, and so on,
even if they're written in different programming languages
or for different computer architectures. Goods and services
compete even when provided free of charge. If you market a
product as a practical substitute for the software or another
product, it definitely competes.

## New Products

If you are using the software to provide a product that does
not compete, but the licensor or any of its affiliates brings
your product into competition by providing a new version of
the software or another product using the software, you may
continue using versions of the software available under these
terms beforehand to provide your competing product, but not
any later versions.

## Discontinued Products

You may begin using the software to compete with a product
or service that the licensor or any of its affiliates has
stopped providing, unless the licensor includes a plain-text
line beginning with `Licensor Line of Business:` with the
software that mentions that line of business. For example:

> Licensor Line of Business: YoyodyneCMS Content Management
System (http://example.com/cms)

## Sales of Business

If the licensor or any of its affiliates sells a line of
business developing the software or using the software
to provide a product, the buyer can also enforce
[Noncompete](#noncompete) for that product.

## Fair Use

You may have "fair use" rights for the software under the
law. These terms do not limit them.

## No Other Rights

These terms do not allow you to sublicense or transfer any of
your licenses to anyone else, or prevent the licensor from
granting licenses to anyone else. These terms do not imply
any other licenses.

## Patent Defense

If you make any written claim that the software infringes or
contributes to infringement of any patent, your patent license
for the software granted under these terms ends immediately. If
your company makes such a claim, your patent license ends
immediately for work on behalf of your company.

## Violations

The first time you are notified in writing that you have
violated any of these terms, or done anything with the software
not covered by your licenses, your licenses can nonetheless
continue if you come into full compliance with these terms,
and take practical steps to correct past violations, within
32 days of receiving notice. Otherwise, all your licenses
end immediately.

## No Liability

***As far as the law allows, the software comes as is, without
any warranty or condition, and the licensor will not be liable
to you for any damages arising out of these terms or the use
or nature of the software, under any kind of legal claim.***

## Definitions

The **licensor** is the individual or entity offering these
terms, and the **software** is the software the licensor makes
available under these terms.

A **product** can be a good or service, or a combination
of them.

**You** refers to the individual or entity agreeing to these
terms.

**Your company** is any legal entity, sole proprietorship,
or other kind of organization that you work for, plus all
its affiliates.

**Affiliates** means the other organizations than an
organization has control over, is under the control of, or is
under common control with.

**Control** means ownership of substantially all the assets of
an entity, or the power to direct its management and policies
by vote, contract, or otherwise. Control can be direct or
indirect.

**Your licenses** are all the licenses granted to you for the
software under these terms.

**Use** means anything you do with the software requiring one
of your licenses.
5 changes: 5 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
proto
Copyright Bitdrift, Inc.

The contents of src/ are licensed under PolyForm Shield. See LICENSE for terms.
Everything else is vendored third party protos which are licensed under their respective terms.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# api
Public facing bitdrift APIs

This repository contains the public facing bitdrift APIs. The high level repository structure is
as follows:
1. `thirdparty/` contains vendored protobuf files required for compilation.
2. `src/` contains the actual APIs as implemented both by the client SDKs as well as any
compliant control plane.

Currently we don't have any high level API documentation but will work on rectifying this in the
future. In the interim the actual proto files should be reasonably well documented and of course
the client SDK code is available for inspection to better understand what the clients send and
receive.

A limited set of bitdrift SaaS APIs are also defined in this repository. Over time this will be
expanded and substantially better documented.
27 changes: 27 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: v2
modules:
- path: thirdparty/
- path: src/
lint:
use:
- DEFAULT
except:
- ENUM_VALUE_PREFIX
- ENUM_ZERO_VALUE_SUFFIX
- FIELD_NOT_REQUIRED
- PACKAGE_NO_IMPORT_CYCLE
- PACKAGE_VERSION_SUFFIX
- RPC_REQUEST_RESPONSE_UNIQUE
- RPC_REQUEST_STANDARD_NAME
- RPC_RESPONSE_STANDARD_NAME
- SERVICE_SUFFIX
ignore:
- thirdparty/
service_suffix: Service
disallow_comment_ignores: true
breaking:
use:
- FILE
except:
- EXTENSION_NO_DELETE
- FIELD_SAME_DEFAULT
Loading
Loading