Commits

Osiloke Emoekpere committed 49f1ff0

Added more secure streaming files

  • Participants
  • Parent commits af50062

Comments (0)

Files changed (11)

flumotion/__init__.pyc

Binary file added.

flumotion/component/__init__.pyc

Binary file added.

flumotion/component/bouncers/__init__.py

Empty file added.

flumotion/component/bouncers/algorithms/__init__.py

Empty file added.

flumotion/component/bouncers/securestreambouncer.xml

+<registry>
+  <components>
+    <component type="secure-stream-bouncer"
+               base="flumotion/component/bouncers"
+               _description="A bouncer that allows access to a stream when the stream is secure.">
+
+      <source location="flumotion.component.bouncers.icalbouncer" />
+
+      <entries>
+        <entry type="component" location="icalbouncer.py"
+               function="IcalBouncer" />
+      </entries>
+
+      <properties>
+        <property name="file" type="string" required="yes"
+                  _description="The path to an iCalendar file to use." />
+      </properties>
+    </component>
+  </components>
+  <bundles>
+    <bundle name="icalbouncer-component">
+      <dependencies>
+        <dependency name="multi-bouncer" />
+	<dependency name="icalbouncer-algorithm" />
+      </dependencies>
+      <directories>
+        <directory name="flumotion/component/bouncers">
+          <filename location="icalbouncer.py" />
+        </directory>
+      </directories>
+    </bundle>
+  </bundles>
+</registry>
+
+

flumotion/component/consumers/__init__.py

Empty file added.

flumotion/component/consumers/httpsstreamer/httpsstreamer.py

+from flumotion.component.common.streamer.multifdsinkstreamer import \
+        MultifdSinkStreamer
+
+__all__ = ['HTTPSStreamer']
+__version__ = "$Rev$"
+
+
+class HTTPSStreamer(MultifdSinkStreamer):
+    "A streamer which utilizes some secure principles"
+	pass

flumotion/component/plugs/__init__.py

Empty file added.

flumotion/component/plugs/secureurl/__init__.py

Empty file added.

flumotion/component/plugs/secureurl/secureurl.py

+from flumotion.component.plugs.requestmodifier import RequestModifierPlug
+
+class RequestModifierSecureUrlPlug(RequestModifierPlug):
+
+    logCategory = 'SecureUrl'
+
+    def start(self, component):
+        properties = self.args['properties']
+        self._secret_key = properties['SECRET-KEY']
+        self.log("Secret Key: %s", self._secret_key)
+
+    def modify(self, request):
+		"Decrypt the request url using the secret key"
+		from pprint import pprint
+		self.log("Encrypted Request Uri: %s" % request.uri)
+#        if self._argument in request.args:
+#            if self._triggers & python.set(request.args[self._argument]):
+#                filename = os.path.basename(urllib.unquote_plus(request.path))
+#                filename = filename.encode('UTF-8')
+#                filename = urllib.quote(filename)
+#                header = "attachment; filename*=utf-8''%s" % filename
+#                request.setHeader('Content-Disposition', header)
+

flumotion/component/plugs/secureurl/secureurl.xml

+<registry>
+<plugs>
+<plug socket="flumotion.component.plugs.requestmodifier.RequestModifierPlug"
+          type="requestmodifier-secureurl"
+          _description="Decrypts an encrypted url to get the real url path and client auth data">
+      <entries>
+        <entry type="default"
+               location="flumotion/component/plugs/secureurl/secureurl.py"
+               function="RequestModifierSecureUrlPlug" />
+        <entry type="wizard"
+               location="flumotion/component/plugs/secureurl/wizard_gtk.py"
+               function="RequestModifierSecureUrlPlugWizardPlugin" />
+      </entries>
+
+      <wizard _description="Decrypt an encrypted url to get the real file path." type="httpserver-plug"/>
+
+      <properties>
+        <property name="SECRET-KEY" type="string" required="true"
+                  _description="Secret key used to decrypt the encrypted url" />
+      </properties>
+</plug>
+</plugs>
+</registry>