feat: add step.auth_validate pipeline step#190
Merged
Conversation
…ation Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add JWT/Bearer token validation step
feat: add step.auth_validate pipeline step
Feb 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new step.auth_validate pipeline step to validate HTTP Bearer/JWT-style tokens via an AuthProvider, and wires it into the pipeline-steps plugin so it can be used from YAML-configured pipelines.
Changes:
- Introduces
AuthValidateStep(step.auth_validate) with configurableauth_module,token_source, andsubject_field. - Adds a dedicated unit test suite for the new step (11 tests).
- Registers the new step type/factory in
plugins/pipelinesteps/plugin.goand updates plugin loader expectations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
module/pipeline_step_auth_validate.go |
Implements the new auth validation pipeline step and its 401 response behavior. |
module/pipeline_step_auth_validate_test.go |
Adds unit tests covering success, configuration options, and unauthorized scenarios. |
plugins/pipelinesteps/plugin.go |
Registers step.auth_validate in the plugin manifest and factory map. |
plugins/pipelinesteps/plugin_test.go |
Updates step lists/count assertions to include the new step. |
Contributor
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
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.
Adds
step.auth_validate— a declarative pipeline step that validates ****** against a registeredAuthProvidermodule and outputs the claims returned by the provider into the pipeline context.Changes
module/pipeline_step_auth_validate.go— Step implementation using existingAuthProviderinterface andresolveBodyFromfor dot-path token extraction. Writes 401 JSON to HTTP response writer when available, setsStop: trueon all failure paths. Guards against nil application context.module/pipeline_step_auth_validate_test.go— 13 tests covering success, custom config, missing/malformed/invalid tokens, auth errors, HTTP response writing, nil app, and required field validation.plugins/pipelinesteps/plugin.go— Register factory and manifest entry.plugins/pipelinesteps/plugin_test.go— Update expected step count.Config
auth_moduletoken_sourcesteps.parse-request.headers.Authorization)subject_fieldauth_user_idsubclaimUsage
On success, all claims returned by the AuthProvider are emitted as flat output keys (
sub,scope,iss, etc.) plus the configuredsubject_fieldmapped fromsub. On failure, pipeline stops with a 401 JSON response.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.