MCPcopy Create free account
hub / github.com/github/gh-aw / parseEngineAuthConfig

Function parseEngineAuthConfig

pkg/workflow/engine_config_parser.go:131–167  ·  view source on GitHub ↗

parseEngineAuthConfig converts a raw engine.auth config map into EngineAuthConfig.

(authObj map[string]any)

Source from the content-addressed store, hash-verified

129
130// parseEngineAuthConfig converts a raw engine.auth config map into EngineAuthConfig.
131func parseEngineAuthConfig(authObj map[string]any) *EngineAuthConfig {
132 auth := &EngineAuthConfig{}
133 if s, ok := authObj["type"].(string); ok {
134 auth.Type = s
135 }
136 if s, ok := authObj["audience"].(string); ok {
137 auth.Audience = s
138 }
139 if s, ok := authObj["provider"].(string); ok {
140 auth.Provider = s
141 }
142 if s, ok := authObj["azure-tenant-id"].(string); ok {
143 auth.AzureTenantID = s
144 }
145 if s, ok := authObj["azure-client-id"].(string); ok {
146 auth.AzureClientID = s
147 }
148 if s, ok := authObj["azure-scope"].(string); ok {
149 auth.AzureScope = s
150 }
151 if s, ok := authObj["azure-cloud"].(string); ok {
152 auth.AzureCloud = s
153 }
154 if s, ok := authObj["federation-rule-id"].(string); ok {
155 auth.AnthropicFederationRuleID = s
156 }
157 if s, ok := authObj["organization-id"].(string); ok {
158 auth.AnthropicOrganizationID = s
159 }
160 if s, ok := authObj["service-account-id"].(string); ok {
161 auth.AnthropicServiceAccountID = s
162 }
163 if s, ok := authObj["workspace-id"].(string); ok {
164 auth.AnthropicWorkspaceID = s
165 }
166 return auth
167}
168
169// parseRequestShape converts a raw request config map (from engine.provider.request) into
170// a RequestShape.

Callers 1

ExtractEngineConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected