Skip to content

Commit d58bab2

Browse files
committed
[Feature] Authorization Service V0
1 parent a3ee668 commit d58bab2

30 files changed

+1212
-330
lines changed

.golangci.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ linters-settings:
5757
alias: pbAuthenticationV1
5858
- pkg: github.com/arangodb/kube-arangodb/integrations/authentication/v1
5959
alias: pbImplAuthenticationV1
60+
- pkg: github.com/arangodb/kube-arangodb/integrations/authorization/v0/definition
61+
alias: pbAuthorizationV0
62+
- pkg: github.com/arangodb/kube-arangodb/integrations/authorization/v0
63+
alias: pbImplAuthorizationV0
6064
- pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1/definition
6165
alias: pbSharedV1
6266
- pkg: github.com/arangodb/kube-arangodb/integrations/shared/v1

.protolint.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lint:
2+
rules:
3+
all_default: true
4+
rules_option:
5+
max_line_length:
6+
max_chars: 128

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- (Feature) Extract GRPC Server
55
- (Feature) Extract Integration Service
66
- (Documentation) Move ML Extension example under "CRD overview"
7+
- (Feature) Authentication Service V1
8+
- (Feature) Authorization Service V0
79

810
## [1.2.37](https://github.com/arangodb/kube-arangodb/tree/1.2.37) (2024-01-22)
911
- (Documentation) Improve documentation rendering for GitHub Pages

Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ linter:
347347
linter-fix:
348348
@$(GOPATH)/bin/golangci-lint run --fix --build-tags "$(GOBUILDTAGS)" $(foreach LINT_EXCLUDE,$(LINT_EXCLUDES),--exclude '$(LINT_EXCLUDE)') ./...
349349

350+
.PHONY: protolint protolint-fix
351+
352+
protolint:
353+
@$(GOPATH)/bin/protolint lint $(PROTOSOURCES)
354+
355+
protolint-fix:
356+
@$(GOPATH)/bin/protolint lint --fix $(PROTOSOURCES)
357+
350358
.PHONY: vulncheck vulncheck-optional
351359
vulncheck:
352360
@echo ">> Checking for known vulnerabilities (required)"
@@ -726,6 +734,8 @@ tools-min: update-vendor
726734
@GOBIN=$(GOPATH)/bin go install github.com/google/addlicense@6d92264d717064f28b32464f0f9693a5b4ef0239
727735
@echo ">> Fetching yamlfmt"
728736
@GOBIN=$(GOPATH)/bin go install github.com/google/yamlfmt/cmd/[email protected]
737+
@echo ">> Fetching protolinter"
738+
@GOBIN=$(GOPATH)/bin go install github.com/yoheimuta/protolint/cmd/[email protected]
729739

730740
.PHONY: tools
731741
tools: tools-min
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package definition
22+
23+
const (
24+
Name = "authentication.v1"
25+
)

integrations/authentication/v1/definition/definition.pb.go

+63-62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integrations/authentication/v1/definition/definition.proto

+15-15
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
syntax = "proto3";
2222

23+
package authentication;
24+
2325
import "google/protobuf/duration.proto";
2426

25-
option go_package = "github.com/arangodb/kube-arangodb/integrations/v1/definition";
26-
27-
package authentication;
27+
option go_package = "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition";
2828

2929
// AuthenticationV1 define ServiceInterface for Authentication V1
3030
service AuthenticationV1 {
@@ -38,48 +38,48 @@ service AuthenticationV1 {
3838
// ValidateRequest defines request for AuthenticationV1 Validate Request
3939
message ValidateRequest {
4040
// Token specifies a token extracted from the request or used currently
41-
string Token = 1;
41+
string token = 1;
4242
}
4343

4444
// ValidateResponse defines response for AuthenticationV1 Validate Request
4545
message ValidateResponse {
4646
// IsValid returns information about the validity of the token
47-
bool IsValid = 1;
47+
bool is_valid = 1;
4848

4949
// Message message for the validation phase
50-
string Message = 2;
50+
string message = 2;
5151

5252
// Details returns token details if the token is valid
53-
optional ValidateResponseDetails Details = 3;
53+
optional ValidateResponseDetails details = 3;
5454
}
5555

5656
// ValidateResponseDetails defines optional response for AuthenticationV1 Validate Request.
5757
// Returned only if the Token provided in the request is valid.
5858
message ValidateResponseDetails {
5959
// Lifetime specify the lifetime of the token
60-
google.protobuf.Duration Lifetime = 1;
60+
google.protobuf.Duration lifetime = 1;
6161

6262
// User returns the User used in the Token. If a user is not specified, `root` is returned
63-
string User = 2;
63+
string user = 2;
6464
}
6565

6666
// CreateTokenRequest defines request for AuthenticationV1 CreateToken Request
6767
message CreateTokenRequest {
6868
// Lifetime specifies the lifetime of the token as duration. Defaults to 1 hour
69-
optional google.protobuf.Duration Lifetime = 1;
69+
optional google.protobuf.Duration lifetime = 1;
7070

7171
// User specify the User for which token should be created. By default, the default user is used (root in most cases)
72-
optional string User = 2;
72+
optional string user = 2;
7373
}
7474

7575
// CreateTokenResponse defines response for AuthenticationV1 CreateToken Request
7676
message CreateTokenResponse {
7777
// Lifetime specify the lifetime of the token as the duration
78-
google.protobuf.Duration Lifetime = 1;
78+
google.protobuf.Duration lifetime = 1;
7979

8080
// User returns the User used in the Token
81-
string User = 2;
81+
string user = 2;
8282

8383
// Token returns the Token as a string
84-
string Token = 3;
85-
}
84+
string token = 3;
85+
}

integrations/authentication/v1/implementation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ type implementation struct {
6868
}
6969

7070
func (i *implementation) Name() string {
71-
return "authentication.v1"
71+
return pbAuthenticationV1.Name
7272
}
7373

7474
func (i *implementation) Health() svc.HealthState {

0 commit comments

Comments
 (0)