Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 111-cli-expansion-stateful-behaviour-more-command-feedback
  • 120-integration-tests-fail
  • 138-making-gnmi-response-processing-more-error-tolerable
  • 140-refactor-pipelines
  • 156-a-setrequest-to-change-a-specific-path-of-an-ond-only-works-for-paths-with-string-values
  • 186-creating-a-device-based-on-plugin-or-csbi-is-not-possible
  • 195-requesting-changes-does-not-work-in-storemode-database
  • 223-database-pnd-store-is-missing-option-to-search-by-name
  • 225-adding-support-and-visualization-for-the-test-coverage2
  • 233-structs-like-loadeddevice-loadedsbi-loadedrole-loadeduser-are-never-passed-as-pointer
  • 242-improve-security-by-enabling-and-enforcing-more-linting-rules
  • 242-improve-security-by-enabling-and-enforcing-more-linting-rules-govet
  • 246-implement-our-own-version-to-send-gnmi-requests
  • 258-deal-with-read-only-fields-in-yang
  • 282-refactoring-of-the-current-test-setup
  • 289-quantum-safe-communication-between-rabbitmq-and-sdn-controller
  • 291-lab-vm-for-arm64-apple
  • 296-related-existing-work-about-change-logic-for-yang-models
  • 320-deadline-and-cancellation-for-grpc-calls
  • 336-add-error-handling-for-mne-watching-if-the-provided-paths-do-not-exist
  • 349-integration-test-for-lab01
  • 350-applying-a-sdn-configuration-should-also-update-the-internal-configuration-of-managed-network
  • 351-link-shadowing-of-global-variables
  • 383-re-organize-comands-in-cli
  • 392-remove-renovate
  • PSD_VGU_Logging
  • add-backup-script
  • add-dockerignore
  • add-script-with-docker-stats
  • add-sr-linux-yang-models
  • add-support-for-mtls-in-plugins
  • allow-slashes-in-branch-names
  • arm-build
  • bump-ygot-generator-to-0-0-5
  • check-unit-tests
  • ci-refactor-1337
  • cli-docs
  • create-health-check-api
  • custom-marshal-for-grpc-gateway
  • deployment-docker-compose
  • develop
  • docker-build-cache-experiments
  • fbi1478-master-patch-42436
  • fix-docker-registry-error
  • fix-linting-in-makefile
  • fix-viper
  • go-plugin-playground
  • gosdn-storage-cleanup
  • heiss_bachelor_thesis
  • hotfix-unique-list-error-from-a-device-get-request
  • integration-test-pipeline-fix
  • inventory-manager-netbox
  • istaester/add-git-hooks
  • istaester/architecture-figures
  • istaester/basic-persistance-layer
  • istaester/bump-ygot-version
  • istaester/cli-tests
  • istaester/db
  • istaester/handle-makefile-in-editorconfig
  • istaester/init-monorepo
  • istaester/plugin-registry
  • istaester/provide-pnd-service
  • istaester/tooling
  • istaester/update-readme
  • master
  • mb/plugin-registry
  • mk/benchmark-stores
  • mpsd-at-vgu
  • neil/cobra-tests
  • new-integration-test-setup-v1
  • profile
  • proto-getters
  • recursive-read-only-try-1337
  • registry-used-by-app
  • remove-stuff
  • renovate/babel-runtime-7.x-lockfile
  • renovate/buf.build-gen-go-bufbuild-protovalidate-protocolbuffers-go-1.x
  • renovate/dompurify-3.x-lockfile
  • renovate/eslint-9.x-lockfile
  • renovate/eslint-plugin-prettier-5.x-lockfile
  • renovate/eslint-plugin-react-7.x-lockfile
  • renovate/eslint-plugin-react-hooks-5.x-lockfile
  • renovate/eslint-plugin-react-refresh-0.x-lockfile
  • renovate/fortawesome-fontawesome-svg-core-6.x-lockfile
  • renovate/fortawesome-free-regular-svg-icons-6.x-lockfile
  • renovate/fortawesome-free-solid-svg-icons-6.x-lockfile
  • renovate/github.com-aristanetworks-goarista-digest
  • renovate/github.com-bufbuild-protovalidate-go-0.x
  • renovate/github.com-docker-docker-27.x
  • renovate/github.com-docker-docker-28.x
  • renovate/github.com-grpc-ecosystem-grpc-gateway-v2-2.x
  • renovate/github.com-hashicorp-go-plugin-1.x
  • renovate/github.com-lesismal-nbio-1.x
  • renovate/github.com-openconfig-gnmi-0.x
  • renovate/github.com-prometheus-client_golang-1.x
  • renovate/go.mongodb.org-mongo-driver-2.x
  • renovate/golangci-golangci-lint-1.x
  • renovate/google.golang.org-genproto-googleapis-api-digest
  • renovate/react-18.x-lockfile
  • renovate/react-bootstrap-2.x-lockfile
  • 0.1.0
