Re: [privacyidea/privacyidea] 1963/headers smsgateway new column (#2240)

From: notifications@github.com
Domain: IP info github.com
MX-server: IP info out-23.smtp.github.com
Size: 3964 Bytes
Create: 2020-06-10
Update: 2020-06-10
Score: 0
Safe: Yes

Outbound domains: github.com |

@laclaro commented on this pull request.


In privacyidea/api/smsgateway.py:

>  @log_with(log)
 @prepolicy(check_base_action, request, ACTION.SMSGATEWAYWRITE)
-def delete_gateway_option(gwid=None, option=None):
+def delete_gateway_option(gwid=None, key=None, type=None):
     """
     this function deletes an option of a gateway definition
 
     :param gwid: The id of the sms gateway definition
     :return: json with success or fail

done


In privacyidea/lib/smsprovider/HttpSMSProvider.py:

> @@ -145,10 +147,11 @@ def submit_message(self, phone, message):
             params = {}
             data = parameter
 
-        log.debug("issuing request with parameters %s and method %s and "
-                  "authentication %s to url %s." % (parameter, method,
+        log.debug("issuing request with parameters %s, headers %s and method %s and "
+                  "authentication %s to url %s." % (params, headers, method,

done


In privacyidea/models.py:

> @@ -2064,11 +2064,15 @@ class SMSGateway(MethodsMixin, db.Model):
     options = db.relationship('SMSGatewayOption',
                               lazy='dynamic',
                               backref='smsgw')
+    headers = db.relationship('SMSGatewayOption',

indeed removed


In privacyidea/models.py:

> @@ -2127,7 +2135,21 @@ def option_dict(self):
         """
         res = {}
         for option in self.options:
-            res[option.Key] = option.Value
+            if option.Type == "option" or option.Type is None:
+                res[option.Key] = option.Value
+        return res
+
+    @property
+    def header_dict(self):
+        """
+        Return all connected options as a dictionary
+
+        :return: dict
+        """
+        res = {}
+        for header in self.headers:

yes


In privacyidea/static/components/config/controllers/smsgatewayController.js:

>      // listen to the reload broadcast
     $scope.$on("piReload", $scope.getSMSGateways);
-});
+});

:)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.