2021-04-09 00:28:01 +00:00
|
|
|
// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
|
2020-11-11 22:49:24 +00:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
package oidc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/ory/fosite"
|
|
|
|
|
|
|
|
"go.pinniped.dev/internal/constable"
|
2021-04-09 00:28:01 +00:00
|
|
|
"go.pinniped.dev/internal/fositestoragei"
|
2021-06-15 16:27:30 +00:00
|
|
|
"go.pinniped.dev/internal/oidc/clientregistry"
|
2020-11-11 22:49:24 +00:00
|
|
|
)
|
|
|
|
|
2020-12-01 19:01:23 +00:00
|
|
|
const errNullStorageNotImplemented = constable.Error("NullStorage does not implement this method. It should not have been called.")
|
2020-11-11 22:49:24 +00:00
|
|
|
|
2021-06-15 16:27:30 +00:00
|
|
|
type NullStorage struct {
|
|
|
|
clientregistry.StaticClientManager
|
|
|
|
}
|
2020-11-11 22:49:24 +00:00
|
|
|
|
2021-04-09 00:28:01 +00:00
|
|
|
var _ fositestoragei.AllFositeStorage = &NullStorage{}
|
|
|
|
|
2020-11-11 22:49:24 +00:00
|
|
|
func (NullStorage) RevokeRefreshToken(_ context.Context, _ string) error {
|
2020-12-01 19:01:23 +00:00
|
|
|
return errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) RevokeAccessToken(_ context.Context, _ string) error {
|
2020-12-01 19:01:23 +00:00
|
|
|
return errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) CreateRefreshTokenSession(_ context.Context, _ string, _ fosite.Requester) (err error) {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) GetRefreshTokenSession(_ context.Context, _ string, _ fosite.Session) (request fosite.Requester, err error) {
|
2020-12-01 19:01:23 +00:00
|
|
|
return nil, errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) DeleteRefreshTokenSession(_ context.Context, _ string) (err error) {
|
2020-12-01 19:01:23 +00:00
|
|
|
return errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) CreateAccessTokenSession(_ context.Context, _ string, _ fosite.Requester) (err error) {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) GetAccessTokenSession(_ context.Context, _ string, _ fosite.Session) (request fosite.Requester, err error) {
|
2020-12-01 19:01:23 +00:00
|
|
|
return nil, errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) DeleteAccessTokenSession(_ context.Context, _ string) (err error) {
|
2020-12-01 19:01:23 +00:00
|
|
|
return errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) CreateOpenIDConnectSession(_ context.Context, _ string, _ fosite.Requester) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) GetOpenIDConnectSession(_ context.Context, _ string, _ fosite.Requester) (fosite.Requester, error) {
|
2020-12-01 19:01:23 +00:00
|
|
|
return nil, errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) DeleteOpenIDConnectSession(_ context.Context, _ string) error {
|
2020-12-01 19:01:23 +00:00
|
|
|
return errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) GetPKCERequestSession(_ context.Context, _ string, _ fosite.Session) (fosite.Requester, error) {
|
2020-12-01 19:01:23 +00:00
|
|
|
return nil, errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) CreatePKCERequestSession(_ context.Context, _ string, _ fosite.Requester) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) DeletePKCERequestSession(_ context.Context, _ string) error {
|
2020-12-01 19:01:23 +00:00
|
|
|
return errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) CreateAuthorizeCodeSession(_ context.Context, _ string, _ fosite.Requester) (err error) {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) GetAuthorizeCodeSession(_ context.Context, _ string, _ fosite.Session) (request fosite.Requester, err error) {
|
2020-12-01 19:01:23 +00:00
|
|
|
return nil, errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (NullStorage) InvalidateAuthorizeCodeSession(_ context.Context, _ string) (err error) {
|
2020-12-01 19:01:23 +00:00
|
|
|
return errNullStorageNotImplemented
|
2020-11-11 22:49:24 +00:00
|
|
|
}
|