feat: session-wide GitHub Personal Access Token#7
Closed
matejvasek wants to merge 18 commits into
Closed
Conversation
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
When generating GH WF and we using internal OCP registry we do not employ the docker login step since the func CLI gets the credentials from kubeconfig. The password/token for the internal registry is the same as for the OCP cluster. Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This is for local debuggins since the /functions URI is already taken by another plugin on my cluster. This should be latter reverten when creating final PR. Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers replacing build-time webpack DefinePlugin PAT injection with runtime sessionStorage-backed PAT entry via modal dialog. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Matej Vašek <matejvasek@gmail.com>
Provides pat/setPat/clearPat backed by sessionStorage under the key 'func-console-gh-pat'. This is the foundational storage layer for the session-wide GitHub PAT feature — all other tasks in the plan depend on it. Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Modal prompts for a GitHub Personal Access Token and validates it via Octokit before calling onSave. Uses PatternFly 6 composable Modal with ModalHeader, ModalBody, and ModalFooter sub-components. Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
…e global Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…parameter - Temporarily pass empty string as PAT (placeholder for Task 4 integration) - Update test mock to match new useSourceControl signature with pat parameter - All tests pass Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Matej Vašek <matejvasek@gmail.com>
Wire up usePat hook and PatModal gate in FunctionsListPage. When no PAT is stored in session storage, PatModal opens to prompt the user. The PAT is passed through to useSourceControl so GitHub API calls are authenticated. When PAT is empty, the effect skips loading repos and marks loaded immediately. Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
The PAT is now managed via the session-wide usePat() hook. The form no longer needs its own PAT input field. The component now collects only the core function creation parameters, while PAT will be injected at the page level via usePat(). - Remove pat field from CreateFunctionFormData interface - Remove pat state variable from component - Remove pat from validation logic - Remove pat from handleSubmit data object - Remove PAT FormGroup JSX from the form - Update tests to reflect new form structure Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… globals Remove the DefinePlugin entry that was injecting __GITHUB_PAT__ at build time and delete the globals.d.ts declaration file. Runtime PAT is now obtained via usePat() hook throughout the application. Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mark feature as passing in features.json, move plan to completed. Move plan form active to completed. Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Matej Vašek <matejvasek@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move back for debugging/development configuration. Signed-off-by: Matej Vašek <matejvasek@gmail.com>
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
Collaborator
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
DefinePlugin) with a runtime session-wide PAT prompted via modal dialogsessionStorage(survives refresh, cleared on tab close) and validated against the GitHub API (GET /user) before being acceptedPatModalgates both the Functions List and Function Create pages — users cannot proceed without a valid PAT__GITHUB_PAT__from webpack config and deletesrc/globals.d.tsChanges
src/hooks/usePat.tssessionStorage(func-console-gh-patkey)src/components/PatModal.tsxsrc/services/source-control/useSourceControl.tspatparameter instead of reading build-time globalsrc/views/FunctionsListPage.tsxusePat()+PatModalgatesrc/views/FunctionCreatePage.tsxusePat()+PatModalgatesrc/components/CreateFunctionForm.tsxwebpack.config.tsDefinePlugin/__GITHUB_PAT__removedbackend/main.goTest plan
yarn test— 46 tests across 11 suites, all passing/functionswithout a PAT in sessionStorage → modal appears, no close button/functions/create→ no PAT prompt (already set)🤖 Generated with Claude Code