Skip to content

Commit fe030d8

Browse files
committed
[Feature] [Platform] OpenID Logout Endpoints
1 parent 157e3dd commit fe030d8

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- (Feature) Optional LocalStorage CRD
2020
- (Bugfix) Fix Checksum Calculation
2121
- (Bugfix) Implement Missing Group Tolerations
22+
- (Feature) (Platform) OpenID Logout Endpoints
2223

2324
## [1.2.48](https://github.com/arangodb/kube-arangodb/tree/1.2.48) (2025-05-08)
2425
- (Maintenance) Extend Documentation

integrations/authentication/v1/implementation.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
pbAuthenticationV1 "github.com/arangodb/kube-arangodb/integrations/authentication/v1/definition"
4141
"github.com/arangodb/kube-arangodb/integrations/envoy/auth/v3/impl/auth_cookie"
4242
pbSharedV1 "github.com/arangodb/kube-arangodb/integrations/shared/v1/definition"
43+
"github.com/arangodb/kube-arangodb/pkg/apis/platform/v1alpha1/authentication"
4344
"github.com/arangodb/kube-arangodb/pkg/util"
4445
"github.com/arangodb/kube-arangodb/pkg/util/cache"
4546
"github.com/arangodb/kube-arangodb/pkg/util/errors"
@@ -323,7 +324,7 @@ func (i *implementation) Logout(ctx context.Context, req *pbAuthenticationV1.Log
323324

324325
for _, l := range lines {
325326
switch l.Name {
326-
case auth_cookie.JWTAuthorizationCookieName:
327+
case auth_cookie.JWTAuthorizationCookieName, authentication.OpenIDJWTSessionID, authentication.OpenIDJWTRedirect:
327328
l.MaxAge = -1
328329
if err := grpc.SetHeader(ctx, metadata.Pairs("Set-Cookie", l.String())); err != nil {
329330
logger.Err(err).Warn("Unable to set the cookie")
@@ -334,13 +335,10 @@ func (i *implementation) Logout(ctx context.Context, req *pbAuthenticationV1.Log
334335
}
335336
}
336337

337-
location := "/"
338338
if req.Location != nil {
339-
location = req.GetLocation()
340-
}
341-
342-
if err := grpc.SetHeader(ctx, metadata.Pairs("Location", location)); err != nil {
343-
logger.Err(err).Warn("Unable to set the cookie")
339+
if err := grpc.SetHeader(ctx, metadata.Pairs("Location", req.GetLocation())); err != nil {
340+
logger.Err(err).Warn("Unable to set the cookie")
341+
}
344342
}
345343

346344
return &pbSharedV1.Empty{}, nil

integrations/config/v1/impl_darwin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2024-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
2424
"fmt"
2525
"os"
2626
"path"
27-
"strings"
27+
goStrings "strings"
2828
"syscall"
2929
"time"
3030

@@ -40,7 +40,7 @@ import (
4040
func (i *impl) fileDetails(module ModuleDefinition, file string, checksum bool) (*pbConfigV1.ConfigV1File, error) {
4141
expectedPath := path.Clean(path.Join(module.Path, file))
4242

43-
if !strings.HasPrefix(expectedPath, fmt.Sprintf("%s/", module.Path)) {
43+
if !goStrings.HasPrefix(expectedPath, fmt.Sprintf("%s/", module.Path)) {
4444
return nil, status.Errorf(codes.InvalidArgument, "File name cannot be empty")
4545
}
4646

@@ -62,7 +62,7 @@ func (i *impl) fileDetails(module ModuleDefinition, file string, checksum bool)
6262

6363
var f pbConfigV1.ConfigV1File
6464

65-
f.Path = strings.TrimPrefix(expectedPath, fmt.Sprintf("%s/", module.Path))
65+
f.Path = goStrings.TrimPrefix(expectedPath, fmt.Sprintf("%s/", module.Path))
6666
f.Size = finfo.Size
6767
f.Created = timestamppb.New(time.Unix(finfo.Ctimespec.Sec, finfo.Ctimespec.Nsec))
6868
f.Updated = timestamppb.New(time.Unix(finfo.Mtimespec.Sec, finfo.Mtimespec.Nsec))

0 commit comments

Comments
 (0)