setup

package
v0.7.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Setup bool `json:"setup"`
}

func IsEvent

func IsEvent(rawEvent json.RawMessage) (bool, Event)

type EventResult

type EventResult struct {
	AdminRoleName   string `json:"adminRoleName"`
	SecretVersionId string `json:"secretVersionId"`
}

func Handle

func Handle(ctx context.Context, event Event, store *postgresql.Store, adminConnUrlSecretId string) (*EventResult, error)

Handle performs initial setup for a database We configure an admin role with a sufficiently unique name and add them to rds_superuser This is done to avoid a scenario where db_admin will not function properly This happens when the db_admin user has the same name as the database that a user wants to gain access In short, db_admin attempts the following membership chain (creating a cycle) <admin-role> -> <app-role> -> <admin-role> This admin user alters the membership chain to be <admin-role> -> <app-role> -> <database-owner>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL