浏览代码

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'''