Giter VIP home page Giter VIP logo

pybrowserid's People

Contributors

almet avatar graylinkim avatar jessaustin avatar kylef avatar mozilla-github-standards avatar rfk avatar tarekziade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pybrowserid's Issues

Intermittent exception from encode_bytes()

Traceback (most recent call last):
  File "makecert.py", line 36, in <module>
    issuer_keypair=(None, MOCKMYID_PRIVATE_KEY),
  File "/home/djc/src/PyBrowserID/browserid/tests/support.py", line 144, in make_assertion
    certificate = jwt.generate(certificate, iss_priv)
  File "/home/djc/src/PyBrowserID/browserid/jwt.py", line 37, in generate
    signature = encode_bytes(key.sign(signed_data))
  File "/home/djc/src/PyBrowserID/browserid/crypto/fallback.py", line 92, in sign
    return unhexlify(hex(m)[2:].rstrip("L").encode("ascii"))
TypeError: Odd-length string

This happens when using the makecert script you posted to the dev-identity ml. It doesn't happen always, maybe some 15% of the times I've run the script so far.

Dont follow redirects when loading support document(?)

There was some chatter on dev-identity about whether or not the lookup process for support documents is allowed to follow HTTP redirects. I recall the answer being "no" for some technical/security reasons but I don't have a link to the details. We need to find a definitive answer on this and potentially change to code to avoid following redirects.

less cryptic errors : let's verify the data

When creating a DSKey, if the data does not have what it takes, it breaks without telling what's wrong

let's fix this. in the init I propose to add:

class DSKey(object):
    ...

    def __init__(self, data=None, obj=None):
        ...
        if obj:
            self.dsa = obj
        else:
            for key in ('p', 'q', 'g', 'y'):
                if key not in data:
                    raise ValueError('missing %s in data - %s' % (key, str(data.keys()) ))
            ....

Thoughts ?

remove fallback to /pk

The support-document fetcher currently falls back to /pk if there is no support document. This is out of spec and was a hack to support diresworb.org. We should heck whether this is still necessary, and if not then remove the fallback code.

do not hard depend on mock

Could you please consider to use unittest.mock where possible?

Perhaps something like

Index: PyBrowserID-0.14.0/browserid/tests/test_supportdoc.py
===================================================================
--- PyBrowserID-0.14.0.orig/browserid/tests/test_supportdoc.py	2014-12-12 06:15:36.000000000 +0100
+++ PyBrowserID-0.14.0/browserid/tests/test_supportdoc.py	2021-05-27 11:15:09.807769893 +0200
@@ -1,7 +1,11 @@
 import json
 import socket
 
-from mock import Mock, patch
+try:
+    from unittest.mock import Mock, patch
+except ImportError:
+    from mock import Mock, patch
+
 from requests.exceptions import RequestException
 
 from browserid.supportdoc import fetch_support_document, SupportDocumentManager
Index: PyBrowserID-0.14.0/browserid/tests/test_verifiers.py
===================================================================
--- PyBrowserID-0.14.0.orig/browserid/tests/test_verifiers.py	2018-01-11 22:01:14.000000000 +0100
+++ PyBrowserID-0.14.0/browserid/tests/test_verifiers.py	2021-05-27 11:15:59.064034201 +0200
@@ -5,7 +5,11 @@
 import time
 import warnings
 
-from mock import Mock, patch
+try:
+    from unittest.mock import Mock, patch
+except ImportError:
+    from mock import Mock, patch
+
 
 import browserid
 from browserid.tests.support import (patched_supportdoc_fetching,

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please reach out to [email protected].

(Message COC001)

Add open source software license

This Mozilla repository has been identified as lacking a license. Consistent with Mozilla's Licensing Policy an open source license should be applied to the code in this repository.

Please add an appropriate LICENSE.md file to the root directory of the project. In general, Mozilla's licensing policies are as follows:

  • Client-side products created by Mozilla employees or contributors should use the Mozilla Public License, Version 2.0 (MPL).

  • Server-side products or utilities that support Mozilla products may use either the MPL or the Apache License 2.0 (Apache 2.0).

In special cases, another license might be appropriate. If the repository is a fork of another repository it must apply the license of the original. Similarly, another license might be appropriate to match that of a broader project (for example Rust crates that Firefox depends on are published under an Apache 2.0 / MIT dual license, as that is the dual license used by the Rust programming language and projects).

Please ensure that any license added to the LICENSE.md file matches other licensing information in the repository (for example, it should match any license indicated in a setup.py or package.json file).

Mozilla staff can access more information in our Software Licensing Runbook – search for “Licensing Runbook” in Confluence to find it.

If you have any questions you can contact Daniel Nazer who can be reached at dnazer on Mozilla email or Slack.

OPENLIC-2023-01

deprecate "old-style" format for bundled assertions

The bundle_certs_and_assertion() and unbundle_certs_and_assertion() functions include support for both "old-style" and "new-style" formatting of Backed Identity Assertions. The old-style formatting hasn't been in use for a long time, we can probably deprecate this feature and eventually remove it.

add support for unverified addresses?

As described here, the verifier protocol is expanding to allow "unverified" email addresses, so that users can have access to some functionality before they have clicked through the verification email link:

https://bugzilla.mozilla.org/show_bug.cgi?id=794634

JR has a patch for django-browserid showing what this looks like from an API standpoint:

mozilla/django-browserid#96

Assuming the details don't change, we should expand our verifier API to support this as well.

LocalVerifier and the verifier running at https://verifier.login.persona.org/verify sign differently

@rfk Further to our investigations of Bug 975625, I fed an assertion that succeeded at the Persona verifier through the LocalVerifier and the signatures are different (due to what looks like padding). If you go back to our IRC log, you'll see that the two signatures look the same (modulo padding) but in fact are not the same -- a few high bits differ. I believe this is a legitimate Android platform bug (see discussion in Bug 975625), but there is also a problem with the PyBrowserID code.

Python 3 compatibility

I wrote pyramid_persona a few days ago : it uses PyBrowserID to provide a persona-based login on pyramid. Sadly, using this prevents me from using python 3 for my pyramid projects. With many web frameworks starting to support python3, a web-oriented library such as PyBrowserID should start considering supporting it.

The port might not be easy, as PyBrowserID manipulates lots of unicode and bytestrings. Someone who knows the internal of the project might be better suited, but if no one wants to do it, I can try and do the port.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.