3
0
corteza/internal/auth/interfaces.go
Denis Arh 5bfafd4adc Support run-as for automation scripts
Add grpc-server capabilities for system service (make jwt, find user by id)
Add jwt generation (via grpc) to compose for run-as automation-scripts
Add SuperUser for system-level tasks and operations that are ran in the background w/o initiator
and require permision checking
2019-08-23 13:49:36 +02:00

35 lines
576 B
Go

package auth
import (
"net/http"
)
type (
Identifiable interface {
Identity() uint64
Roles() []uint64
Valid() bool
}
TokenEncoder interface {
Encode(identity Identifiable) string
}
TokenDecoder interface {
Decode(token string) (Identifiable, error)
}
TokenHandler interface {
TokenEncoder
TokenDecoder
HttpVerifier() func(http.Handler) http.Handler
HttpAuthenticator() func(http.Handler) http.Handler
}
Signer interface {
Sign(userID uint64, pp ...interface{}) string
Verify(signature string, userID uint64, pp ...interface{}) bool
}
)