-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(ironhub): install tools and skills from IronHub (CLI, agent tools, gateway, live catalog) #3737
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
Closed
Closed
feat(ironhub): install tools and skills from IronHub (CLI, agent tools, gateway, live catalog) #3737
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
463c73e
feat(ironhub): install pipeline, deep-link signing keys, gateway routes
neo-sky 8767e81
fix(ironhub): verify skill installs, harden checksum and tag checks
neo-sky 9bc1a75
fix(ironhub): harden install auth, key handling, and concurrency
neo-sky 74293e2
fix(ironhub): bind signed install to version; add trust_label to info
neo-sky 2581d6c
fix(ironhub): bind signed install to artifact digest
neo-sky c936cf3
fix(ironhub): make /register HMAC-authed, not session-gated
neo-sky 98394ed
fix(ironhub): make the signing-key setting match the other rows
neo-sky 3b1bcd1
fix(ironhub): unblock install/settings UI handlers under CSP
neo-sky 0e0c20b
fix(ironhub): make manifest URL and artifact hosts env-configurable
neo-sky 544a6ca
fix(ironhub): fail-closed provenance + harden artifact-host SSRF guard
neo-sky c7574cb
feat(ironhub): verify the catalog manifest signature
neo-sky 1868325
docs(ironhub): document manifest key rotation + skill-registry lock r…
neo-sky b3ed509
fix(ironhub): channel-boundary error leak + payload delimiter check
neo-sky 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
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,203 @@ | ||
| function ironhubInstallPanel() { | ||
| return document.getElementById('tab-install'); | ||
| } | ||
|
|
||
| function renderIronhubInstallState(html) { | ||
| var panel = ironhubInstallPanel(); | ||
| if (!panel) return; | ||
| panel.innerHTML = '<div class="ext-card ironhub-install-card">' + html + '</div>'; | ||
| wireInstallActions(); | ||
| } | ||
|
|
||
| function wireInstallActions() { | ||
| document.querySelectorAll('.ironhub-install-cancel').forEach(function(btn) { | ||
| btn.addEventListener('click', ironhubInstallCancel); | ||
| }); | ||
| var ackCb = document.getElementById('ironhub-install-ack-cb'); | ||
| if (ackCb) ackCb.addEventListener('change', ironhubAckChanged); | ||
| } | ||
|
|
||
| function ironhubInstallCancel() { | ||
| switchTab('chat'); | ||
| } | ||
|
|
||
| function renderIronhubInstallError(message) { | ||
| renderIronhubInstallState( | ||
| '<h2>' + escapeHtml(I18n.t('ironhub.install.unverifiedTitle')) + '</h2>' + | ||
| '<p class="ironhub-install-error">' + escapeHtml(message) + '</p>' + | ||
| '<button class="btn-ext ironhub-install-cancel">' + | ||
| escapeHtml(I18n.t('ironhub.install.close')) + '</button>' | ||
| ); | ||
| } | ||
|
|
||
| function renderIronhubConfirm(signed, info) { | ||
| var tool = signed && signed.slug ? signed.slug : ''; | ||
| var kind = info && info.kind ? info.kind : 'tool'; | ||
| var version = info && info.version ? info.version : ''; | ||
| var description = info && info.description ? info.description : ''; | ||
| var release = info && info.release_tag ? info.release_tag : ''; | ||
| var provenance = info && info.provenance ? info.provenance : ''; | ||
| var trustLabel = info && info.trust_label ? info.trust_label : ''; | ||
| var isCommunityUnverified = provenance === 'new'; | ||
| var rows = ''; | ||
| rows += '<div class="ironhub-install-row"><span>' + | ||
| escapeHtml(I18n.t('ironhub.install.name')) + '</span><strong>' + | ||
| escapeHtml(tool) + '</strong></div>'; | ||
| rows += '<div class="ironhub-install-row"><span>' + | ||
| escapeHtml(I18n.t('ironhub.install.kind')) + '</span><span>' + | ||
| escapeHtml(kind) + '</span></div>'; | ||
| if (version) { | ||
| rows += '<div class="ironhub-install-row"><span>' + | ||
| escapeHtml(I18n.t('ironhub.install.version')) + '</span><span>' + | ||
| escapeHtml(version) + '</span></div>'; | ||
| } | ||
| if (release) { | ||
| rows += '<div class="ironhub-install-row"><span>' + | ||
| escapeHtml(I18n.t('ironhub.install.release')) + '</span><span>' + | ||
| escapeHtml(release) + '</span></div>'; | ||
| } | ||
| if (trustLabel) { | ||
| rows += '<div class="ironhub-install-row"><span>' + | ||
| escapeHtml(I18n.t('ironhub.install.trustLabel')) + '</span><span>' + | ||
| escapeHtml(trustLabel) + '</span></div>'; | ||
| } | ||
| if (description) { | ||
| rows += '<p class="ironhub-install-desc">' + escapeHtml(description) + '</p>'; | ||
| } | ||
|
|
||
| var warning = ''; | ||
| var ackCheckbox = ''; | ||
| var confirmDisabled = ''; | ||
| if (isCommunityUnverified) { | ||
| warning = '<p class="ironhub-install-error">' + | ||
| escapeHtml(I18n.t('ironhub.install.communityWarning')) + '</p>'; | ||
| ackCheckbox = | ||
| '<label class="ironhub-install-row"><input type="checkbox" ' + | ||
| 'id="ironhub-install-ack-cb" /> ' + | ||
| escapeHtml(I18n.t('ironhub.install.ackUnverified')) + '</label>'; | ||
| confirmDisabled = ' disabled'; | ||
| } | ||
|
|
||
| renderIronhubInstallState( | ||
| '<h2>' + escapeHtml(I18n.t('ironhub.install.confirmTitle')) + '</h2>' + | ||
| '<p class="ironhub-install-source">' + | ||
| escapeHtml(I18n.t('ironhub.install.fromHub')) + '</p>' + | ||
| rows + | ||
| warning + | ||
| ackCheckbox + | ||
| '<div class="ironhub-install-actions">' + | ||
| '<button class="btn-ext install" id="ironhub-install-confirm-btn"' + confirmDisabled + '>' + | ||
| escapeHtml(I18n.t('ironhub.install.confirm')) + '</button>' + | ||
| '<button class="btn-ext ironhub-install-cancel">' + | ||
| escapeHtml(I18n.t('ironhub.install.cancel')) + '</button>' + | ||
| '</div>' | ||
| ); | ||
| var btn = document.getElementById('ironhub-install-confirm-btn'); | ||
| if (btn) { | ||
| btn.addEventListener('click', function() { | ||
| ironhubInstallConfirm(signed, isCommunityUnverified); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| function ironhubAckChanged() { | ||
| var cb = document.getElementById('ironhub-install-ack-cb'); | ||
| var btn = document.getElementById('ironhub-install-confirm-btn'); | ||
| if (cb && btn) { | ||
| btn.disabled = !cb.checked; | ||
| } | ||
| } | ||
|
|
||
| function ironhubInstallConfirm(signed, requireAck) { | ||
| var btn = document.getElementById('ironhub-install-confirm-btn'); | ||
| if (btn) { | ||
| btn.disabled = true; | ||
| btn.textContent = I18n.t('ironhub.install.installing'); | ||
| } | ||
| var body = { | ||
| slug: signed.slug, | ||
| version: signed.version, | ||
| uid: signed.uid, | ||
| aid: signed.aid, | ||
| ts: parseInt(signed.ts, 10), | ||
| nonce: signed.nonce, | ||
| sig: signed.sig, | ||
| artifact_digest: signed.artifact_digest, | ||
| }; | ||
| if (requireAck) { | ||
| body.acknowledge_unverified = true; | ||
| } | ||
| apiFetch('/api/ironhub/install', { | ||
| method: 'POST', | ||
| body: body, | ||
| }).then(function(res) { | ||
| var name = res && res.name ? res.name : signed.slug; | ||
| showToast(I18n.t('ironhub.install.success', { name: name }), 'success'); | ||
| renderIronhubInstallState( | ||
| '<h2>' + escapeHtml(I18n.t('ironhub.install.doneTitle')) + '</h2>' + | ||
| '<p>' + escapeHtml(I18n.t('ironhub.install.success', { name: name })) + '</p>' + | ||
| '<button class="btn-ext ironhub-install-cancel">' + | ||
| escapeHtml(I18n.t('ironhub.install.close')) + '</button>' | ||
| ); | ||
| }).catch(function(err) { | ||
| var msg = err && err.message ? err.message : 'unknown error'; | ||
| showToast(I18n.t('ironhub.install.failed', { message: msg }), 'error'); | ||
| if (btn) { | ||
| btn.disabled = false; | ||
| btn.textContent = I18n.t('ironhub.install.confirm'); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| function startIronhubInstall(params) { | ||
| renderIronhubInstallState( | ||
| '<h2>' + escapeHtml(I18n.t('ironhub.install.verifyingTitle')) + '</h2>' + | ||
| '<p>' + escapeHtml(I18n.t('ironhub.install.verifying')) + '</p>' | ||
| ); | ||
|
|
||
| var slug = params && params.slug; | ||
| var version = params && params.version; | ||
| var uid = params && params.uid; | ||
| var aid = params && params.aid; | ||
| var ts = params && params.ts; | ||
| var nonce = params && params.nonce; | ||
| var sig = params && params.sig; | ||
| var artifactDigest = params && params.artifact_digest; | ||
|
|
||
| if (!slug || !version || !uid || !aid || !ts || !nonce || !sig || !artifactDigest) { | ||
| renderIronhubInstallError(I18n.t('ironhub.install.missingParams')); | ||
| return; | ||
| } | ||
|
|
||
| var signed = { | ||
| slug: slug, | ||
| version: version, | ||
| uid: uid, | ||
| aid: aid, | ||
| ts: parseInt(ts, 10), | ||
| nonce: nonce, | ||
| sig: sig, | ||
| artifact_digest: artifactDigest, | ||
| }; | ||
|
|
||
| apiFetch('/api/ironhub/verify-intent', { | ||
| method: 'POST', | ||
| body: signed, | ||
| }).then(function(res) { | ||
| if (!res || !res.valid) { | ||
| var reason = res && res.reason ? res.reason : I18n.t('ironhub.install.unverified'); | ||
| renderIronhubInstallError(reason); | ||
| return; | ||
| } | ||
| return apiFetch('/api/ironhub/info?name=' + encodeURIComponent(slug)) | ||
| .then(function(info) { | ||
| renderIronhubConfirm(signed, info); | ||
| }) | ||
| .catch(function() { | ||
| renderIronhubConfirm(signed, null); | ||
| }); | ||
| }).catch(function(err) { | ||
| var msg = err && err.message ? err.message : I18n.t('ironhub.install.unverified'); | ||
| renderIronhubInstallError(msg); | ||
| }); | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new deep-link install route has no browser/e2e coverage for hash parsing, verify-intent, info fetch, and confirm POST behavior. Handler tests will not catch regressions in this user-visible flow. Add an e2e/browser test that drives
#/install/<name>?ts=<ts>&sig=<sig>, including invalid links and successful confirm.