-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add structured schema policy config #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
a976bea
proto updates to match database schema
strantalis e564652
chore(migration): add new schemas (#46)
jrschumacher 5c285bd
chore: Attributes proto definition rework to match new entity relatio…
jakedoublev 7878f9a
chore: update resource-mapping and subject-mapping proto examples (#47)
jrschumacher 20981c9
Fix protos and generate sdk
jrschumacher 3112378
Policy-config-changes-implement-attributes (#50)
jrschumacher 4283795
Refactor attributes (#56)
jrschumacher ac77694
Add attribute value implementation (#61)
jrschumacher 59a073b
feat(subject-mappings): refactor to meet db schema (#59)
jrschumacher cf6b3c6
feat: key access server registry impl (#66)
strantalis 1b3a831
fix: attribute missing rpc method for listing attribute values (#69)
strantalis c144db1
feat(resourcemapping): resource mapping implementation (#83)
strantalis 77438b6
chore: add helper for checking "bad request" invalid query DB errors …
jakedoublev b3f32b1
feat(namespaces CRUD): protos, generated SDK, db interactivity for na…
jakedoublev e1fd203
chore: Refactor: write tests for the subject mapping db interface (#87)
jrschumacher 568df9c
fix(attribute value): fixes attribute value crud (#86)
strantalis 397dd5a
chore(issue #80): attribute namespaces integration test suite (#98)
jakedoublev 7d30b89
chore(issue 75): integration tests for attributes and consumption of …
jakedoublev 19f70b5
chore(issue 77): resource mapping integration tests (#102)
jakedoublev 8dfd8c2
chore(Issue 78): integration tests for key_access_server registry db …
jakedoublev e0f6d07
fix(issue 90): remove duplicate attribute_id from attribute value cre…
jakedoublev 6a7462c
chore(issue 74): attribute values integration test suite (#107)
jakedoublev a48d686
feat: key access server assignments (#111)
strantalis 0395509
Fix integration tests
jrschumacher 3f37864
Update .github/workflows/go-checks.yaml
jrschumacher b1140c3
golangci-lint to ignore existing files
jrschumacher dfe920d
Add config
jrschumacher ed06c80
tweak
jrschumacher fa4e576
fix: fix tests for pivot tables (#122)
jrschumacher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package cmd | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "log/slog" | ||
|
|
||
| "github.com/opentdf/opentdf-v2-poc/internal/config" | ||
| "github.com/opentdf/opentdf-v2-poc/internal/db" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| var ( | ||
| migrateCmd = &cobra.Command{ | ||
| Use: "migrate", | ||
| Short: "Run database migrations", | ||
| } | ||
|
|
||
| migrateDownCmd = &cobra.Command{ | ||
| Use: "down", | ||
| Short: "Run database migrations", | ||
| Run: func(cmd *cobra.Command, args []string) { | ||
| dbClient, err := migrateDbClient() | ||
| if err != nil { | ||
| panic(fmt.Errorf("could not load config: %w", err)) | ||
| } | ||
|
|
||
| res, err := dbClient.MigrationDown() | ||
| if err != nil { | ||
| panic(fmt.Errorf("migration down failed: %w", err)) | ||
| } | ||
| fmt.Print("migration down applied: ", slog.Any("res", res)) | ||
| }, | ||
| } | ||
| ) | ||
|
|
||
| func migrateDbClient() (*db.Client, error) { | ||
| // Load the config | ||
| conf, err := config.LoadConfig() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| slog.Info("creating database client") | ||
| dbClient, err := db.NewClient(conf.DB) | ||
| if err != nil { | ||
| //nolint:wrapcheck // we want to return the error as is. the start command will wrap it | ||
| return nil, err | ||
| } | ||
| return dbClient, nil | ||
|
|
||
| } | ||
|
|
||
| func init() { | ||
| migrateCmd.AddCommand(migrateDownCmd) | ||
| rootCmd.AddCommand(migrateCmd) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.