Support engine.auth for Azure OpenAI GitHub OIDC workflows#31112
Merged
Support engine.auth for Azure OpenAI GitHub OIDC workflows#31112
engine.auth for Azure OpenAI GitHub OIDC workflows#31112Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for engine.auth in Azure OpenAI OIDC authentication
Support May 9, 2026
engine.auth for Azure OpenAI GitHub OIDC workflows
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class support for engine.auth in workflows to enable Azure OpenAI GitHub OIDC setups without manual AWF_AUTH_* wiring, including schema updates, engine config parsing/env mapping, and a compiler permission guard requiring permissions.id-token: write when engine.auth.type: github-oidc is used.
Changes:
- Extended the workflow JSON schema to allow
engine.authon theengine: { id: ... }variant. - Added engine parsing for
engine.authand mapped fields toAWF_AUTH_*env vars. - Added compiler validation enforcing
permissions.id-token: writewhenengine.auth.typeisgithub-oidc, with accompanying tests.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/permissions_compiler_validator.go | Adds validation to require permissions.id-token: write when engine auth uses GitHub OIDC. |
| pkg/workflow/engine.go | Introduces EngineAuthConfig, parses engine.auth, and maps it into AWF_AUTH_* env vars. |
| pkg/workflow/engine_config_test.go | Adds test coverage for engine.auth parsing and env var mapping. |
| pkg/workflow/engine_catalog_test.go | Updates schema/catalog expectation tests to ensure engine.auth is present. |
| pkg/workflow/compiler_validators_test.go | Adds tests for the new permission requirement behavior. |
| pkg/parser/schemas/main_workflow_schema.json | Adds engine.auth object schema (type/audience/Azure fields) to the engine object-with-id variant. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 2
Comment on lines
137
to
142
| // Emit warning if id-token: write permission is detected | ||
| if err := validateEngineAuthPermissions(workflowData, workflowPermissions); err != nil { | ||
| return nil, formatCompilerError(markdownPath, "error", err.Error(), err) | ||
| } | ||
|
|
||
| // Emit warning if id-token: write permission is detected |
Comment on lines
+556
to
+561
| if config.Auth.Type != "" { | ||
| config.Env["AWF_AUTH_TYPE"] = config.Auth.Type | ||
| } | ||
| if config.Auth.Audience != "" { | ||
| config.Env["AWF_AUTH_OIDC_AUDIENCE"] = config.Auth.Audience | ||
| } |
Collaborator
|
@copilot merge main, review all comments recompile |
…e-auth-azure-openai Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done. Merged |
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.
Bug Fix
What was the bug?
Workflows using Azure OpenAI OIDC under
engine.authfailed schema validation becauseengine.authwas not recognized.As a result, users had to manually inject
AWF_AUTH_*vars viaengine.envinstead of using structured auth config.How did you fix it?
Schema support (
engine.auth)engine.authto the object-with-idengine schema inmain_workflow_schema.json.type(github-oidc)audienceazure-tenant-idazure-client-idazure-scopeazure-cloudEngine auth parsing + env mapping
engine.auth.AWF_AUTH_TYPEAWF_AUTH_OIDC_AUDIENCEAWF_AUTH_AZURE_TENANT_IDAWF_AUTH_AZURE_CLIENT_IDAWF_AUTH_AZURE_SCOPEAWF_AUTH_AZURE_CLOUDengine.envvalues win when the sameAWF_AUTH_*keys are set explicitly.Permission guard for OIDC
engine.auth.type: github-oidcis set,permissions.id-token: writeis required.Targeted coverage updates
engine.authpresent on engine object variant),AWF_AUTH_*mapping,engine.envoverridesengine.auth-derivedAWF_AUTH_*values),github-oidcrequiringid-token: write.Testing
Behavior now supports the intended frontmatter directly (without manual
AWF_AUTH_*wiring inengine.env):