[#15] Add check verbs and token type

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-07-07 17:24:41 +03:00 committed by Alex Vanin
parent eab43cea3b
commit 5c122a4325
3 changed files with 153 additions and 23 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/go-openapi/errors"
"github.com/google/uuid"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
sessionv2 "github.com/nspcc-dev/neofs-api-go/v2/session"
"github.com/nspcc-dev/neofs-rest-gw/gen/models"
"github.com/nspcc-dev/neofs-rest-gw/gen/restapi/operations"
"github.com/nspcc-dev/neofs-rest-gw/internal/util"
@ -38,6 +39,11 @@ type BearerToken struct {
Key string
}
type SessionToken struct {
BearerToken
Verb sessionv2.ContainerSessionVerb
}
// ContextKey is used for context.Context value. The value requires a key that is not primitive type.
type ContextKey string