Prefer slices package and slices.Concat where possible

This commit is contained in:
Joshua Casey
2024-05-20 22:15:53 -05:00
parent bdd79a9984
commit fe911a7b7a
26 changed files with 97 additions and 85 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Package filesession implements the file format for session caches.
@@ -9,6 +9,7 @@ import (
"fmt"
"os"
"reflect"
"slices"
"sort"
"time"
@@ -153,5 +154,5 @@ func (c *sessionCache) lookup(key oidcclient.SessionCacheKey) *sessionEntry {
// insert a cache entry.
func (c *sessionCache) insert(entries ...sessionEntry) {
c.Sessions = append(c.Sessions, entries...)
c.Sessions = slices.Concat(c.Sessions, entries)
}

View File

@@ -480,7 +480,7 @@ func (h *handlerState) baseLogin() (*oidctypes.Token, error) {
return nil, err
}
h.loginFlow = loginFlow
authorizeOptions = append(authorizeOptions, pinnipedSupervisorOptions...)
authorizeOptions = slices.Concat(authorizeOptions, pinnipedSupervisorOptions)
// Preserve the legacy behavior where browser-based auth is preferred
authFunc := h.webBrowserBasedAuth