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

Change security API to a CRUD API #453

Merged
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
17 changes: 12 additions & 5 deletions security/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,34 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

APIVER = v1alpha1

all: buflint apilint bufgen doc

doc:
rm -rf ./google
rm -f ./v1/autogen.md
mkdir -p ./v1
rm -f ./${APIVER}/autogen.md
mkdir -p ./${APIVER}

# protoc doesn't include annotation and http googleapis, so we have to get them here
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api

docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}"/v1/:/out -w /out -v "${PWD}":/protos pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto"
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I ask you to update Makefiles in other folders, so they look and feel the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll raise a separate PR for making the makefiles consistent across folders.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevedoyle created an issue to track: #457

-v "${PWD}/${APIVER}":/out \
-v "${PWD}/../network/opinetcommon":/opinetcommon \
-w /out \
-v "${PWD}":/protos \
pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /protos -I /opinetcommon --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto"

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0192 --disable-rule=core::0191 --disable-rule=core::0140 --disable-rule=core::0123 --disable-rule=core::0142 --disable-rule=core::0126 --disable-rule=core::0127 --disable-rule=core::0141 --disable-rule=core::0203 --disable-rule=core::0216 --set-exit-status"
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}/../network/opinetcommon":/common -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter -I /common /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}":/out -w /out bufbuild/buf lint

bufgen:
docker run --rm -v "${PWD}/..":/base -v "${PWD}":/out -w /out msandersdell/bufbuild-go-gen:1.1.0 generate --template /base/buf.gen.yaml -o v1
docker run --rm -v "${PWD}/..":/base -v "${PWD}":/out -w /out msandersdell/bufbuild-go-gen:1.1.0 generate --template /base/buf.gen.yaml -o ${APIVER}
11 changes: 3 additions & 8 deletions security/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## Documentation for Reference

* [strongSwan VICI Protocol](https://www.strongswan.org/apidoc/md_src_libcharon_plugins_vici_README.html)
* [vici protocol](https://github.com/strongswan/strongswan/blob/master/src/libcharon/plugins/vici/README.md)
* [govici](https://github.com/strongswan/govici)
* [RFC 9061](https://datatracker.ietf.org/doc/rfc9061/)

## Terminology

Expand All @@ -28,11 +26,8 @@ even more specifically. currently on the IPsec portion of that API.

## Architecture

The OPI Security APIs are currently focusing on implementing an IPsec API which
maps on top of the [strongSwan](https://www.strongswan.org)
[vici Plugin](https://docs.strongswan.org/docs/5.9/plugins/vici.html). For
more details on the vici protocol, you can look at the strongSwan documentation
found [here](https://github.com/strongswan/strongswan/blob/master/src/libcharon/plugins/vici/README.md).
This version of the OPI Security APIs are based on the IPsec configuration
model from on [RFC 9061](https://datatracker.ietf.org/doc/rfc9061/).

The architecture is seen in the diagram below.

Expand Down
13 changes: 9 additions & 4 deletions security/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 28151c0d0a1641bf938a7672c500e01d
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de
commit: f0e53af8f2fc4556b94f482688b57223
digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
commit: f460f71081c14a80b66cc72526e0b322
digest: shake256:122def85e91fc3ef4ab351680060b8f70e9d09a7ae6d1412aeb2bddfeee5c4d3fc8819da33fef56192cec0a817ac0c3e6d49bb2acf02eb5c9e9131739a60ddfc
commit: f04e50c23f5f40f786d0e8fa3fe3d713
digest: shake256:67b115260e12cb2d6c5d5ce8dbbf3a095c86f0e52b84f9dbd16dec9433b218f8694bc9aadb1d45eb6fd52f5a7029977d460e2d58afb3208ab6c680e7b21c80e4
- remote: buf.build
owner: opiproject
repository: opinetcommon
commit: 9779e55c83de44b3a14925b8195cf7e7
digest: shake256:20d43132a22c5d3341919f5167669f137b79b23e807a5c34a3168216a28e07a114f3f7a94b73925f824befd5862ac354d5ad45a3136761ca429f041286657524
10 changes: 9 additions & 1 deletion security/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ name: buf.build/opiproject/security
deps:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
- buf.build/opiproject/opinetcommon
lint:
use:
- DEFAULT
- COMMENTS
except:
- PACKAGE_DIRECTORY_MATCH
- PACKAGE_DIRECTORY_MATCH
# Don't check standard name as that causes google aip issues
- RPC_RESPONSE_STANDARD_NAME
# Allow same name used in request/response type for multiple RPCs
- RPC_REQUEST_RESPONSE_UNIQUE
Loading
Loading