parseEngineAuthConfig converts a raw engine.auth config map into EngineAuthConfig.
(authObj map[string]any)
| 129 | |
| 130 | // parseEngineAuthConfig converts a raw engine.auth config map into EngineAuthConfig. |
| 131 | func 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. |