Skip to content
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

better represent structure in mermaid graph #263

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

mikemrm
Copy link
Contributor

@mikemrm mikemrm commented Aug 7, 2024

This better represents the action and action relationship lookups in mermaid graphs.

Before:

erDiagram
	rolebinding }o--o{ rolev2 : role
	rolebinding }o--o{ user : subject
	rolebinding }o--o{ client : subject
	rolebinding }o--o{ group : subject
	user {
		id_prefix idntusr
	}
	client {
		id_prefix idntclt
	}
	role {
		id_prefix permrol
	}
	role }o--o{ subject: subject
	tenant {
		id_prefix tnntten
	}
	tenant }o--o{ tenant: parent
	tenant }o--o{ rolebinding: grant
	group {
		id_prefix idntgrp
		subgroup_action member
	}
	group }o--o{ rolebinding: grant
	group }o--o{ group: parent
	group }o--o{ tenant: parent
	group }o--o{ user: direct_member
	group }o--o{ client: direct_member
	group }o--o{ group: subgroup
	loadbalancer {
		id_prefix loadbal
		action loadbalancer_get
		action loadbalancer_update
		action loadbalancer_delete
	}
	loadbalancer }o--o{ resourceowner: owner
	loadbalancer }o--o{ rolebinding: grant
	resourceowner {
	}
	resourceowner ||--|| tenant: alias
	resourcemanager {
		action role_create
		action role_get
		action role_list
		action role_update
		action role_delete
		action loadbalancer_create
		action loadbalancer_get
		action loadbalancer_list
		action loadbalancer_update
		action loadbalancer_delete
	}
	resourcemanager ||--|| tenant: alias
	resourcemanager ||--|| group: alias
	subject {
	}
	subject ||--|| user: alias
	subject ||--|| client: alias

Loading

After:

erDiagram
	rolebinding }o--o{ rolev2 : role
	rolebinding }o--o{ user : subject
	rolebinding }o--o{ client : subject
	rolebinding }o--o{ group : subject
	user {
		id_prefix idntusr
	}
	client {
		id_prefix idntclt
	}
	role {
		id_prefix permrol
	}
	role }o--o{ subject: subject
	tenant {
		id_prefix tnntten
	}
	tenant }o--o{ tenant: parent
	tenant }o--o{ rolebinding: grant
	group {
		id_prefix idntgrp
		action member "direct_member> | subgroup>member"
	}
	group }o--o{ rolebinding: grant
	group }o--o{ group: parent
	group }o--o{ tenant: parent
	group }o--o{ user: direct_member
	group }o--o{ client: direct_member
	group }o--o{ group: subgroup
	loadbalancer {
		id_prefix loadbal
		action loadbalancer_delete "self"
		action loadbalancer_get "self"
		action loadbalancer_update "self"
	}
	loadbalancer }o--o{ resourceowner: owner
	loadbalancer }o--o{ rolebinding: grant
	resourceowner {
	}
	resourceowner ||--|| tenant: alias
	resourcemanager {
		action loadbalancer_create "self"
		action loadbalancer_delete "self"
		action loadbalancer_get "self"
		action loadbalancer_list "self"
		action loadbalancer_update "self"
		action role_create "self"
		action role_delete "self"
		action role_get "self"
		action role_list "self"
		action role_update "self"
	}
	resourcemanager ||--|| tenant: alias
	resourcemanager ||--|| group: alias
	subject {
	}
	subject ||--|| user: alias
	subject ||--|| client: alias

Loading

This better represents the action and action relationship lookups in mermaid graphs.

Before:

```mermaid
erDiagram
	rolebinding }o--o{ rolev2 : role
	rolebinding }o--o{ user : subject
	rolebinding }o--o{ client : subject
	rolebinding }o--o{ group : subject
	user {
		id_prefix idntusr
	}
	client {
		id_prefix idntclt
	}
	role {
		id_prefix permrol
	}
	role }o--o{ subject: subject
	tenant {
		id_prefix tnntten
	}
	tenant }o--o{ tenant: parent
	tenant }o--o{ rolebinding: grant
	group {
		id_prefix idntgrp
		subgroup_action member
	}
	group }o--o{ rolebinding: grant
	group }o--o{ group: parent
	group }o--o{ tenant: parent
	group }o--o{ user: direct_member
	group }o--o{ client: direct_member
	group }o--o{ group: subgroup
	loadbalancer {
		id_prefix loadbal
		action loadbalancer_get
		action loadbalancer_update
		action loadbalancer_delete
	}
	loadbalancer }o--o{ resourceowner: owner
	loadbalancer }o--o{ rolebinding: grant
	resourceowner {
	}
	resourceowner ||--|| tenant: alias
	resourcemanager {
		action role_create
		action role_get
		action role_list
		action role_update
		action role_delete
		action loadbalancer_create
		action loadbalancer_get
		action loadbalancer_list
		action loadbalancer_update
		action loadbalancer_delete
	}
	resourcemanager ||--|| tenant: alias
	resourcemanager ||--|| group: alias
	subject {
	}
	subject ||--|| user: alias
	subject ||--|| client: alias

```

After:

```mermaid
erDiagram
	rolebinding }o--o{ rolev2 : role
	rolebinding }o--o{ user : subject
	rolebinding }o--o{ client : subject
	rolebinding }o--o{ group : subject
	user {
		id_prefix idntusr
	}
	client {
		id_prefix idntclt
	}
	role {
		id_prefix permrol
	}
	role }o--o{ subject: subject
	tenant {
		id_prefix tnntten
	}
	tenant }o--o{ tenant: parent
	tenant }o--o{ rolebinding: grant
	group {
		id_prefix idntgrp
		action member "direct_member> | subgroup>member"
	}
	group }o--o{ rolebinding: grant
	group }o--o{ group: parent
	group }o--o{ tenant: parent
	group }o--o{ user: direct_member
	group }o--o{ client: direct_member
	group }o--o{ group: subgroup
	loadbalancer {
		id_prefix loadbal
		action loadbalancer_delete "self"
		action loadbalancer_get "self"
		action loadbalancer_update "self"
	}
	loadbalancer }o--o{ resourceowner: owner
	loadbalancer }o--o{ rolebinding: grant
	resourceowner {
	}
	resourceowner ||--|| tenant: alias
	resourcemanager {
		action loadbalancer_create "self"
		action loadbalancer_delete "self"
		action loadbalancer_get "self"
		action loadbalancer_list "self"
		action loadbalancer_update "self"
		action role_create "self"
		action role_delete "self"
		action role_get "self"
		action role_list "self"
		action role_update "self"
	}
	resourcemanager ||--|| tenant: alias
	resourcemanager ||--|| group: alias
	subject {
	}
	subject ||--|| user: alias
	subject ||--|| client: alias

```

Signed-off-by: Mike Mason <[email protected]>
@mikemrm mikemrm requested review from a team as code owners August 7, 2024 16:48
@mikemrm mikemrm merged commit 72685ad into infratographer:main Aug 7, 2024
4 checks passed
@mikemrm mikemrm deleted the update-mermaid branch August 7, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants