Skip to content

feat: credential graphs#66

Merged
jakobmoellerdev merged 13 commits into
open-component-model:mainfrom
jakobmoellerdev:credential-graph
Apr 24, 2025
Merged

feat: credential graphs#66
jakobmoellerdev merged 13 commits into
open-component-model:mainfrom
jakobmoellerdev:credential-graph

Conversation

@jakobmoellerdev

@jakobmoellerdev jakobmoellerdev commented Apr 14, 2025

Copy link
Copy Markdown
Member

What this PR does / why we need it

This adds a credential graph that can ingest OCM style credential configurations from sources such as .ocmconfig and recursively resolve them based on plugins resolved dynamically.

direct credentials are resolved statically are at O(1) lookup time for equal identities, and O(N) for dynamically matched credentials due to the dynamic match nature of path attributes. (N = amount of stored credentials in the graph).

The credential graph allows for recursive lookups of dependent credentials.

Additionally, the graph allows for repository plugins to get their own credentials from direct credentials specified in the graph.

Note that it is explicitly forbidden right now to get credentials for one repository from another repository. while technically possible, it would require dynamic stack tracing of the credentials while they are being looked up to avoid a cycle. (this might change later based on requirements)

Which issue(s) this PR fixes

This is a prerequisite to implementing our first CLI plugins based on OCI. We want OCI credentials to be looked up based on ocmconfig, so we need a configuration resolver that is able to look up credentials based on a DAG.

This PR is still heavily wip and depends on #21

eventually resolves open-component-model/ocm-project#459

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/l Large labels Apr 14, 2025
@gitguardian

gitguardian Bot commented Apr 14, 2025

Copy link
Copy Markdown

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@jakobmoellerdev jakobmoellerdev force-pushed the credential-graph branch 5 times, most recently from 4dfe3b3 to cb28253 Compare April 14, 2025 12:37
@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review April 14, 2025 12:40
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner April 14, 2025 12:40
@jakobmoellerdev jakobmoellerdev force-pushed the credential-graph branch 2 times, most recently from cfe992b to 7ab8b08 Compare April 14, 2025 12:45
@jakobmoellerdev

Copy link
Copy Markdown
Member Author

@fabianburth please review

@fabianburth fabianburth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive work!

I'm not done with the review yet, but so far, I have mostly nits.
Still, I have to admit, the complexity is significant. I'm also still thinking whether the graph traversal logic could be separated even further from the business logic here.

Comment thread Taskfile.yml
Comment thread bindings/go/credentials/doc.go
Comment thread bindings/go/credentials/doc.go
Comment thread bindings/go/credentials/doc.go Outdated
Comment thread bindings/go/credentials/doc.go Outdated
Comment thread bindings/go/credentials/ingest.go Outdated
Comment thread bindings/go/credentials/internal/static/static.go Outdated
Comment thread bindings/go/credentials/internal/static/static.go Outdated
Comment thread bindings/go/credentials/synced_dag.go
Comment thread bindings/go/credentials/resolve_direct.go
Comment thread bindings/go/credentials/synced_dag.go
Comment thread bindings/go/credentials/resolve_direct.go Outdated
Comment thread bindings/go/credentials/graph_test.go Outdated
Comment thread Taskfile.yml
Comment thread bindings/go/credentials/doc.go
Comment thread bindings/go/credentials/doc.go
Comment thread bindings/go/credentials/doc.go
Comment thread bindings/go/credentials/doc.go Outdated
Comment thread bindings/go/credentials/doc.go Outdated
Comment thread bindings/go/credentials/doc.go Outdated
Comment thread bindings/go/credentials/graph.go
Comment thread bindings/go/credentials/doc.go
fabianburth
fabianburth previously approved these changes Apr 24, 2025
Comment thread bindings/go/credentials/spec/config/runtime/convert_v1.go Outdated
@jakobmoellerdev jakobmoellerdev merged commit 8bb1250 into open-component-model:main Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bootstrap the OCM Credential System

2 participants