[CORL-750] SSO Migration Script Bug (#2715)

* fix: fixed bug with sso migration script

* feat: refactored sso schema

* fix: resolved issue with data race and migration/install ordering
This commit is contained in:
Wyatt Johnson
2019-11-18 23:11:20 +00:00
committed by GitHub
parent 9e9c016f4b
commit aa9dcb4e04
13 changed files with 331 additions and 122 deletions
@@ -3,9 +3,8 @@ import * as settings from "coral-server/models/settings";
import { GQLSSOAuthIntegrationTypeResolver } from "coral-server/graph/tenant/schema/__generated__/types";
function getActiveSSOKey(keys: settings.SSOKey[]) {
return keys.find(
key => Boolean(key.secret) && !key.deletedAt && !key.deprecateAt
);
// Any key that has been rotated cannot be the active key.
return keys.find(key => !key.rotatedAt);
}
export const SSOAuthIntegration: GQLSSOAuthIntegrationTypeResolver<