repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
readthedocs.org | readthedocs/embed/tests/test_links.py | .py | from collections import namedtuple
import pytest
from pyquery import PyQuery
from readthedocs.embed.utils import clean_references
URLData = namedtuple("URLData", ["docurl", "ref", "expected"])
html_base_url = "https://t.readthedocs.io/en/latest/page.html"
dirhtml_base_url = "https://t.readthedocs.io/en/latest/page/... | 168 | 5,402 |
readthedocs.org | readthedocs/embed/v3/views.py | .py | """Views for the EmbedAPI v3 app."""
import re
import urllib.parse
from urllib.parse import urlparse
import requests
import structlog
from django.conf import settings
from django.core.cache import cache
from rest_framework import status
from rest_framework.renderers import BrowsableAPIRenderer
from rest_framework.ren... | 417 | 16,135 |
readthedocs.org | readthedocs/embed/v3/urls.py | .py | from django.urls import path
from .views import EmbedAPI
urlpatterns = [
path("", EmbedAPI.as_view(), name="embed_api_v3"),
]
| 9 | 133 |
readthedocs.org | readthedocs/embed/v3/tests/utils.py | .py | import os
import sphinx
srcdir = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"examples",
"default",
)
def get_anchor_link_title(thing):
# https://github.com/sphinx-doc/sphinx/commit/bc635627d32b52e8e1381f23cddecf26429db1ae
if sphinx.version_info < (5, 0, 0):
if thing == "he... | 39 | 1,037 |
readthedocs.org | readthedocs/embed/v3/tests/test_access.py | .py | from contextlib import contextmanager
from unittest import mock
import pytest
from corsheaders.middleware import ACCESS_CONTROL_ALLOW_ORIGIN
from django.contrib.auth.models import User
from django.test import TestCase, override_settings
from django.urls import reverse
from django_dynamic_fixture import get
from readt... | 128 | 4,568 |
readthedocs.org | readthedocs/embed/v3/tests/test_internal_pages.py | .py | from contextlib import contextmanager
from unittest import mock
import django_dynamic_fixture as fixture
import docutils
import pytest
from django.core.cache import cache
from django.urls import reverse
from packaging.version import Version
from readthedocs.projects.models import Project
from readthedocs.subscription... | 127 | 6,057 |
readthedocs.org | readthedocs/embed/v3/tests/test_external_pages.py | .py | from unittest import mock
import docutils
import pytest
import sphinx
from django.core.cache import cache
from django.urls import reverse
from packaging.version import Version
from .utils import compare_content_without_blank_lines, get_anchor_link_title, srcdir
@pytest.mark.django_db
@pytest.mark.embed_api
class Te... | 377 | 19,987 |
readthedocs.org | readthedocs/embed/v3/tests/test_basics.py | .py | import pytest
from django.conf import settings
from django.core.cache import cache
from django.urls import reverse
@pytest.mark.django_db
@pytest.mark.embed_api
class TestEmbedAPIv3Basics:
@pytest.fixture(autouse=True)
def setup_method(self, settings):
settings.PUBLIC_DOMAIN = "readthedocs.io"
... | 75 | 2,479 |
readthedocs.org | readthedocs/embed/v3/tests/conftest.py | .py | import os
import shutil
import pytest
from .utils import srcdir
@pytest.fixture(autouse=True, scope="module")
def remove_sphinx_build_output():
"""Remove _build/ folder, if exist."""
for path in (srcdir,):
build_path = os.path.join(path, "_build")
if os.path.exists(build_path):
sh... | 15 | 344 |
readthedocs.org | readthedocs/embed/v3/tests/examples/default/conf.py | .py | # conf.py to run tests
master_doc = "index"
extensions = [
"sphinx.ext.autosectionlabel",
"sphinxcontrib.bibtex",
]
bibtex_bibfiles = ["refs.bib"]
def setup(app):
app.add_object_type(
"confval", # directivename
"confval", # rolename
"pair: %s; configuration value", # indextemp... | 18 | 331 |
readthedocs.org | readthedocs/integrations/admin.py | .py | """Integration admin models."""
from django import urls
from django.contrib import admin
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from pygments.formatters import HtmlFormatter
from .models import HttpExchange
from .models import Integration
def pretty_json_field(field,... | 120 | 3,326 |
readthedocs.org | readthedocs/integrations/utils.py | .py | """Integration utility functions."""
def normalize_request_payload(request):
"""
Normalize the request body, hopefully to JSON.
This will attempt to return a JSON body, backing down to a string body next.
:param request: HTTP request object
:type request: django.http.HttpRequest
:returns: Th... | 24 | 740 |
readthedocs.org | readthedocs/integrations/models.py | .py | """Integration models for external services."""
import json
import re
import uuid
from dataclasses import dataclass
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db ... | 466 | 15,398 |
readthedocs.org | readthedocs/invitations/admin.py | .py | """Invitations admin."""
from django.contrib import admin
from readthedocs.invitations.models import Invitation
@admin.register(Invitation)
class InvitationAdmin(admin.ModelAdmin):
search_fields = (
"from_user__username",
"to_user__username",
"to_user__email",
"to_email",
)
... | 28 | 529 |
readthedocs.org | readthedocs/invitations/backends.py | .py | """Backends for the objects from the invitations."""
import structlog
from django.conf import settings
from django.urls import reverse
from django.utils import formats
from django.utils import timesince
from django.utils import translation
from readthedocs.core.permissions import AdminPermission
from readthedocs.core... | 155 | 4,825 |
readthedocs.org | readthedocs/invitations/models.py | .py | """Invitation models."""
import structlog
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.urls import reverse
from django.uti... | 244 | 7,257 |
readthedocs.org | readthedocs/invitations/apps.py | .py | """
Invitations app.
This manages user invitations to join a project, organization, team, etc.
"""
from django.apps import AppConfig
class InvitationsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "readthedocs.invitations"
def ready(self):
import readthedocs.invi... | 16 | 344 |
readthedocs.org | readthedocs/invitations/views.py | .py | """Invitation views."""
import structlog
from django.contrib.auth.mixins import UserPassesTestMixin
from django.http import Http404
from django.http import HttpResponseBadRequest
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.view... | 153 | 5,483 |
readthedocs.org | readthedocs/invitations/signals.py | .py | """Invitations related signals."""
import structlog
from django.db.models.signals import pre_delete
from django.dispatch import receiver
from readthedocs.invitations.models import Invitation
from readthedocs.organizations.models import Organization
from readthedocs.organizations.models import Team
from readthedocs.pr... | 35 | 1,012 |
readthedocs.org | readthedocs/invitations/urls.py | .py | from django.urls import path
from readthedocs.invitations.views import RedeemInvitation
from readthedocs.invitations.views import RevokeInvitation
urlpatterns = [
path("<invitation_token>/", RedeemInvitation.as_view(), name="invitations_redeem"),
path(
"<int:invitation_pk>/revoke/",
RevokeInv... | 15 | 383 |
readthedocs.org | readthedocs/invitations/tests/test_views.py | .py | from django.contrib.auth.models import User
from django.test import TestCase, override_settings
from django.urls import reverse
from django.utils import timezone
from django_dynamic_fixture import get
from readthedocs.audit.models import AuditLog
from readthedocs.invitations.models import Invitation
from readthedocs.o... | 608 | 23,408 |
readthedocs.org | readthedocs/invitations/tests/test_querysets.py | .py | from unittest import mock
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
from django_dynamic_fixture import get
from readthedocs.invitations.models import Invitation
from readthedocs.organizations.models import Organizati... | 175 | 5,914 |
readthedocs.org | readthedocs/invitations/tests/test_signals.py | .py | from django.contrib.auth.models import User
from django.test import TestCase
from django_dynamic_fixture import get
from readthedocs.invitations.models import Invitation
from readthedocs.organizations.models import Organization, Team
from readthedocs.projects.models import Project
class TestSignals(TestCase):
de... | 38 | 1,243 |
readthedocs.org | readthedocs/invitations/templatetags/invitations.py | .py | """Invitation template filters."""
from django import template
from readthedocs.invitations.models import Invitation
register = template.Library()
@register.filter
def can_revoke_invitation(user, object):
if isinstance(object, Invitation):
return object.can_revoke_invitation(user)
return False
| 16 | 317 |
readthedocs.org | docs/conf.py | .py | """
Shared Sphinx configuration using sphinx-multiproject.
To build each project, the ``PROJECT`` environment variable is used.
.. code:: console
$ make html # build default project
$ PROJECT=dev make html # build the dev project
for more information read https://sphinx-multiproject.readthedocs.io/.
"""
im... | 232 | 7,639 |
readthedocs.org | docs/_ext/djangodocs.py | .py | def setup(app):
app.add_crossref_type(
directivename="setting",
rolename="setting",
indextemplate="pair: %s; setting",
)
return {
"version": "builtin",
"parallel_read_safe": True,
"parallel_write_safe": True,
}
| 13 | 276 |
readthedocs.org | dockerfiles/settings/web.py | .py | from .docker_compose import DockerBaseSettings
class WebDevSettings(DockerBaseSettings):
DONT_HIT_DB = False
WebDevSettings.load_settings(__name__)
| 8 | 155 |
readthedocs.org | dockerfiles/settings/proxito.py | .py | from readthedocs.settings.proxito.base import CommunityProxitoSettingsMixin
from .docker_compose import DockerBaseSettings
class ProxitoDevSettings(CommunityProxitoSettingsMixin, DockerBaseSettings):
DONT_HIT_DB = False
# El Proxito does not have django-debug-toolbar installed
@property
def DEBUG_TO... | 24 | 730 |
readthedocs.org | dockerfiles/settings/celery.py | .py | from .docker_compose import DockerBaseSettings
class CeleryDevSettings(DockerBaseSettings):
DONT_HIT_DB = False
# TODO: review this since it may not be needed with RustFS (S3). For now,
# this is still required, but the CORS issue may have disappeared in RustFS.
# Since we can't properly set CORS on... | 20 | 740 |
readthedocs.org | dockerfiles/settings/build.py | .py | from .docker_compose import DockerBaseSettings
class BuildDevSettings(DockerBaseSettings):
@property
def DATABASES(self): # noqa
return {}
DONT_HIT_DB = True
SHOW_DEBUG_TOOLBAR = False
# The secret key is not needed from the builders.
# If you get an error about it missing, you may b... | 20 | 542 |
pynacl | setup.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 202 | 5,888 |
pynacl | noxfile.py | .py | import nox
nox.options.reuse_existing_virtualenvs = True
nox.options.default_venv_backend = "uv|virtualenv"
@nox.session
def tests(session: nox.Session) -> None:
session.install(".[tests]")
if session.posargs:
tests = session.posargs
else:
tests = ["tests/"]
session.run(
"py... | 72 | 1,499 |
pynacl | release.py | .py | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
# /// script
# dependencies = [
# "click",
# ]
# ///
import subprocess
import click
def run(*args, **kwargs):
print(f"[running]... | 33 | 698 |
pynacl | docs/vectors/python/argondriver.py | .py | import argparse
import json
import random
import string
import subprocess
import sys
class argonRunner:
GOODCHARS = string.ascii_letters + string.digits
def __init__(self, args):
self.exe = args.exe
self.mnsaltlen = args.mnsaltlen
self.mnpwlen = args.mnpwlen
self.mndgstlen = a... | 158 | 4,614 |
pynacl | tests/test_pwhash.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 679 | 19,376 |
pynacl | tests/test_kx.py | .py | # Copyright 2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 105 | 3,332 |
pynacl | tests/utils.py | .py | # Copyright 2013-2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 93 | 3,027 |
pynacl | tests/test_encoding.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 84 | 2,796 |
pynacl | tests/test_secretstream.py | .py | # Copyright 2013-2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 287 | 10,343 |
pynacl | tests/test_secret.py | .py | # Copyright 2013-2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 313 | 9,554 |
pynacl | tests/test_aead.py | .py | # Copyright 2016 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 250 | 8,275 |
pynacl | tests/test_public.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 168 | 5,999 |
pynacl | tests/test_generichash.py | .py | # Copyright 2016 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 248 | 7,421 |
pynacl | tests/test_exc.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 53 | 1,415 |
pynacl | tests/test_sealed_box.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 162 | 4,714 |
pynacl | tests/test_box.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 400 | 10,526 |
pynacl | tests/test_hash.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 107 | 3,330 |
pynacl | tests/test_hashlib_scrypt.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 143 | 4,270 |
pynacl | tests/test_bindings.py | .py | # Copyright 2013-2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 1,022 | 31,086 |
pynacl | tests/test_shorthash.py | .py | # Copyright 2016 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 238 | 8,517 |
pynacl | tests/test_utils.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 60 | 1,919 |
pynacl | tests/test_signing.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 314 | 9,675 |
pynacl | src/bindings/build.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 66 | 1,789 |
pynacl | src/libsodium/regen-msvc/regen-msvc.py | .py | #! /usr/bin/env python3
import glob
import os
import uuid
dirs = set()
tlv1 = ""
for file in glob.iglob("src/libsodium/**/*.c", recursive=True):
file = file.replace("/", "\\")
tlv1 = tlv1 + ' <ClCompile Include="..\\..\\{}" />\r\n'.format(file)
tlv2 = ""
for file in glob.iglob("src/libsodium/**/*.h", rec... | 254 | 7,308 |
pynacl | src/nacl/hash.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 181 | 6,390 |
pynacl | src/nacl/utils.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 92 | 2,321 |
pynacl | src/nacl/exceptions.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 88 | 2,484 |
pynacl | src/nacl/__init__.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 26 | 781 |
pynacl | src/nacl/secret.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 308 | 12,122 |
pynacl | src/nacl/signing.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 252 | 8,352 |
pynacl | src/nacl/public.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 418 | 14,643 |
pynacl | src/nacl/encoding.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 106 | 2,915 |
pynacl | src/nacl/hashlib.py | .py | # Copyright 2016-2019 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 142 | 4,366 |
pynacl | src/nacl/bindings/crypto_scalarmult.py | .py | # Copyright 2013-2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 240 | 8,243 |
pynacl | src/nacl/bindings/crypto_sign.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 323 | 10,288 |
pynacl | src/nacl/bindings/crypto_box.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 469 | 14,166 |
pynacl | src/nacl/bindings/utils.py | .py | # Copyright 2013-2017 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 142 | 4,298 |
pynacl | src/nacl/bindings/crypto_shorthash.py | .py | # Copyright 2016 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 77 | 2,542 |
pynacl | src/nacl/bindings/crypto_aead.py | .py | # Copyright 2017 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 998 | 28,197 |
pynacl | src/nacl/bindings/crypto_pwhash.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 576 | 18,303 |
pynacl | src/nacl/bindings/crypto_generichash.py | .py | # Copyright 2013-2019 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 281 | 8,837 |
pynacl | src/nacl/bindings/__init__.py | .py | # Copyright 2013-2019 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 524 | 19,466 |
pynacl | src/nacl/bindings/crypto_kx.py | .py | # Copyright 2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 187 | 6,525 |
pynacl | src/nacl/bindings/crypto_core.py | .py | # Copyright 2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 449 | 15,101 |
pynacl | src/nacl/bindings/crypto_secretbox.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 157 | 4,841 |
pynacl | src/nacl/bindings/crypto_hash.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 63 | 2,174 |
pynacl | src/nacl/bindings/sodium_core.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 34 | 1,039 |
pynacl | src/nacl/bindings/crypto_secretstream.py | .py | # Copyright 2013-2018 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 360 | 11,223 |
pynacl | src/nacl/bindings/randombytes.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 52 | 1,563 |
pynacl | src/nacl/pwhash/scrypt.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 210 | 6,958 |
pynacl | src/nacl/pwhash/_argon2.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 50 | 1,779 |
pynacl | src/nacl/pwhash/argon2i.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 133 | 4,405 |
pynacl | src/nacl/pwhash/__init__.py | .py | # Copyright 2017 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 74 | 2,586 |
pynacl | src/nacl/pwhash/argon2id.py | .py | # Copyright 2013 Donald Stufft and individual contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 136 | 4,434 |
lemur | build_backend.py | .py | """
Custom build backend for Lemur that handles static asset building.
This replaces the custom commands from the old setup.py.
"""
import os
import subprocess
import logging
from setuptools import build_meta as _orig
from setuptools.build_meta import *
def build_wheel(wheel_directory, config_settings=None, metadata_... | 55 | 1,855 |
lemur | config-default.py | .py | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
| 3 | 64 |
lemur | docker/src/lemur.conf.py | .py | import base64
import os.path
import secrets
import string
from typing import Dict, Any, List
_basedir = os.path.abspath(os.path.dirname(__file__))
# See the Lemur docs (https://lemur.readthedocs.org) for more information on configuration
LOG_LEVEL = str(os.environ.get('LOG_LEVEL', 'DEBUG'))
LOG_FILE = str(os.environ... | 234 | 7,717 |
lemur | lemur/manage.py | .py | #!/usr/bin/env python
import base64
import json
import os
import sys
import click
import requests
from cryptography.fernet import Fernet
from flask import current_app
from flask.cli import FlaskGroup, pass_script_info
from flask_migrate import stamp
from flask_migrate.cli import db
from sqlalchemy.sql import text
fr... | 611 | 20,252 |
lemur | lemur/utils.py | .py | """
.. module: lemur.utils
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import os
import tempfile
from contextlib import contextmanager
import cryptography.fernet
from sq... | 131 | 3,848 |
lemur | lemur/exceptions.py | .py | """
.. module: lemur.exceptions
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
from flask import current_app
class LemurException(Exception):
def __init__(self, *args, **kwargs):
current_app.logger.exception(self)
class DuplicateErr... | 66 | 1,511 |
lemur | lemur/models.py | .py | """
.. module: lemur.models
:platform: Unix
:synopsis: This module contains all of the associative tables
that help define the many to many relationships established in Lemur
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor::... | 205 | 5,991 |
lemur | lemur/__init__.py | .py | """
.. module: lemur
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
.. moduleauthor:: Curtis Castrapel <ccastrapel@netflix.com>
.. moduleauthor:: Hossein Shafagh <hshafagh@netf... | 189 | 5,792 |
lemur | lemur/constants.py | .py | """
.. module: lemur.constants
:copyright: (c) 2018 by Netflix Inc.
:license: Apache, see LICENSE for more details.
"""
from enum import IntEnum
import re
SAN_NAMING_TEMPLATE = "SAN-{subject}-{issuer}-{not_before}-{not_after}"
DEFAULT_NAMING_TEMPLATE = "{subject}-{issuer}-{not_before}-{not_after}"
NONSTANDARD_... | 151 | 5,242 |
lemur | lemur/extensions.py | .py | """
.. module: lemur.extensions
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy
class SQLAlchemy(_BaseSQLAlchemy):
def apply_pool_defaults(self, app, options):
"""
Set ... | 48 | 943 |
lemur | lemur/__about__.py | .py | __all__ = [
"__title__",
"__summary__",
"__uri__",
"__version__",
"__author__",
"__email__",
"__license__",
"__copyright__",
]
__title__ = "lemur"
__summary__ = "Certificate management and orchestration service"
__uri__ = "https://github.com/Netflix/lemur"
__version__ = "1.9.0"
__auth... | 23 | 477 |
lemur | lemur/database.py | .py | """
.. module: lemur.database
:platform: Unix
:synopsis: This module contains all of the database related methods
needed for lemur to interact with a datastore
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson... | 341 | 8,335 |
lemur | lemur/metrics.py | .py | """
.. module: lemur.metrics
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
from typing import List
from flask import current_app
from lemur.plugins.base import plugins
class Metrics:
"""
:param app: The Flask application object. Default... | 39 | 1,125 |
lemur | lemur/factory.py | .py | """
.. module: lemur.factory
:platform: Unix
:synopsis: This module contains all the needed functions to allow
the factory app creation.
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
... | 296 | 9,098 |
lemur | lemur/schemas.py | .py | """
.. module: lemur.schemas
:platform: unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
from marshmallow import fields, post_load, pre_load, post_dump
from marshmallow.exceptions impo... | 333 | 10,584 |
lemur | lemur/default.conf.py | .py | # This is just Python which means you can inherit and tweak settings
import os
_basedir = os.path.abspath(os.path.dirname(__file__))
THREADS_PER_PAGE = 8
# General
# These will need to be set to `True` if you are developing locally
CORS = False
DEBUG = False
# Logging
LOG_LEVEL = "DEBUG"
LOG_FILE = "lemur.log"
L... | 36 | 1,524 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.