2020-04-07 11:23:04 +00:00
|
|
|
package repository
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-05-26 14:46:16 +00:00
|
|
|
|
2020-04-07 11:23:04 +00:00
|
|
|
"github.com/caos/zitadel/internal/project/model"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ProjectRepository interface {
|
2020-06-23 05:06:07 +00:00
|
|
|
ProjectByID(ctx context.Context, id string) (*model.ProjectView, error)
|
2020-04-07 11:23:04 +00:00
|
|
|
CreateProject(ctx context.Context, name string) (*model.Project, error)
|
|
|
|
UpdateProject(ctx context.Context, project *model.Project) (*model.Project, error)
|
|
|
|
DeactivateProject(ctx context.Context, id string) (*model.Project, error)
|
|
|
|
ReactivateProject(ctx context.Context, id string) (*model.Project, error)
|
2020-08-05 16:32:25 +00:00
|
|
|
RemoveProject(ctx context.Context, id string) error
|
2020-06-15 12:50:39 +00:00
|
|
|
SearchProjects(ctx context.Context, request *model.ProjectViewSearchRequest) (*model.ProjectViewSearchResponse, error)
|
|
|
|
SearchProjectGrants(ctx context.Context, request *model.ProjectGrantViewSearchRequest) (*model.ProjectGrantViewSearchResponse, error)
|
2020-07-22 12:00:29 +00:00
|
|
|
SearchGrantedProjects(ctx context.Context, request *model.ProjectGrantViewSearchRequest) (*model.ProjectGrantViewSearchResponse, error)
|
2020-06-15 12:50:39 +00:00
|
|
|
ProjectGrantViewByID(ctx context.Context, grantID string) (*model.ProjectGrantView, error)
|
2020-04-15 15:11:42 +00:00
|
|
|
|
2020-06-23 05:06:07 +00:00
|
|
|
ProjectMemberByID(ctx context.Context, projectID, userID string) (*model.ProjectMemberView, error)
|
2020-04-15 15:11:42 +00:00
|
|
|
AddProjectMember(ctx context.Context, member *model.ProjectMember) (*model.ProjectMember, error)
|
|
|
|
ChangeProjectMember(ctx context.Context, member *model.ProjectMember) (*model.ProjectMember, error)
|
|
|
|
RemoveProjectMember(ctx context.Context, projectID, userID string) error
|
2020-05-11 10:16:29 +00:00
|
|
|
SearchProjectMembers(ctx context.Context, request *model.ProjectMemberSearchRequest) (*model.ProjectMemberSearchResponse, error)
|
2020-09-01 14:38:34 +00:00
|
|
|
GetProjectMemberRoles(ctx context.Context) ([]string, error)
|
2020-04-21 15:00:32 +00:00
|
|
|
|
|
|
|
AddProjectRole(ctx context.Context, role *model.ProjectRole) (*model.ProjectRole, error)
|
|
|
|
ChangeProjectRole(ctx context.Context, role *model.ProjectRole) (*model.ProjectRole, error)
|
|
|
|
RemoveProjectRole(ctx context.Context, projectID, key string) error
|
2020-07-15 11:24:36 +00:00
|
|
|
SearchProjectRoles(ctx context.Context, projectId string, request *model.ProjectRoleSearchRequest) (*model.ProjectRoleSearchResponse, error)
|
2020-06-25 09:25:38 +00:00
|
|
|
ProjectChanges(ctx context.Context, id string, lastSequence uint64, limit uint64, sortAscending bool) (*model.ProjectChanges, error)
|
2020-06-19 13:32:03 +00:00
|
|
|
BulkAddProjectRole(ctx context.Context, role []*model.ProjectRole) error
|
2020-04-21 15:00:32 +00:00
|
|
|
|
2020-08-10 07:34:56 +00:00
|
|
|
ApplicationByID(ctx context.Context, projectID, appID string) (*model.ApplicationView, error)
|
2020-04-21 15:00:32 +00:00
|
|
|
AddApplication(ctx context.Context, app *model.Application) (*model.Application, error)
|
|
|
|
ChangeApplication(ctx context.Context, app *model.Application) (*model.Application, error)
|
|
|
|
DeactivateApplication(ctx context.Context, projectID, appID string) (*model.Application, error)
|
|
|
|
ReactivateApplication(ctx context.Context, projectID, appID string) (*model.Application, error)
|
|
|
|
RemoveApplication(ctx context.Context, projectID, appID string) error
|
|
|
|
ChangeOIDCConfig(ctx context.Context, config *model.OIDCConfig) (*model.OIDCConfig, error)
|
|
|
|
ChangeOIDConfigSecret(ctx context.Context, projectID, appID string) (*model.OIDCConfig, error)
|
2020-05-11 10:16:29 +00:00
|
|
|
SearchApplications(ctx context.Context, request *model.ApplicationSearchRequest) (*model.ApplicationSearchResponse, error)
|
2020-06-25 09:25:38 +00:00
|
|
|
ApplicationChanges(ctx context.Context, id string, secId string, lastSequence uint64, limit uint64, sortAscending bool) (*model.ApplicationChanges, error)
|
2020-04-23 05:54:40 +00:00
|
|
|
|
2020-06-23 05:06:07 +00:00
|
|
|
ProjectGrantByID(ctx context.Context, grantID string) (*model.ProjectGrantView, error)
|
2020-06-19 13:32:03 +00:00
|
|
|
AddProjectGrant(ctx context.Context, grant *model.ProjectGrant) (*model.ProjectGrant, error)
|
|
|
|
ChangeProjectGrant(ctx context.Context, grant *model.ProjectGrant) (*model.ProjectGrant, error)
|
2020-05-11 10:16:29 +00:00
|
|
|
DeactivateProjectGrant(ctx context.Context, projectID, grantID string) (*model.ProjectGrant, error)
|
|
|
|
ReactivateProjectGrant(ctx context.Context, projectID, grantID string) (*model.ProjectGrant, error)
|
|
|
|
RemoveProjectGrant(ctx context.Context, projectID, grantID string) error
|
|
|
|
SearchProjectGrantMembers(ctx context.Context, request *model.ProjectGrantMemberSearchRequest) (*model.ProjectGrantMemberSearchResponse, error)
|
2020-04-23 05:54:40 +00:00
|
|
|
|
2020-06-23 05:06:07 +00:00
|
|
|
ProjectGrantMemberByID(ctx context.Context, projectID, userID string) (*model.ProjectGrantMemberView, error)
|
2020-04-23 05:54:40 +00:00
|
|
|
AddProjectGrantMember(ctx context.Context, member *model.ProjectGrantMember) (*model.ProjectGrantMember, error)
|
|
|
|
ChangeProjectGrantMember(ctx context.Context, member *model.ProjectGrantMember) (*model.ProjectGrantMember, error)
|
|
|
|
RemoveProjectGrantMember(ctx context.Context, projectID, grantID, userID string) error
|
2020-05-26 14:46:16 +00:00
|
|
|
GetProjectGrantMemberRoles() []string
|
2020-04-07 11:23:04 +00:00
|
|
|
}
|