소스 검색

Merge pull request #6046 from mgugino-upstream-stage/fix-github-challenge-auth

Re-add challenge auth verification to github and google
Scott Dodson 7 년 전
부모
커밋
5339ec5a4a
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      roles/openshift_master_facts/filter_plugins/openshift_master.py

+ 12 - 0
roles/openshift_master_facts/filter_plugins/openshift_master.py

@@ -426,6 +426,12 @@ class GoogleIdentityProvider(IdentityProviderOauthBase):
         IdentityProviderOauthBase.__init__(self, api_version, idp)
         self._optional += [['hostedDomain', 'hosted_domain']]
 
+    def validate(self):
+        ''' validate this idp instance '''
+        if self.challenge:
+            raise errors.AnsibleFilterError("|failed provider {0} does not "
+                                            "allow challenge authentication".format(self.__class__.__name__))
+
 
 class GitHubIdentityProvider(IdentityProviderOauthBase):
     """ GitHubIdentityProvider
@@ -444,6 +450,12 @@ class GitHubIdentityProvider(IdentityProviderOauthBase):
         self._optional += [['organizations'],
                            ['teams']]
 
+    def validate(self):
+        ''' validate this idp instance '''
+        if self.challenge:
+            raise errors.AnsibleFilterError("|failed provider {0} does not "
+                                            "allow challenge authentication".format(self.__class__.__name__))
+
 
 class FilterModule(object):
     ''' Custom ansible filters for use by the openshift_master role'''