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 {
|
|
|
|
ProjectByID(ctx context.Context, id string) (*model.Project, error)
|
|
|
|
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-05-11 10:16:29 +00:00
|
|
|
SearchGrantedProjects(ctx context.Context, request *model.GrantedProjectSearchRequest) (*model.GrantedProjectSearchResponse, error)
|
2020-06-10 12:28:15 +00:00
|
|
|
GetGrantedProjectGrantByIDs(ctx context.Context, projectID, grantID string) (*model.GrantedProjectView, error)
|
2020-04-15 15:11:42 +00:00
|
|
|
|
|
|
|
ProjectMemberByID(ctx context.Context, projectID, userID string) (*model.ProjectMember, error)
|
|
|
|
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-05-26 14:46:16 +00:00
|
|
|
GetProjectMemberRoles() []string
|
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-05-11 10:16:29 +00:00
|
|
|
SearchProjectRoles(ctx context.Context, request *model.ProjectRoleSearchRequest) (*model.ProjectRoleSearchResponse, error)
|
2020-04-21 15:00:32 +00:00
|
|
|
|
|
|
|
ApplicationByID(ctx context.Context, projectID, appID string) (*model.Application, error)
|
|
|
|
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-04-23 05:54:40 +00:00
|
|
|
|
2020-05-11 10:16:29 +00:00
|
|
|
ProjectGrantByID(ctx context.Context, projectID, grantID string) (*model.ProjectGrant, error)
|
2020-04-23 05:54:40 +00:00
|
|
|
AddProjectGrant(ctx context.Context, app *model.ProjectGrant) (*model.ProjectGrant, error)
|
|
|
|
ChangeProjectGrant(ctx context.Context, app *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
|
|
|
|
|
|
|
ProjectGrantMemberByID(ctx context.Context, projectID, grantID, userID string) (*model.ProjectGrantMember, error)
|
|
|
|
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
|
|
|
}
|