Documentation ¶
Overview ¶
Copyright 2020 CYBERCRYPT
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 CYBERCRYPT ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 CYBERCRYPT ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 CYBERCRYPT ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 CYBERCRYPT ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 CYBERCRYPT ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 CYBERCRYPT ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func AuthorizeWrapper(ctx context.Context, messageAuthenticator *crypt.MessageAuthenticator, ...) (*authz.Authorizer, *authz.AccessObject, error)
- func CheckInsecure(config *Config)
- type App
- func (app *App) AddPermission(ctx context.Context, request *AddPermissionRequest) (*AddPermissionResponse, error)
- func (app *App) AuthStorageStreamingInterceptor() grpc.StreamServerInterceptor
- func (app *App) AuthStorageUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func (app *App) AuthenticateUser(ctx context.Context) (context.Context, error)
- func (app *App) CreateAdminCommand()
- func (app *App) CreateUser(ctx context.Context, request *CreateUserRequest) (*CreateUserResponse, error)
- func (app *App) GetPermissions(ctx context.Context, request *GetPermissionsRequest) (*GetPermissionsResponse, error)
- func (app *App) RemovePermission(ctx context.Context, request *RemovePermissionRequest) (*RemovePermissionResponse, error)
- func (app *App) Retrieve(ctx context.Context, request *RetrieveRequest) (*RetrieveResponse, error)
- func (app *App) Store(ctx context.Context, request *StoreRequest) (*StoreResponse, error)
- func (app *App) Version(ctx context.Context, request *VersionRequest) (*VersionResponse, error)
- type Config
- type ContextKey
Constants ¶
const AssociatedDataStoreSuffix = "_aad"
const CiphertextStoreSuffix = "_data"
Variables ¶
var GitCommit string
var GitTag string
Functions ¶
func AuthorizeWrapper ¶
func AuthorizeWrapper(ctx context.Context, messageAuthenticator *crypt.MessageAuthenticator, objectIDString string) (*authz.Authorizer, *authz.AccessObject, error)
Wraps the Authorize call Fails if uid or oid are wrongly formatted or if a user isn't authorized to edit the accessObject
func CheckInsecure ¶
func CheckInsecure(config *Config)
Prevents an accidental deployment with testing parameters
Types ¶
type App ¶
type App struct { Config *Config MessageAuthenticator *crypt.MessageAuthenticator AuthDBPool *pgxpool.Pool ObjectStore objectstorage.ObjectStoreInterface UnimplementedEncryptonizeServer }
func (*App) AddPermission ¶
func (app *App) AddPermission(ctx context.Context, request *AddPermissionRequest) (*AddPermissionResponse, error)
Grant a user access to an object. The requesting user has to be authorized to access the object.
func (*App) AuthStorageStreamingInterceptor ¶
func (app *App) AuthStorageStreamingInterceptor() grpc.StreamServerInterceptor
AuthStorageUnaryServerInterceptor creates a DB AuthStorage instance and injects it into the context. It beginns a DB transcation and takes care of automatic rolling it back if needed.
func (*App) AuthStorageUnaryServerInterceptor ¶
func (app *App) AuthStorageUnaryServerInterceptor() grpc.UnaryServerInterceptor
AuthStorageUnaryServerInterceptor creates a DB AuthStorage instance and injects it into the context. It beginns a DB transcation and takes care of automatic rolling it back if needed.
func (*App) AuthenticateUser ¶
Authenticates user using an Access Token the Access Token contains uid, scopes, and a random value this token has to be integrity protected (e.g. by an HMAC) this method fails if the integrity check failed or the token lacks the required scope
func (*App) CreateAdminCommand ¶
func (app *App) CreateAdminCommand()
CreateAdminCommand creates a new admin users with random credentials This function is intended to be used for cli operation
func (*App) CreateUser ¶
func (app *App) CreateUser(ctx context.Context, request *CreateUserRequest) (*CreateUserResponse, error)
CreateUser is an exposed endpoint that enables admins to create other users Fails if credentials can't be generated or if the derived tag can't be stored
func (*App) GetPermissions ¶
func (app *App) GetPermissions(ctx context.Context, request *GetPermissionsRequest) (*GetPermissionsResponse, error)
Retrieve a list of users who have access to the object specified in the request.
func (*App) RemovePermission ¶
func (app *App) RemovePermission(ctx context.Context, request *RemovePermissionRequest) (*RemovePermissionResponse, error)
Remove a users access to an object. The requesting user has to be authorized to access the object.
func (*App) Retrieve ¶
API exposed function, retrieves a package from storage solution Assumes that user credentials are to be found in context metadata Errors if authentication, authorization, or retrieving the object fails
type Config ¶
type Config struct { KEK []byte ASK []byte AuthStorageURL string ObjectStorageURL string ObjectStorageID string ObjectStorageKey string ObjectStorageCert []byte }
func ParseConfig ¶
type ContextKey ¶
type ContextKey int