101 results

Target

Select target project
  • danet/gosdn
1 result
Select Git revision
  • 111-cli-expansion-stateful-behaviour-more-command-feedback
  • 120-integration-tests-fail
  • 138-making-gnmi-response-processing-more-error-tolerable
  • 140-refactor-pipelines
  • 156-a-setrequest-to-change-a-specific-path-of-an-ond-only-works-for-paths-with-string-values
  • 186-creating-a-device-based-on-plugin-or-csbi-is-not-possible
  • 195-requesting-changes-does-not-work-in-storemode-database
  • 223-database-pnd-store-is-missing-option-to-search-by-name
  • 225-adding-support-and-visualization-for-the-test-coverage2
  • 233-structs-like-loadeddevice-loadedsbi-loadedrole-loadeduser-are-never-passed-as-pointer
  • 242-improve-security-by-enabling-and-enforcing-more-linting-rules
  • 242-improve-security-by-enabling-and-enforcing-more-linting-rules-govet
  • 246-implement-our-own-version-to-send-gnmi-requests
  • 258-deal-with-read-only-fields-in-yang
  • 282-refactoring-of-the-current-test-setup
  • 289-quantum-safe-communication-between-rabbitmq-and-sdn-controller
  • 291-lab-vm-for-arm64-apple
  • 296-related-existing-work-about-change-logic-for-yang-models
  • 320-deadline-and-cancellation-for-grpc-calls
  • 336-add-error-handling-for-mne-watching-if-the-provided-paths-do-not-exist
  • 349-integration-test-for-lab01
  • 350-applying-a-sdn-configuration-should-also-update-the-internal-configuration-of-managed-network
  • 351-link-shadowing-of-global-variables
  • 383-re-organize-comands-in-cli
  • 392-remove-renovate
  • PSD_VGU_Logging
  • add-backup-script
  • add-dockerignore
  • add-script-with-docker-stats
  • add-sr-linux-yang-models
  • add-support-for-mtls-in-plugins
  • allow-slashes-in-branch-names
  • arm-build
  • bump-ygot-generator-to-0-0-5
  • check-unit-tests
  • ci-refactor-1337
  • cli-docs
  • create-health-check-api
  • custom-marshal-for-grpc-gateway
  • deployment-docker-compose
  • develop
  • docker-build-cache-experiments
  • fbi1478-master-patch-42436
  • fix-docker-registry-error
  • fix-linting-in-makefile
  • fix-viper
  • go-plugin-playground
  • gosdn-storage-cleanup
  • heiss_bachelor_thesis
  • hotfix-unique-list-error-from-a-device-get-request
  • integration-test-pipeline-fix
  • inventory-manager-netbox
  • istaester/add-git-hooks
  • istaester/architecture-figures
  • istaester/basic-persistance-layer
  • istaester/bump-ygot-version
  • istaester/cli-tests
  • istaester/db
  • istaester/handle-makefile-in-editorconfig
  • istaester/init-monorepo
  • istaester/plugin-registry
  • istaester/provide-pnd-service
  • istaester/tooling
  • istaester/update-readme
  • master
  • mb/plugin-registry
  • mk/benchmark-stores
  • mpsd-at-vgu
  • neil/cobra-tests
  • new-integration-test-setup-v1
  • profile
  • proto-getters
  • recursive-read-only-try-1337
  • registry-used-by-app
  • remove-stuff
  • renovate/babel-runtime-7.x-lockfile
  • renovate/buf.build-gen-go-bufbuild-protovalidate-protocolbuffers-go-1.x
  • renovate/dompurify-3.x-lockfile
  • renovate/eslint-9.x-lockfile
  • renovate/eslint-plugin-prettier-5.x-lockfile
  • renovate/eslint-plugin-react-7.x-lockfile
  • renovate/eslint-plugin-react-hooks-5.x-lockfile
  • renovate/eslint-plugin-react-refresh-0.x-lockfile
  • renovate/fortawesome-fontawesome-svg-core-6.x-lockfile
  • renovate/fortawesome-free-regular-svg-icons-6.x-lockfile
  • renovate/fortawesome-free-solid-svg-icons-6.x-lockfile
  • renovate/github.com-aristanetworks-goarista-digest
  • renovate/github.com-bufbuild-protovalidate-go-0.x
  • renovate/github.com-docker-docker-27.x
  • renovate/github.com-docker-docker-28.x
  • renovate/github.com-grpc-ecosystem-grpc-gateway-v2-2.x
  • renovate/github.com-hashicorp-go-plugin-1.x
  • renovate/github.com-lesismal-nbio-1.x
  • renovate/github.com-openconfig-gnmi-0.x
  • renovate/github.com-prometheus-client_golang-1.x
  • renovate/go.mongodb.org-mongo-driver-2.x
  • renovate/golangci-golangci-lint-1.x
  • renovate/google.golang.org-genproto-googleapis-api-digest
  • renovate/react-18.x-lockfile
  • renovate/react-bootstrap-2.x-lockfile
  • 0.1.0
