(auth *Auth, routeModel, upstreamModel string, pooled bool)
| 1151 | } |
| 1152 | |
| 1153 | func (m *Manager) stateModelForExecution(auth *Auth, routeModel, upstreamModel string, pooled bool) string { |
| 1154 | if auth != nil && auth.Attributes != nil { |
| 1155 | if homeModel := strings.TrimSpace(auth.Attributes[homeUpstreamModelAttributeKey]); homeModel != "" { |
| 1156 | if resolved := strings.TrimSpace(upstreamModel); resolved != "" { |
| 1157 | return resolved |
| 1158 | } |
| 1159 | return homeModel |
| 1160 | } |
| 1161 | } |
| 1162 | stateModel := executionResultModel(routeModel, upstreamModel, pooled) |
| 1163 | selectionModel := m.selectionModelForAuth(auth, routeModel) |
| 1164 | if canonicalModelKey(selectionModel) == canonicalModelKey(upstreamModel) && strings.TrimSpace(selectionModel) != "" { |
| 1165 | return strings.TrimSpace(upstreamModel) |
| 1166 | } |
| 1167 | return stateModel |
| 1168 | } |
| 1169 | |
| 1170 | func executionResultModel(routeModel, upstreamModel string, pooled bool) string { |
| 1171 | if pooled { |
no test coverage detected