fix: check membership from projection (#3710)

* fix: check membership from projection

* remove authz setup
This commit is contained in:
Livio Amstutz
2022-05-25 14:07:16 +02:00
committed by GitHub
parent b6deed3e34
commit 79452da7d6
15 changed files with 51 additions and 806 deletions
+1 -3
View File
@@ -11,8 +11,6 @@ var (
createAdminViews string
//go:embed 01_sql/auth.sql
createAuthViews string
//go:embed 01_sql/authz.sql
createAuthzViews string
//go:embed 01_sql/notification.sql
createNotificationViews string
//go:embed 01_sql/projections.sql
@@ -24,7 +22,7 @@ type ProjectionTable struct {
}
func (mig *ProjectionTable) Execute(ctx context.Context) error {
stmt := createAdminViews + createAuthViews + createAuthzViews + createNotificationViews + createProjections
stmt := createAdminViews + createAuthViews + createNotificationViews + createProjections
_, err := mig.dbClient.ExecContext(ctx, stmt)
return err
}
-47
View File
@@ -1,47 +0,0 @@
CREATE SCHEMA authz;
CREATE TABLE authz.locks (
locker_id TEXT,
locked_until TIMESTAMPTZ(3),
view_name TEXT,
instance_id TEXT NOT NULL,
PRIMARY KEY (view_name, instance_id)
);
CREATE TABLE authz.current_sequences (
view_name TEXT,
current_sequence BIGINT,
event_timestamp TIMESTAMPTZ,
last_successful_spooler_run TIMESTAMPTZ,
instance_id TEXT NOT NULL,
PRIMARY KEY (view_name, instance_id)
);
CREATE TABLE authz.failed_events (
view_name TEXT,
failed_sequence BIGINT,
failure_count SMALLINT,
err_msg TEXT,
instance_id TEXT NOT NULL,
PRIMARY KEY (view_name, failed_sequence, instance_id)
);
CREATE TABLE authz.user_memberships (
user_id STRING NOT NULL,
member_type INT2 NOT NULL,
aggregate_id STRING NOT NULL,
object_id STRING NOT NULL,
roles STRING[] NULL,
display_name STRING NULL,
resource_owner STRING NULL,
resource_owner_name STRING NULL,
creation_date TIMESTAMPTZ NULL,
change_date TIMESTAMPTZ NULL,
sequence INT8 NULL,
instance_id STRING NULL,
PRIMARY KEY (user_id, member_type, aggregate_id, object_id)
);