101 results
Show changes
Commits on Source (20)
Showing
with 2471 additions and 1602 deletions
......@@ -10,3 +10,8 @@ end_of_line = lf
[{*.yaml, *.yml}]
indent_size = 2
[{Makefile,**.mk}]
# Use tabs for indentation (Makefiles require tabs)
indent_style = tab
......@@ -20,3 +20,4 @@ cli/gosdnc
# testing and configs
controller/configs/testing-gosdn.toml
controller/configs/development-gosdn.toml
controller/configs/containerlab-gosdn.toml
variables:
GOSDN_IMAGE: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}"
GOSDN_TESTING_IMAGE: "${CI_REGISTRY_IMAGE}:testing_${CI_COMMIT_SHA}"
CEOS_IMAGE: "${CI_PCONTAINERS_REGISTRY_IMAGE}/ceos:latest"
CEOS_IMAGE: "${CI_PCONTAINERS_REGISTRY_IMAGE}/ceos:4.28.0F"
GOLANG_VERSION: "1.18"
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'push'
stages:
- build
- test
......
......@@ -4,21 +4,9 @@
- shell-builder
variables:
TAG: $CI_COMMIT_SHA
before_script:
# replace all slashes in the tag with hyphen, because slashes are not allowed in tags
- TAG=${TAG//\//-}
needs: []
build-testing-image:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
TAG: latest
- if: $CI_COMMIT_BRANCH == "develop"
variables:
TAG: $CI_COMMIT_BRANCH
BUILDARGS: -race
- when: always
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t "$GOSDN_TESTING_IMAGE" -f "${CI_PROJECT_DIR}/controller/Dockerfile" --target "installer" --build-arg "GOLANG_VERSION=$GOLANG_VERSION" --build-arg "BUILDARGS=$BUILDARGS" --build-arg "GITLAB_PROXY=${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/" .
......@@ -26,19 +14,12 @@ build-testing-image:
<<: *build
build-image:
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
TAG: $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == "develop"
variables:
TAG: develop
BUILDARGS: -race
- when: always
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t "$CI_REGISTRY_IMAGE:$TAG" -f "${CI_PROJECT_DIR}/controller/Dockerfile" --target "installer" --build-arg "GOLANG_VERSION=$GOLANG_VERSION" --build-arg "BUILDARGS=$BUILDARGS" --build-arg "GITLAB_PROXY=${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/" .
- docker build -t "$CI_REGISTRY_IMAGE:$TAG" -f "${CI_PROJECT_DIR}/controller/Dockerfile" --build-arg "GOLANG_VERSION=$GOLANG_VERSION" --build-arg "BUILDARGS=$BUILDARGS" --build-arg "GITLAB_PROXY=${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/" .
- docker push "$CI_REGISTRY_IMAGE:$TAG"
# replace all slashes in the tag with hyphen, because slashes are not allowed in tags
- NEWTAG=${CI_COMMIT_BRANCH//\//-}
- docker tag "$CI_REGISTRY_IMAGE:$TAG" "$CI_REGISTRY_IMAGE:$NEWTAG"
- docker push "$CI_REGISTRY_IMAGE:$NEWTAG"
<<: *build
......@@ -5,10 +5,6 @@ variables:
containerlab-deploy:
stage: integration-test
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: never
- when: on_success
tags:
- shell-containerlab
needs: ["build-image", "build-testing-image"]
......@@ -43,10 +39,6 @@ containerlab-deploy:
containerlab-destroy:
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: never
- when: always
stage: integration-test
tags:
- shell-containerlab
......
.integration-test: &integration-test
image: $GOSDN_TESTING_IMAGE
stage: integration-test
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: never
- when: on_success
needs:
["containerlab-deploy"]
variables:
......
.rules: &rules
stage: analyze
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: never
- when: always
needs: []
sast:
......@@ -36,10 +32,6 @@ semgrep-sast:
container_scanning:
stage: analyze
rules:
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: never
- when: always
variables:
DOCKER_IMAGE: "${GOSDN_IMAGE}"
DOCKER_USER: "${CI_REGISTRY_USER}"
......
......@@ -18,6 +18,7 @@ unit-test:
- cd controller
- make ci-unit-test
after_script:
- cd controller
- go tool cover -func=coverage.out
<<: *test
......
......@@ -5,6 +5,7 @@ run:
issues-exit-code: 1
# directories to be ignored by linters
skip-dirs:
- artifacts
- controller/forks
- controller/test
- controller/mocks
......
......@@ -2,6 +2,7 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
TOOLS_DIR:= build-tools
GOSDN_PRG := $(MAKEFILE_DIR)$(TOOLS_DIR)
GOPATH := $(~/go)
GOBIN := $(GOSDN_PRG)
GOCMD=go
......@@ -18,8 +19,9 @@ pre:
install-tools:
@echo Install development tooling
mkdir -p $(GOSDN_PRG)
go install gotest.tools/gotestsum@v1.7.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.1
export GOBIN=$(GOSDN_PRG) && go install gotest.tools/gotestsum@v1.7.0 &&\
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.1 &&\
go install github.com/vektra/mockery/v2@v2.11.0
@echo Finished installing development tooling
ci-install-tools:
......@@ -34,6 +36,9 @@ lint: install-tools
lint-fix: install-tools
./$(TOOLS_DIR)/golangci-lint run --config .golangci.yml --fix | jq
generate-controller-mocks: install-tools
./$(TOOLS_DIR)/mockery --all --output './controller/mocks' --dir './controller/interfaces/'
build: pre
$(GOBUILD) -o $(BUILD_ARTIFACTS_PATH)/gosdn ./controller/cmd/gosdn
CGO_ENABLED=0 $(GOBUILD) -o $(BUILD_ARTIFACTS_PATH)/gosdnc ./cli/
......
......@@ -17,7 +17,8 @@
# Overview
`goSDN` is also an application that will allow you to manage your multi-vendor network using one unified controller.
`goSDN` is also an application that will allow you to manage your multi-vendor
network using one unified controller.
`goSDN` provides:
* Model driven device representation
......@@ -25,7 +26,8 @@
* Multi controller environments
## Example
A simple showcase how the controller can be adressed after `make containerlab-start` is shown below:
A simple showcase how the controller can be adressed after
`make containerlab-start` is shown below:
![](gosdn-cli-showcase.webm)
......@@ -42,9 +44,9 @@ A simple showcase how the controller can be adressed after `make containerlab-st
# Concepts
The `goSDN` controllers core - also called `nucleus` - is a lightweight library that
manages principal network domains and provides southbound interface operations
for orchestrated networking devices.
The `goSDN` controllers core - also called `nucleus` - is a lightweight library
that manages principal network domains and provides southbound interface
operations for orchestrated networking devices.
In addition we provide a simple Northbound-API for the controller ()
......@@ -74,8 +76,9 @@ running `./gosdn` from the shell.
# Getting Started
If you want to use the the [playground](#playground) you have to make sure you have
[containerlab](https://containerlab.dev/install/) installed on your system.
If you want to use the the [playground](#playground) you have to make sure you
have [containerlab](https://containerlab.dev/install/) installed on your
system.
## Playground
......@@ -86,9 +89,16 @@ The environment contains two [Arista
cEOS](https://www.arista.com/en/products/software-controlled-container-networking),
a goSDN, a cSBI orchestrator and a gNMI target.
> If you're a member of the danet group you should have access to the containers repo. Don't forget to `docker login registry.code.fbi.h-da.de`
> If you're a member of the danet group you should have access to the
> containers repo. Don't forget to `sudo docker login
> registry.code.fbi.h-da.de` (`sudo` is necessary since `containerlab` has to
> be run with it and therefore a normal `docker login` wouldn't be recognized
> by it.)
>
> If you're no member of the danet group you have to [create an account](https://www.arista.com/en/login) at Arista and download the Arista cEOS image by yourself. Don't forget to change the image name (line `11` in the `gosdn.clab.yml` file) to the local one you've downloaded.
> If you're no member of the danet group you have to [create an
> account](https://www.arista.com/en/login) at Arista and download the Arista
> cEOS image by yourself. Don't forget to change the image name (line `11` in
> the `gosdn.clab.yml` file) to the local one you've downloaded.
```sh
# starts the containerlab topology which contains two Arista cEOS, an cSBI orchestrator, a goSDN controller and gNMI target.
......
build:
buf mod update proto
buf generate
lint:
buf lint
This diff is collapsed.
......@@ -587,7 +587,7 @@ func request_PndService_GetChange_0(ctx context.Context, marshaler runtime.Marsh
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cuid")
}
protoReq.Cuid, err = runtime.String(val)
protoReq.Cuid, err = runtime.StringSlice(val, ",")
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cuid", err)
}
......@@ -630,7 +630,7 @@ func local_request_PndService_GetChange_0(ctx context.Context, marshaler runtime
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "cuid")
}
protoReq.Cuid, err = runtime.String(val)
protoReq.Cuid, err = runtime.StringSlice(val, ",")
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "cuid", err)
}
......
This diff is collapsed.
......@@ -135,146 +135,6 @@ func local_request_AuthService_Logout_0(ctx context.Context, marshaler runtime.M
}
func request_AuthService_CreateUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateUsersRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.CreateUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_CreateUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateUsersRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.CreateUsers(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_AuthService_GetUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_AuthService_GetUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetUsersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetUsers_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_GetUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetUsersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetUsers_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetUsers(ctx, &protoReq)
return msg, metadata, err
}
func request_AuthService_UpdateUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateUsersRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.UpdateUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_UpdateUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateUsersRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.UpdateUsers(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_AuthService_DeleteUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_AuthService_DeleteUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteUsersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_DeleteUsers_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.DeleteUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_DeleteUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteUsersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_DeleteUsers_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.DeleteUsers(ctx, &protoReq)
return msg, metadata, err
}
// RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux".
// UnaryRPC :call AuthServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
......@@ -327,98 +187,6 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("POST", pattern_AuthService_CreateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/CreateUsers", runtime.WithHTTPPathPattern("/users/create"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_CreateUsers_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_CreateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_AuthService_GetUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetUsers", runtime.WithHTTPPathPattern("/users"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_GetUsers_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_GetUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_AuthService_UpdateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/UpdateUsers", runtime.WithHTTPPathPattern("/users/update"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_UpdateUsers_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_UpdateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_AuthService_DeleteUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/DeleteUsers", runtime.WithHTTPPathPattern("/users/delete"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_DeleteUsers_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_DeleteUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
......@@ -500,86 +268,6 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("POST", pattern_AuthService_CreateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/CreateUsers", runtime.WithHTTPPathPattern("/users/create"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_CreateUsers_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_CreateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_AuthService_GetUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetUsers", runtime.WithHTTPPathPattern("/users"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_GetUsers_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_GetUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_AuthService_UpdateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/UpdateUsers", runtime.WithHTTPPathPattern("/users/update"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_UpdateUsers_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_UpdateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_AuthService_DeleteUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/DeleteUsers", runtime.WithHTTPPathPattern("/users/delete"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_DeleteUsers_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_DeleteUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
......@@ -587,26 +275,10 @@ var (
pattern_AuthService_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"login"}, ""))
pattern_AuthService_Logout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"logout", "username"}, ""))
pattern_AuthService_CreateUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "create"}, ""))
pattern_AuthService_GetUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"users"}, ""))
pattern_AuthService_UpdateUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "update"}, ""))
pattern_AuthService_DeleteUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "delete"}, ""))
)
var (
forward_AuthService_Login_0 = runtime.ForwardResponseMessage
forward_AuthService_Logout_0 = runtime.ForwardResponseMessage
forward_AuthService_CreateUsers_0 = runtime.ForwardResponseMessage
forward_AuthService_GetUsers_0 = runtime.ForwardResponseMessage
forward_AuthService_UpdateUsers_0 = runtime.ForwardResponseMessage
forward_AuthService_DeleteUsers_0 = runtime.ForwardResponseMessage
)
......@@ -22,20 +22,6 @@ type AuthServiceClient interface {
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
// Allows a user to log out from an existing session.
Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
// Create users with the provided parameters, creation of multiple users requires login beforehand.
// Highest possible permissions of new users is of current permission level.
// If not logged in: Created user has lowest possible permissions, only one user can be created this way.
CreateUsers(ctx context.Context, in *CreateUsersRequest, opts ...grpc.CallOption) (*CreateUsersResponse, error)
// Requests information about available users, requires login beforehand.
// Requires highest possible permissions.
GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*GetUsersResponse, error)
// Updates users with the provided parameters, requires login beforehand.
// Requires highest permissions to change other users, everyone else can only update their own account.
// // Requires highest permissions to change multiple users at the same time.
UpdateUsers(ctx context.Context, in *UpdateUsersRequest, opts ...grpc.CallOption) (*UpdateUsersResponse, error)
// Deletes users, requires login beforehand.
// Requires highest permissions.
DeleteUsers(ctx context.Context, in *DeleteUsersRequest, opts ...grpc.CallOption) (*DeleteUsersResponse, error)
}
type authServiceClient struct {
......@@ -64,42 +50,6 @@ func (c *authServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts
return out, nil
}
func (c *authServiceClient) CreateUsers(ctx context.Context, in *CreateUsersRequest, opts ...grpc.CallOption) (*CreateUsersResponse, error) {
out := new(CreateUsersResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/CreateUsers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*GetUsersResponse, error) {
out := new(GetUsersResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/GetUsers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) UpdateUsers(ctx context.Context, in *UpdateUsersRequest, opts ...grpc.CallOption) (*UpdateUsersResponse, error) {
out := new(UpdateUsersResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/UpdateUsers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) DeleteUsers(ctx context.Context, in *DeleteUsersRequest, opts ...grpc.CallOption) (*DeleteUsersResponse, error) {
out := new(DeleteUsersResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/DeleteUsers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthServiceServer is the server API for AuthService service.
// All implementations must embed UnimplementedAuthServiceServer
// for forward compatibility
......@@ -108,20 +58,6 @@ type AuthServiceServer interface {
Login(context.Context, *LoginRequest) (*LoginResponse, error)
// Allows a user to log out from an existing session.
Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
// Create users with the provided parameters, creation of multiple users requires login beforehand.
// Highest possible permissions of new users is of current permission level.
// If not logged in: Created user has lowest possible permissions, only one user can be created this way.
CreateUsers(context.Context, *CreateUsersRequest) (*CreateUsersResponse, error)
// Requests information about available users, requires login beforehand.
// Requires highest possible permissions.
GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error)
// Updates users with the provided parameters, requires login beforehand.
// Requires highest permissions to change other users, everyone else can only update their own account.
// // Requires highest permissions to change multiple users at the same time.
UpdateUsers(context.Context, *UpdateUsersRequest) (*UpdateUsersResponse, error)
// Deletes users, requires login beforehand.
// Requires highest permissions.
DeleteUsers(context.Context, *DeleteUsersRequest) (*DeleteUsersResponse, error)
mustEmbedUnimplementedAuthServiceServer()
}
......@@ -135,18 +71,6 @@ func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*Lo
func (UnimplementedAuthServiceServer) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
}
func (UnimplementedAuthServiceServer) CreateUsers(context.Context, *CreateUsersRequest) (*CreateUsersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateUsers not implemented")
}
func (UnimplementedAuthServiceServer) GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUsers not implemented")
}
func (UnimplementedAuthServiceServer) UpdateUsers(context.Context, *UpdateUsersRequest) (*UpdateUsersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateUsers not implemented")
}
func (UnimplementedAuthServiceServer) DeleteUsers(context.Context, *DeleteUsersRequest) (*DeleteUsersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteUsers not implemented")
}
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
......@@ -196,78 +120,6 @@ func _AuthService_Logout_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler)
}
func _AuthService_CreateUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateUsersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).CreateUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.AuthService/CreateUsers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).CreateUsers(ctx, req.(*CreateUsersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUsersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).GetUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.AuthService/GetUsers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).GetUsers(ctx, req.(*GetUsersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_UpdateUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateUsersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).UpdateUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.AuthService/UpdateUsers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).UpdateUsers(ctx, req.(*UpdateUsersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteUsersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).DeleteUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.AuthService/DeleteUsers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).DeleteUsers(ctx, req.(*DeleteUsersRequest))
}
return interceptor(ctx, in, info, handler)
}
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
......@@ -283,22 +135,6 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{
MethodName: "Logout",
Handler: _AuthService_Logout_Handler,
},
{
MethodName: "CreateUsers",
Handler: _AuthService_CreateUsers_Handler,
},
{
MethodName: "GetUsers",
Handler: _AuthService_GetUsers_Handler,
},
{
MethodName: "UpdateUsers",
Handler: _AuthService_UpdateUsers_Handler,
},
{
MethodName: "DeleteUsers",
Handler: _AuthService_DeleteUsers_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "gosdn/rbac/rbac.proto",
......
This diff is collapsed.
This diff is collapsed.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package rbac
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// RoleServiceClient is the client API for RoleService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type RoleServiceClient interface {
// Creates roles, requires login beforehand.
// Requires highest permissions.
CreateRoles(ctx context.Context, in *CreateRolesRequest, opts ...grpc.CallOption) (*CreateRolesResponse, error)
// Requests one role with its permissions, requires login beforehand.
// Requires highest permissions.
GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error)
// Requests all roles with their permissions, requires login beforehand.
// Requires highest permissions.
GetRoles(ctx context.Context, in *GetRolesRequest, opts ...grpc.CallOption) (*GetRolesResponse, error)
// Updates roles by setting the provided permissions, requires login beforehand.
// Requires highest permissions.
UpdateRoles(ctx context.Context, in *UpdateRolesRequest, opts ...grpc.CallOption) (*UpdateRolesResponse, error)
// Deletes permissions from given role, requires login beforehand.
// Requires highest permissions.
DeletePermissionsForRole(ctx context.Context, in *DeletePermissionsForRoleRequest, opts ...grpc.CallOption) (*DeletePermissionsForRoleResponse, error)
// Deletes roles with their permissions, requires login beforehand.
// Requires highest permissions.
DeleteRoles(ctx context.Context, in *DeleteRolesRequest, opts ...grpc.CallOption) (*DeleteRolesResponse, error)
}
type roleServiceClient struct {
cc grpc.ClientConnInterface
}
func NewRoleServiceClient(cc grpc.ClientConnInterface) RoleServiceClient {
return &roleServiceClient{cc}
}
func (c *roleServiceClient) CreateRoles(ctx context.Context, in *CreateRolesRequest, opts ...grpc.CallOption) (*CreateRolesResponse, error) {
out := new(CreateRolesResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/CreateRoles", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) {
out := new(GetRoleResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/GetRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) GetRoles(ctx context.Context, in *GetRolesRequest, opts ...grpc.CallOption) (*GetRolesResponse, error) {
out := new(GetRolesResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/GetRoles", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) UpdateRoles(ctx context.Context, in *UpdateRolesRequest, opts ...grpc.CallOption) (*UpdateRolesResponse, error) {
out := new(UpdateRolesResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/UpdateRoles", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) DeletePermissionsForRole(ctx context.Context, in *DeletePermissionsForRoleRequest, opts ...grpc.CallOption) (*DeletePermissionsForRoleResponse, error) {
out := new(DeletePermissionsForRoleResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/DeletePermissionsForRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleServiceClient) DeleteRoles(ctx context.Context, in *DeleteRolesRequest, opts ...grpc.CallOption) (*DeleteRolesResponse, error) {
out := new(DeleteRolesResponse)
err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/DeleteRoles", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// RoleServiceServer is the server API for RoleService service.
// All implementations must embed UnimplementedRoleServiceServer
// for forward compatibility
type RoleServiceServer interface {
// Creates roles, requires login beforehand.
// Requires highest permissions.
CreateRoles(context.Context, *CreateRolesRequest) (*CreateRolesResponse, error)
// Requests one role with its permissions, requires login beforehand.
// Requires highest permissions.
GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error)
// Requests all roles with their permissions, requires login beforehand.
// Requires highest permissions.
GetRoles(context.Context, *GetRolesRequest) (*GetRolesResponse, error)
// Updates roles by setting the provided permissions, requires login beforehand.
// Requires highest permissions.
UpdateRoles(context.Context, *UpdateRolesRequest) (*UpdateRolesResponse, error)
// Deletes permissions from given role, requires login beforehand.
// Requires highest permissions.
DeletePermissionsForRole(context.Context, *DeletePermissionsForRoleRequest) (*DeletePermissionsForRoleResponse, error)
// Deletes roles with their permissions, requires login beforehand.
// Requires highest permissions.
DeleteRoles(context.Context, *DeleteRolesRequest) (*DeleteRolesResponse, error)
mustEmbedUnimplementedRoleServiceServer()
}
// UnimplementedRoleServiceServer must be embedded to have forward compatible implementations.
type UnimplementedRoleServiceServer struct {
}
func (UnimplementedRoleServiceServer) CreateRoles(context.Context, *CreateRolesRequest) (*CreateRolesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateRoles not implemented")
}
func (UnimplementedRoleServiceServer) GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented")
}
func (UnimplementedRoleServiceServer) GetRoles(context.Context, *GetRolesRequest) (*GetRolesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRoles not implemented")
}
func (UnimplementedRoleServiceServer) UpdateRoles(context.Context, *UpdateRolesRequest) (*UpdateRolesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateRoles not implemented")
}
func (UnimplementedRoleServiceServer) DeletePermissionsForRole(context.Context, *DeletePermissionsForRoleRequest) (*DeletePermissionsForRoleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeletePermissionsForRole not implemented")
}
func (UnimplementedRoleServiceServer) DeleteRoles(context.Context, *DeleteRolesRequest) (*DeleteRolesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteRoles not implemented")
}
func (UnimplementedRoleServiceServer) mustEmbedUnimplementedRoleServiceServer() {}
// UnsafeRoleServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RoleServiceServer will
// result in compilation errors.
type UnsafeRoleServiceServer interface {
mustEmbedUnimplementedRoleServiceServer()
}
func RegisterRoleServiceServer(s grpc.ServiceRegistrar, srv RoleServiceServer) {
s.RegisterService(&RoleService_ServiceDesc, srv)
}
func _RoleService_CreateRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateRolesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).CreateRoles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.RoleService/CreateRoles",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).CreateRoles(ctx, req.(*CreateRolesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRoleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).GetRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.RoleService/GetRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).GetRole(ctx, req.(*GetRoleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_GetRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRolesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).GetRoles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.RoleService/GetRoles",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).GetRoles(ctx, req.(*GetRolesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_UpdateRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateRolesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).UpdateRoles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.RoleService/UpdateRoles",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).UpdateRoles(ctx, req.(*UpdateRolesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_DeletePermissionsForRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePermissionsForRoleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).DeletePermissionsForRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.RoleService/DeletePermissionsForRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).DeletePermissionsForRole(ctx, req.(*DeletePermissionsForRoleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RoleService_DeleteRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteRolesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServiceServer).DeleteRoles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gosdn.rbac.RoleService/DeleteRoles",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServiceServer).DeleteRoles(ctx, req.(*DeleteRolesRequest))
}
return interceptor(ctx, in, info, handler)
}
// RoleService_ServiceDesc is the grpc.ServiceDesc for RoleService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RoleService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gosdn.rbac.RoleService",
HandlerType: (*RoleServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateRoles",
Handler: _RoleService_CreateRoles_Handler,
},
{
MethodName: "GetRole",
Handler: _RoleService_GetRole_Handler,
},
{
MethodName: "GetRoles",
Handler: _RoleService_GetRoles_Handler,
},
{
MethodName: "UpdateRoles",
Handler: _RoleService_UpdateRoles_Handler,
},
{
MethodName: "DeletePermissionsForRole",
Handler: _RoleService_DeletePermissionsForRole_Handler,
},
{
MethodName: "DeleteRoles",
Handler: _RoleService_DeleteRoles_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "gosdn/rbac/role.proto",
}