https://github.com/spotify/proto-registry
An implementation of the Protobuf Registry API
https://github.com/spotify/proto-registry
Last synced: 9 months ago
JSON representation
An implementation of the Protobuf Registry API
- Host: GitHub
- URL: https://github.com/spotify/proto-registry
- Owner: spotify
- License: apache-2.0
- Created: 2018-10-05T17:03:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-11T13:54:19.000Z (over 2 years ago)
- Last Synced: 2025-08-03T22:45:55.249Z (11 months ago)
- Language: TypeScript
- Size: 2.54 MB
- Stars: 143
- Watchers: 14
- Forks: 14
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Proto registry [](https://circleci.com/gh/spotify/proto-registry)
**Note:** This project has been discontinued.
This is an implementation of a Protobuf schema registry. Right now, the implementation is fairly
basic and focuses on the documentation aspects of a registry. It is used internally at Spotify
to power our API documentation for gRPC services.
## Demo
A test instance is hosted on Netlify at . Note that
this instance only hosts documentation, and will not serve [Type] requests correctly, because
Netlify only offers hosting of static HTML pages.
## Docker image
This repository builds a docker image that can be used to generate a Protobuf registry for any
set of schemas.
For example, using Google Cloud Build, put this in your `cloudbuild.yaml`:
```yaml
steps:
- name: 'spotify/proto-registry-builder:'
envs:
INPUT: 'schema.fds.pb' # path to a binary Protobuf file containing a FileDescriptorSet
OUTPUT: 'registry' # path to a directory where a Dockerfile + data should be put
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/registry', 'registry' ]
```
## Development
Right now, the building process is a bit hacky. It assumes that there is a file in
`src/schema/schema.pb` containing a `FileDescriptorSet` containing the schema to be browsed. You
can generate that file by running this command on some arbitrary protobufs:
protoc --include_imports --include_source_info \
-o path/to/src/schema/schema.pb \
-I dir dir/**/*.proto
There is a file descriptor set used by the tests that is generated with the `./test/update-testdata`
script that you can use if you don't have `protoc` installed:
gunzip -k test/testdata.fds.pb.gz
cp test/testdata.fds.pb src/schema/schema.pb
After that, simply run the usual:
yarn
yarn start
## Design considerations
The registry responds to resources at `/` only. This matches the API of the
[`Any`][Any] type. The idea is that the registry should respond with documentation when
requested (e.g. when the request specifies `Accept: text/html` or similar) and with a
[`Type`][Type] otherwise.
## Code of Conduct
This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are
expected to honor this code.
[code-of-conduct]: https://github.com/spotify/code-of-conduct/blob/master/code-of-conduct.md
[Any]: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Any
[Type]: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Type