id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39,100 | fabcf24d9304_.py | privacyidea_privacyidea/migrations/versions/fabcf24d9304_.py | """v3.8: Increase key_enc column in token table
The key_enc column is too small to accommodate 1023 bit size WebAuthn
credential_ids. See https://github.com/privacyidea/privacyidea/issues/3137
Revision ID: fabcf24d9304
Revises: 00762b3f7a60
Create Date: 2022-10-06 12:13:09.044799
"""
# revision identifiers, used by... | 1,032 | Python | .py | 27 | 32.592593 | 79 | 0.698795 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,101 | ef29ba43e290_.py | privacyidea_privacyidea/migrations/versions/ef29ba43e290_.py | """v3.7: Allow empty machine_id and resolver_id in machinetoken
Revision ID: ef29ba43e290
Revises: ff26585932ec
Create Date: 2021-12-30 12:17:15.521336
"""
# revision identifiers, used by Alembic.
revision = 'ef29ba43e290'
down_revision = 'ff26585932ec'
from alembic import op
import sqlalchemy as sa
def upgrade()... | 1,209 | Python | .py | 32 | 29.28125 | 89 | 0.641574 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,102 | 8d40dbcfda25_.py | privacyidea_privacyidea/migrations/versions/8d40dbcfda25_.py | """Update AuthCache.authentication to VARCHAR(255) to accommodate argon2 hashes.
Revision ID: 8d40dbcfda25
Revises: 140ba0ca4f07
Create Date: 2020-11-02 17:57:12.493515
"""
# revision identifiers, used by Alembic.
revision = '8d40dbcfda25'
down_revision = '140ba0ca4f07'
from alembic import op
import sqlalchemy as s... | 1,200 | Python | .py | 28 | 34.75 | 88 | 0.64721 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,103 | 4a0aec37e7cf_.py | privacyidea_privacyidea/migrations/versions/4a0aec37e7cf_.py | """v3.9: Add table serviceid
Revision ID: 4a0aec37e7cf
Revises: 006d4747f858
Create Date: 2023-03-15 16:14:26.204225
"""
# revision identifiers, used by Alembic.
revision = '4a0aec37e7cf'
down_revision = '006d4747f858'
from alembic import op, context
import sqlalchemy as sa
from sqlalchemy.schema import Sequence, C... | 1,261 | Python | .py | 37 | 28.432432 | 75 | 0.688944 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,104 | a7e91b18a460_.py | privacyidea_privacyidea/migrations/versions/a7e91b18a460_.py | """add dedicated adminuser to policies
Revision ID: a7e91b18a460
Revises: 0c7123345224
Create Date: 2020-01-29 13:42:15.390923
"""
# revision identifiers, used by Alembic.
revision = 'a7e91b18a460'
down_revision = '0c7123345224'
from alembic import op
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalche... | 2,510 | Python | .py | 57 | 38.789474 | 97 | 0.686604 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,105 | 2100d1fad908_.py | privacyidea_privacyidea/migrations/versions/2100d1fad908_.py | """v3.10: Add index to expiration in challenge table
Revision ID: 2100d1fad908
Revises: 250931d82e51
Create Date: 2024-05-06 13:36:45.910206
"""
# revision identifiers, used by Alembic.
revision = '2100d1fad908'
down_revision = '250931d82e51'
from alembic import op
from sqlalchemy.exc import OperationalError, Progr... | 908 | Python | .py | 23 | 34.652174 | 99 | 0.714937 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,106 | e360c56bcf8c_.py | privacyidea_privacyidea/migrations/versions/e360c56bcf8c_.py | """Add constraint for smsoptions and set default type to "option"
Revision ID: e360c56bcf8c
Revises: a7e91b18a460
Create Date: 2020-06-15 09:18:43.855589
"""
# revision identifiers, used by Alembic.
revision = 'e360c56bcf8c'
down_revision = 'a7e91b18a460'
from alembic import op, context
import sqlalchemy as sa
from... | 3,059 | Python | .py | 68 | 37.205882 | 94 | 0.658701 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,107 | 20969b4cbf06_.py | privacyidea_privacyidea/migrations/versions/20969b4cbf06_.py | """Add column revoked to Token table
Revision ID: 20969b4cbf06
Revises: 4d9178fa8336
Create Date: 2015-08-27 12:19:57.272525
"""
# revision identifiers, used by Alembic.
revision = '20969b4cbf06'
down_revision = '4d9178fa8336'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalErro... | 1,400 | Python | .py | 37 | 30.054054 | 76 | 0.638848 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,108 | 3429d523e51f_.py | privacyidea_privacyidea/migrations/versions/3429d523e51f_.py | """Make subscription fields (level, application, for_name) longer
Revision ID: 3429d523e51f
Revises: d6b40a745e5
Create Date: 2017-05-12 12:52:38.545144
"""
# revision identifiers, used by Alembic.
revision = '3429d523e51f'
down_revision = 'd6b40a745e5'
from alembic import op
import sqlalchemy as sa
def upgrade()... | 1,085 | Python | .py | 31 | 28 | 76 | 0.644636 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,109 | d756b34061ff_.py | privacyidea_privacyidea/migrations/versions/d756b34061ff_.py | """Store privacyIDEA node in eventcounter table
Revision ID: d756b34061ff
Revises: 3d7f8b29cbb1
Create Date: 2019-09-02 13:59:24.244529
"""
# revision identifiers, used by Alembic.
from sqlalchemy import orm
from sqlalchemy.sql.ddl import CreateSequence
from privacyidea.lib.config import get_privacyidea_node
revisi... | 3,631 | Python | .py | 79 | 34.936709 | 103 | 0.603565 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,110 | 86f40f535d7c_.py | privacyidea_privacyidea/migrations/versions/86f40f535d7c_.py | """v3.8: Add indices to datetime columns
Revision ID: 86f40f535d7c
Revises: ef29ba43e290
Create Date: 2022-05-10 16:55:28.541847
"""
# revision identifiers, used by Alembic.
revision = '86f40f535d7c'
down_revision = 'ef29ba43e290'
from alembic import op
def upgrade():
index_data = [('challenge', 'timestamp'),... | 969 | Python | .py | 26 | 29.192308 | 86 | 0.588235 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,111 | 849170064430_.py | privacyidea_privacyidea/migrations/versions/849170064430_.py | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = '48ee74b8a7c8'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | 610 | Python | .py | 18 | 30.444444 | 118 | 0.736301 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,112 | 00762b3f7a60_.py | privacyidea_privacyidea/migrations/versions/00762b3f7a60_.py | """v3.8: migrate WebAuthn credential algorithm selection
Revision ID: 00762b3f7a60
Revises: 86f40f535d7c
Create Date: 2022-08-31 11:24:12.226997
"""
# revision identifiers, used by Alembic.
revision = '00762b3f7a60'
down_revision = '86f40f535d7c'
import re
from alembic import op
from sqlalchemy import orm, update
f... | 2,639 | Python | .py | 58 | 38.810345 | 105 | 0.664333 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,113 | 3d7f8b29cbb1_.py | privacyidea_privacyidea/migrations/versions/3d7f8b29cbb1_.py | """Add a generic admin policy for all admin read actions
Revision ID: 3d7f8b29cbb1
Revises: dceb6cd3c41e
Create Date: 2019-07-04 22:37:53.594962
"""
# revision identifiers, used by Alembic.
revision = '3d7f8b29cbb1'
down_revision = 'dceb6cd3c41e'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.ext.d... | 3,717 | Python | .py | 84 | 37.25 | 90 | 0.672657 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,114 | 205bda834127_.py | privacyidea_privacyidea/migrations/versions/205bda834127_.py | """Add authcache table
Revision ID: 205bda834127
Revises: 4238eac8ccab
Create Date: 2017-08-11 16:33:31.164408
"""
# revision identifiers, used by Alembic.
revision = '205bda834127'
down_revision = '4238eac8ccab'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.create_table('authc... | 1,653 | Python | .py | 35 | 41.4 | 95 | 0.678682 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,115 | 4f32a4e1bf33_.py | privacyidea_privacyidea/migrations/versions/4f32a4e1bf33_.py | """Update from version 1.5 to version 2.0
Revision ID: 4f32a4e1bf33
Revises:
ne
Create Date: 2015-01-26 10:06:50.568505
"""
# revision identifiers, used by Alembic.
revision = '4f32a4e1bf33'
down_revision = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
f... | 19,377 | Python | .py | 451 | 32.745011 | 84 | 0.592247 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,116 | 19f727d285e2_.py | privacyidea_privacyidea/migrations/versions/19f727d285e2_.py | """Add monitoringstats table
Revision ID: 19f727d285e2
Revises: 2c9430cfc66b
Create Date: 2018-07-03 11:45:57.967604
"""
# revision identifiers, used by Alembic.
revision = '19f727d285e2'
down_revision = '2c9430cfc66b'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.create_table(... | 910 | Python | .py | 26 | 29.846154 | 71 | 0.688356 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,117 | db6b2ef8100f_.py | privacyidea_privacyidea/migrations/versions/db6b2ef8100f_.py | """v3.10: Add case-insensitive usernames in policies
Revision ID: db6b2ef8100f
Revises: d0e7144947d0
Create Date: 2024-01-29 14:12:38.070014
"""
# revision identifiers, used by Alembic.
revision = 'db6b2ef8100f'
down_revision = 'd0e7144947d0'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import... | 1,102 | Python | .py | 28 | 34.392857 | 96 | 0.693533 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,118 | 58e4f7ebb705_.py | privacyidea_privacyidea/migrations/versions/58e4f7ebb705_.py | """Add the boolean field check_all_resolvers to policy table.
Revision ID: 58e4f7ebb705
Revises: 3f7e8583ea2
Create Date: 2016-12-13 15:20:54.003819
"""
# revision identifiers, used by Alembic.
revision = '58e4f7ebb705'
down_revision = '3f7e8583ea2'
from alembic import op
import sqlalchemy as sa
def upgrade():
... | 603 | Python | .py | 18 | 30.055556 | 94 | 0.731369 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,119 | d2ae8e54b628_.py | privacyidea_privacyidea/migrations/versions/d2ae8e54b628_.py | """shorten columns used in UNIQUE constraints in periodictasklastrun, periodictaskoption
Revision ID: d2ae8e54b628
Revises: 1a0710df148b
Create Date: 2018-10-24 11:17:40.279312
"""
# revision identifiers, used by Alembic.
revision = 'd2ae8e54b628'
down_revision = '1a0710df148b'
from alembic import op
import sqlalch... | 3,034 | Python | .py | 61 | 41 | 119 | 0.666779 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,120 | 2181294eed0b_.py | privacyidea_privacyidea/migrations/versions/2181294eed0b_.py | """Add column 'condition' to table 'policy'
Revision ID: 2181294eed0b
Revises: 2551ee982544
Create Date: 2015-02-06 09:30:00.848172
"""
# revision identifiers, used by Alembic.
revision = '2181294eed0b'
down_revision = '2551ee982544'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import Operatio... | 882 | Python | .py | 24 | 32.083333 | 85 | 0.715294 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,121 | 4023571658f8_.py | privacyidea_privacyidea/migrations/versions/4023571658f8_.py | """Add the DB table password reset in version 2.10
Revision ID: 4023571658f8
Revises: 2ac117d0a6f5
Create Date: 2016-01-07 16:45:35.708951
"""
# revision identifiers, used by Alembic.
revision = '4023571658f8'
down_revision = '2ac117d0a6f5'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import O... | 1,810 | Python | .py | 40 | 38.25 | 80 | 0.674801 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,122 | 1a69e5e5e2ac_.py | privacyidea_privacyidea/migrations/versions/1a69e5e5e2ac_.py | """Add audit table to DB schema
Revision ID: 1a69e5e5e2ac
Revises: 37e6b49fc686
Create Date: 2016-11-25 18:37:00.920703
"""
# revision identifiers, used by Alembic.
revision = '1a69e5e5e2ac'
down_revision = '37e6b49fc686'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
### commands ... | 1,915 | Python | .py | 39 | 41 | 87 | 0.642207 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,123 | d5870fd2f2a4_.py | privacyidea_privacyidea/migrations/versions/d5870fd2f2a4_.py | """merge two heads of audit log and auth_cache
Revision ID: d5870fd2f2a4
Revises: ('3236a1abf1c6', '8d40dbcfda25')
Create Date: 2020-11-21 14:12:41.097913
"""
# revision identifiers, used by Alembic.
revision = 'd5870fd2f2a4'
down_revision = ('3236a1abf1c6', '8d40dbcfda25')
from alembic import op
import sqlalchemy ... | 380 | Python | .py | 14 | 25 | 48 | 0.768156 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,124 | 69e7817b9863_.py | privacyidea_privacyidea/migrations/versions/69e7817b9863_.py | """v3.10: Add container tables (tokencontainer, tokencontainerinfo, tokencontainerowner, tokencontainerrealm,
tokencontainerstates, tokencontainertoken) and add columns container_serial and container_type to the privacy_idea
audit table.
Revision ID: 69e7817b9863
Revises: db6b2ef8100f
Create Date: 2024-07-05 10:05:13.... | 8,304 | Python | .py | 145 | 43.372414 | 115 | 0.593493 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,125 | 4238eac8ccab_.py | privacyidea_privacyidea/migrations/versions/4238eac8ccab_.py | """Make schema oracle compatible, Remove unnecessary columns from table usercache
Revision ID: 4238eac8ccab
Revises: 3429d523e51f
Create Date: 2017-08-10 11:53:30.426989
"""
# revision identifiers, used by Alembic.
revision = '4238eac8ccab'
down_revision = '3429d523e51f'
from alembic import op
import sqlalchemy as ... | 3,633 | Python | .py | 71 | 43.647887 | 107 | 0.660282 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,126 | 140ba0ca4f07_.py | privacyidea_privacyidea/migrations/versions/140ba0ca4f07_.py | """merge SMS options and privacyIDEA nodes
Revision ID: 140ba0ca4f07
Revises: ('e360c56bcf8c', '631ec59e1ca6')
Create Date: 2020-06-26 12:40:39.663531
"""
# revision identifiers, used by Alembic.
revision = '140ba0ca4f07'
down_revision = ('e360c56bcf8c', '631ec59e1ca6')
from alembic import op
import sqlalchemy as s... | 376 | Python | .py | 14 | 24.714286 | 48 | 0.774011 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,127 | 89e57ed16379_.py | privacyidea_privacyidea/migrations/versions/89e57ed16379_.py | """v3.8: Add database tables tokengroup and tokentokengroup
Revision ID: 89e57ed16379
Revises: 00762b3f7a60
Create Date: 2022-09-28 11:24:28.966256
"""
# revision identifiers, used by Alembic.
revision = '89e57ed16379'
down_revision = '00762b3f7a60'
from alembic import op
import sqlalchemy as sa
def upgrade():
... | 1,552 | Python | .py | 40 | 32.575 | 81 | 0.665336 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,128 | d3c0f0403a84_.py | privacyidea_privacyidea/migrations/versions/d3c0f0403a84_.py | """v3.8: Merging revisions
Revision ID: d3c0f0403a84
Revises: ('fabcf24d9304', 'a28f2733897b')
Create Date: 2022-11-30 22:37:19.986083
"""
# revision identifiers, used by Alembic.
revision = 'd3c0f0403a84'
down_revision = ('fabcf24d9304', 'a28f2733897b')
from alembic import op
import sqlalchemy as sa
def upgrade(... | 360 | Python | .py | 14 | 23.571429 | 48 | 0.766272 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,129 | dceb6cd3c41e_.py | privacyidea_privacyidea/migrations/versions/dceb6cd3c41e_.py | """Add policycondition table, remove unused condition column from policy table
Revision ID: dceb6cd3c41e
Revises: b9131d0686eb
Create Date: 2019-07-02 12:19:19.646528
"""
# revision identifiers, used by Alembic.
revision = 'dceb6cd3c41e'
down_revision = 'b9131d0686eb'
from alembic import op, context
import sqlalche... | 1,810 | Python | .py | 44 | 35.25 | 81 | 0.690598 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,130 | d0e7144947d0_.py | privacyidea_privacyidea/migrations/versions/d0e7144947d0_.py | """v3.10: Add column node_uuid to table resolverrealm
Revision ID: d0e7144947d0
Revises: e3a64b4ca634
Create Date: 2023-12-04 17:45:25.949596
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError, ProgrammingError
# revision identifiers, used by Alembic.
revision = 'd0e714494... | 3,888 | Python | .py | 81 | 38.851852 | 104 | 0.626217 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,131 | b9131d0686eb_.py | privacyidea_privacyidea/migrations/versions/b9131d0686eb_.py | """Add a generic admin policy for tokenlist
Revision ID: b9131d0686eb
Revises: 849170064430
Create Date: 2019-06-28 07:37:59.224088
"""
# revision identifiers, used by Alembic.
revision = 'b9131d0686eb'
down_revision = '849170064430'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.ext.declarative imp... | 3,379 | Python | .py | 79 | 37.075949 | 99 | 0.68309 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,132 | 307a4fbe8a05_.py | privacyidea_privacyidea/migrations/versions/307a4fbe8a05_.py | """alter table challenge
Revision ID: 307a4fbe8a05
Revises: 1edda52b619f
Create Date: 2017-04-19 14:39:20.255958
"""
# revision identifiers, used by Alembic.
revision = '307a4fbe8a05'
down_revision = '1edda52b619f'
from alembic import op
def upgrade():
try:
op.create_index(op.f('ix_challenge_serial'),... | 1,119 | Python | .py | 28 | 33.25 | 78 | 0.662973 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,133 | 3f7e8583ea2_.py | privacyidea_privacyidea/migrations/versions/3f7e8583ea2_.py | """Add columns name and active to event handlers
Revision ID: 3f7e8583ea2
Revises: 22558d9f3178
Create Date: 2016-11-16 16:37:27.342209
"""
# revision identifiers, used by Alembic.
revision = '3f7e8583ea2'
down_revision = '22558d9f3178'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import Opera... | 1,094 | Python | .py | 28 | 33.571429 | 87 | 0.699811 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,134 | 9155f0d3d028_.py | privacyidea_privacyidea/migrations/versions/9155f0d3d028_.py | """v3.6: set TLS v1.0 for existing ldap resolvers to keep legacy behavior
Revision ID: 9155f0d3d028
Revises: d5870fd2f2a4
Create Date: 2021-03-23 14:25:48.425762
privacyIDEA Version: 3.6
"""
# revision identifiers, used by Alembic.
revision = '9155f0d3d028'
down_revision = 'd5870fd2f2a4'
from alembic import op
from... | 3,969 | Python | .py | 85 | 35.788235 | 117 | 0.602481 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,135 | 250931d82e51_.py | privacyidea_privacyidea/migrations/versions/250931d82e51_.py | """v3.10: Add columns authentication, user_agent/version to Audit
Revision ID: 250931d82e51
Revises: 5741e5dac477
Create Date: 2024-03-27 16:08:47.242337
"""
# revision identifiers, used by Alembic.
revision = '250931d82e51'
down_revision = '5741e5dac477'
from alembic import op
import sqlalchemy as sa
def upgrade... | 1,171 | Python | .py | 26 | 38.769231 | 103 | 0.672823 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,136 | 2ac117d0a6f5_.py | privacyidea_privacyidea/migrations/versions/2ac117d0a6f5_.py | """Add the DB table SMTPServer in version 2.10
Revision ID: 2ac117d0a6f5
Revises: 20969b4cbf06
Create Date: 2015-12-27 10:17:23.861696
"""
# revision identifiers, used by Alembic.
revision = '2ac117d0a6f5'
down_revision = '20969b4cbf06'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import (Oper... | 1,451 | Python | .py | 35 | 35.4 | 78 | 0.683724 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,137 | e3a64b4ca634_.py | privacyidea_privacyidea/migrations/versions/e3a64b4ca634_.py | """v3.10: Add table nodename
Revision ID: e3a64b4ca634
Revises: 5cb310101a1f
Create Date: 2023-11-23 11:41:30.149153
"""
from datetime import datetime
from dateutil.tz import tzutc
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError, ProgrammingError
# revision identifiers, use... | 1,696 | Python | .py | 39 | 35.948718 | 110 | 0.64303 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,138 | 14a1bcb10018_.py | privacyidea_privacyidea/migrations/versions/14a1bcb10018_.py | """add timeout and retries to radiusserver table
Revision ID: 14a1bcb10018
Revises: 36428afb2457
Create Date: 2017-10-30 15:16:04.819246
"""
# revision identifiers, used by Alembic.
revision = '14a1bcb10018'
down_revision = '36428afb2457'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | 721 | Python | .py | 20 | 32.25 | 88 | 0.728716 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,139 | 3ae3c668f444_.py | privacyidea_privacyidea/migrations/versions/3ae3c668f444_.py | """Add event handler conditions table
Revision ID: 3ae3c668f444
Revises: 5402fd96fbca
Create Date: 2016-07-20 12:18:55.643974
"""
# revision identifiers, used by Alembic.
revision = '3ae3c668f444'
down_revision = '5402fd96fbca'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalErr... | 1,409 | Python | .py | 34 | 35.323529 | 76 | 0.695971 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,140 | d415d490eb05_.py | privacyidea_privacyidea/migrations/versions/d415d490eb05_.py | """v3.6: Add auth_count column to authcache table
Revision ID: d415d490eb05
Revises: 9155f0d3d028
Create Date: 2021-04-06 21:19:25.931603
privacyIDEA Version: 3.6
"""
# revision identifiers, used by Alembic.
revision = 'd415d490eb05'
down_revision = '9155f0d3d028'
from alembic import op
import sqlalchemy as sa
from... | 927 | Python | .py | 25 | 32.56 | 88 | 0.722595 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,141 | 1edda52b619f_.py | privacyidea_privacyidea/migrations/versions/1edda52b619f_.py | """Add user index to table pidea_audit to speed up audit.
Revision ID: 1edda52b619f
Revises: 58e4f7ebb705
Create Date: 2017-03-29 12:13:56.239454
"""
# revision identifiers, used by Alembic.
revision = '1edda52b619f'
down_revision = '58e4f7ebb705'
from alembic import op
import sqlalchemy as sa
def upgrade():
... | 765 | Python | .py | 23 | 28.043478 | 77 | 0.6794 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,142 | ff26585932ec_.py | privacyidea_privacyidea/migrations/versions/ff26585932ec_.py | """v3.7: migrate old reply_to email
Revision ID: ff26585932ec
Revises: fa07bd604a75
Create Date: 2021-07-15 14:17:17.624748
"""
# revision identifiers, used by Alembic.
revision = 'ff26585932ec'
down_revision = 'fa07bd604a75'
from alembic import op
from sqlalchemy import orm
from privacyidea.models import EventHand... | 1,288 | Python | .py | 35 | 28.371429 | 120 | 0.644409 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,143 | 4d9178fa8336_.py | privacyidea_privacyidea/migrations/versions/4d9178fa8336_.py | """Add adminrealm to policies
Revision ID: 4d9178fa8336
Revises: e5cbeb7c177
Create Date: 2015-06-15 13:58:35.377862
"""
# revision identifiers, used by Alembic.
revision = '4d9178fa8336'
down_revision = 'e5cbeb7c177'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError, Progra... | 963 | Python | .py | 26 | 29.423077 | 76 | 0.659849 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,144 | 5402fd96fbca_.py | privacyidea_privacyidea/migrations/versions/5402fd96fbca_.py | """Add smsgateway table
Revision ID: 5402fd96fbca
Revises: 50adc980d625
Create Date: 2016-06-19 17:25:05.152889
"""
# revision identifiers, used by Alembic.
revision = '5402fd96fbca'
down_revision = '50adc980d625'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError, Programmin... | 2,009 | Python | .py | 46 | 37.065217 | 113 | 0.675883 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,145 | 5741e5dac477_.py | privacyidea_privacyidea/migrations/versions/5741e5dac477_.py | """v3.10: Add a table for policy descriptions
Revision ID: 5741e5dac477
Revises: e3a64b4ca634
Create Date: 2024-02-23 11:06:41.729152
"""
from alembic import op, context
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError, ProgrammingError
from sqlalchemy.schema import Sequence, CreateSequence, DropSe... | 2,062 | Python | .py | 49 | 31.693878 | 88 | 0.605985 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,146 | 3c6e9dd7fbac_.py | privacyidea_privacyidea/migrations/versions/3c6e9dd7fbac_.py | """Add client application type table
Revision ID: 3c6e9dd7fbac
Revises: 3ae3c668f444
Create Date: 2016-08-30 17:40:29.869763
"""
# revision identifiers, used by Alembic.
revision = '3c6e9dd7fbac'
down_revision = '3ae3c668f444'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalErro... | 1,874 | Python | .py | 39 | 41.897436 | 115 | 0.701533 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,147 | 449903fb6e35_.py | privacyidea_privacyidea/migrations/versions/449903fb6e35_.py | """Add table 'radiusserver' to configure the settings of remote RADIUS servers.
Revision ID: 449903fb6e35
Revises: 4023571658f8
Create Date: 2016-02-19 15:41:22.196074
"""
# revision identifiers, used by Alembic.
revision = '449903fb6e35'
down_revision = '4023571658f8'
from alembic import op
import sqlalchemy as sa... | 1,339 | Python | .py | 33 | 34.69697 | 79 | 0.69468 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,148 | 37e6b49fc686_.py | privacyidea_privacyidea/migrations/versions/37e6b49fc686_.py | """Add subscription table
Revision ID: 37e6b49fc686
Revises: 3c6e9dd7fbac
Create Date: 2016-10-23 10:45:45.792467
"""
# revision identifiers, used by Alembic.
revision = '37e6b49fc686'
down_revision = '3c6e9dd7fbac'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError, Programm... | 2,592 | Python | .py | 51 | 43.901961 | 107 | 0.674437 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,149 | cb6d7b7bae63_.py | privacyidea_privacyidea/migrations/versions/cb6d7b7bae63_.py | """Add column used_login to usercache
Revision ID: cb6d7b7bae63
Revises: a63df077051a
Create Date: 2018-12-18 11:59:27.486883
"""
# revision identifiers, used by Alembic.
revision = 'cb6d7b7bae63'
down_revision = 'a63df077051a'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.add_... | 838 | Python | .py | 20 | 38.05 | 99 | 0.723115 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,150 | 631ec59e1ca6_.py | privacyidea_privacyidea/migrations/versions/631ec59e1ca6_.py | """Add privacyIDEA node to the policy table
Revision ID: 631ec59e1ca6
Revises: a7e91b18a460
Create Date: 2020-06-05 15:36:57.225327
"""
# revision identifiers, used by Alembic.
revision = '631ec59e1ca6'
down_revision = 'a7e91b18a460'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
o... | 649 | Python | .py | 18 | 32.555556 | 91 | 0.733119 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,151 | 145ce80decd_.py | privacyidea_privacyidea/migrations/versions/145ce80decd_.py | """Add table eventcounter
Revision ID: 145ce80decd
Revises: 49a04e560d96
Create Date: 2018-03-01 12:22:04.523615
"""
# revision identifiers, used by Alembic.
revision = '145ce80decd'
down_revision = '49a04e560d96'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.create_table('even... | 773 | Python | .py | 22 | 27.772727 | 89 | 0.652759 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,152 | 22558d9f3178_.py | privacyidea_privacyidea/migrations/versions/22558d9f3178_.py | """Add resolver column to table pidea_audit
Revision ID: 22558d9f3178
Revises: 1a69e5e5e2ac
Create Date: 2016-11-25 18:42:16.854066
"""
# revision identifiers, used by Alembic.
revision = '22558d9f3178'
down_revision = '1a69e5e5e2ac'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
o... | 597 | Python | .py | 18 | 29.722222 | 96 | 0.737303 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,153 | 239995464c48_.py | privacyidea_privacyidea/migrations/versions/239995464c48_.py | """Add RADIUS dictionary
Revision ID: 239995464c48
Revises: 449903fb6e35
Create Date: 2016-02-21 21:35:04.044207
"""
# revision identifiers, used by Alembic.
revision = '239995464c48'
down_revision = '449903fb6e35'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError, Programmi... | 970 | Python | .py | 26 | 29.230769 | 76 | 0.650641 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,154 | 888b56ed5dcb_.py | privacyidea_privacyidea/migrations/versions/888b56ed5dcb_.py | """v3.6: Add table for custom user attributes
Revision ID: 888b56ed5dcb
Revises: d415d490eb05
Create Date: 2021-02-10 12:17:40.880224
"""
# revision identifiers, used by Alembic.
revision = '888b56ed5dcb'
down_revision = 'd415d490eb05'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | 1,531 | Python | .py | 32 | 41.09375 | 115 | 0.678068 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,155 | 1a0710df148b_.py | privacyidea_privacyidea/migrations/versions/1a0710df148b_.py | """add column position for event handlers
Revision ID: 1a0710df148b
Revises: 19f727d285e2
Create Date: 2018-08-03 12:36:17.091876
"""
# revision identifiers, used by Alembic.
revision = '1a0710df148b'
down_revision = '19f727d285e2'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.... | 605 | Python | .py | 18 | 30.166667 | 100 | 0.746114 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,156 | 2118e566df16_.py | privacyidea_privacyidea/migrations/versions/2118e566df16_.py | """Add timeout to SMTP server definition
Revision ID: 2118e566df16
Revises: 14a1bcb10018
Create Date: 2018-02-09 08:48:03.308744
"""
# revision identifiers, used by Alembic.
revision = '2118e566df16'
down_revision = '14a1bcb10018'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.a... | 565 | Python | .py | 18 | 28 | 86 | 0.733333 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,157 | privacyidea-update-linotp-counter.py | privacyidea_privacyidea/tools/privacyidea-update-linotp-counter.py | #!/usr/bin/python
# 2018-05-27 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# init
__doc__ = """
You can use this script to update counter values of tokens in the privacyIDEA
database. This is helpful after database migrations. Counters in the old
instance may have been updated, since users still a... | 5,408 | Python | .py | 112 | 41.285714 | 133 | 0.668374 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,158 | privacyidea-sync-owncloud.py | privacyidea_privacyidea/tools/privacyidea-sync-owncloud.py | #!/usr/bin/env python
# 2020-04-28 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Read tables oc_accounts and oc_users from owncloud
#
__doc__ = """You can use this script to read the tables oc_accounts and
oc_users from owncloud and fill a local user table in privacyIDEA.
Run this script in a cron... | 8,126 | Python | .py | 174 | 34.936782 | 120 | 0.570038 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,159 | privacyidea-convert-base32.py | privacyidea_privacyidea/tools/privacyidea-convert-base32.py | #!/usr/bin/env python
# 2018-07-27 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# init
__doc__ = """Read a file containing serials and base32 encoded secrets and converting it to hex."""
import argparse
import sys
import binascii
import base64
parser = argparse.ArgumentParser(description=__doc__)... | 1,740 | Python | .py | 43 | 34.651163 | 99 | 0.620628 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,160 | privacyidea-update-counter.py | privacyidea_privacyidea/tools/privacyidea-update-counter.py | #!/usr/bin/env python
# 2018-05-27 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# init
__doc__ = """
You can use this script to update counter values of tokens in the privacyIDEA
database. This is helpful after database migrations. Counters in the old
instance may have been updated, since users sti... | 3,808 | Python | .py | 84 | 36.952381 | 133 | 0.6303 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,161 | ssha.py | privacyidea_privacyidea/tools/ssha.py | #!/usr/bin/env python
import base64
import getpass
import hashlib
import os
def get_hash(passwd, salt):
"""
Calculate a sha1 hash of a password with salt.
:param passwd: The password
:type passwd: string
:param salt: The salt
:type salt: bytestring
:return: string
let's see if docte... | 681 | Python | .py | 22 | 26.818182 | 63 | 0.669231 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,162 | privacyidea-export-linotp-counter.py | privacyidea_privacyidea/tools/privacyidea-export-linotp-counter.py | #!/usr/bin/env python
# 2018-05-27 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# init
__doc__ = """
This script helps you to migrate LinOTP to privacyIDEA.
You can use this script to export the counter values of the tokens
from a LinOTP database. You can then pass these values
to the script privac... | 4,503 | Python | .py | 93 | 29.935484 | 96 | 0.476667 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,163 | privacyidea-migrate-linotp.py | privacyidea_privacyidea/tools/privacyidea-migrate-linotp.py | #!/usr/bin/env python
# 2020-06-13 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Add failsafe for tokeninfo
# 2019-10-04 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Allow encryption and config file
# 2018-02-09 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# S... | 25,689 | Python | .py | 504 | 35.05754 | 97 | 0.521776 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,164 | privacyidea-export-privacyidea-counter.py | privacyidea_privacyidea/tools/privacyidea-export-privacyidea-counter.py | #!/usr/bin/python
# 2018-05-27 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# init
__doc__ = """
This script exports counter from privacyIDEA to a csv file.
It exports
serial, counter
"""
from sqlalchemy.sql import select
from privacyidea.models import Token
import argparse
from sqlalchemy imp... | 1,341 | Python | .py | 38 | 29.184211 | 83 | 0.628106 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,165 | privacyidea_apache.py | privacyidea_privacyidea/authmodules/apache2/privacyidea_apache.py | # 2015-06-04 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Initial writeup
#
# (c) Cornelius Kölbel
# Info: http://www.privacyidea.org
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as published by the Free... | 5,138 | Python | .py | 124 | 33.685484 | 87 | 0.647907 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,166 | conftest.py | privacyidea_privacyidea/tests/conftest.py | import sys
collect_ignore = []
if sys.version_info[0] > 2:
collect_ignore.extend([
])
| 95 | Python | .py | 5 | 16.2 | 27 | 0.662921 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,167 | test_api_audit.py | privacyidea_privacyidea/tests/test_api_audit.py | import mock
from contextlib import contextmanager
from datetime import datetime, timedelta
from .base import MyApiTestCase
from privacyidea.lib.policy import set_policy, SCOPE, ACTION, delete_policy
from privacyidea.models import Audit
from privacyidea.lib.resolver import save_resolver
from privacyidea.lib.realm impor... | 21,706 | Python | .py | 354 | 38.144068 | 102 | 0.467017 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,168 | test_app.py | privacyidea_privacyidea/tests/test_app.py | """
This testfile tests the basic app functionality of the privacyIDEA app
"""
import os
import unittest
import flask
import inspect
import logging
import mock
from testfixtures import Comparison, compare
from privacyidea.app import create_app
from privacyidea.config import config, TestingConfig
dirname = os.path.dirn... | 9,253 | Python | .py | 161 | 38.062112 | 94 | 0.523285 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,169 | test_lib_task_simplestats.py | privacyidea_privacyidea/tests/test_lib_task_simplestats.py | """
This tests the files
lib/task/simplestats.py
"""
from privacyidea.lib.user import User
from privacyidea.lib.tokenclass import TOKENKIND
from privacyidea.lib.token import init_token
from privacyidea.models import db
from .base import MyTestCase
from privacyidea.lib.monitoringstats import get_values
from flask impo... | 3,665 | Python | .py | 75 | 37.8 | 94 | 0.595411 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,170 | test_api_monitoring.py | privacyidea_privacyidea/tests/test_api_monitoring.py | from .base import MyApiTestCase
from privacyidea.lib.monitoringstats import write_stats
from privacyidea.lib.tokenclass import AUTH_DATE_FORMAT
from privacyidea.models import db
import datetime
class APIMonitoringTestCase(MyApiTestCase):
def test_01_get_stats(self):
# create some statistics
wri... | 5,318 | Python | .py | 98 | 36.377551 | 87 | 0.513082 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,171 | test_lib_authcache.py | privacyidea_privacyidea/tests/test_lib_authcache.py | """
This test file tests the lib.auth_cache.py
The lib.auth_cache.py only depends on the database model.
"""
from .base import MyTestCase
from privacyidea.lib.authcache import (add_to_cache, delete_from_cache,
update_cache, verify_in_cache,
... | 7,760 | Python | .py | 146 | 41.349315 | 97 | 0.626369 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,172 | test_lib_policy.py | privacyidea_privacyidea/tests/test_lib_policy.py | """
This test file tests the lib.policy.py
The lib.policy.py only depends on the database model.
"""
import dateutil
import mock
from privacyidea.models import PolicyDescription
from .base import MyTestCase, FakeFlaskG, FakeAudit
from privacyidea.lib.auth import ROLE
from privacyidea.lib.policy import (set_policy, d... | 76,594 | Python | .py | 1,468 | 39.942098 | 116 | 0.582048 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,173 | test_lib_tokens_registration.py | privacyidea_privacyidea/tests/test_lib_tokens_registration.py | """
This test file tests the lib.tokens.passwordtoken
This depends on lib.tokenclass
"""
from .base import MyTestCase
from privacyidea.lib.tokens.registrationtoken import RegistrationTokenClass
from privacyidea.lib.token import init_token
from privacyidea.models import Token
from privacyidea.lib.tokens.registrationtok... | 2,963 | Python | .py | 59 | 41.711864 | 77 | 0.672444 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,174 | test_api_lib_utils.py | privacyidea_privacyidea/tests/test_api_lib_utils.py | """
This tests the file api.lib.utils
"""
from .base import MyApiTestCase
from privacyidea.api.lib.utils import (getParam,
check_policy_name,
verify_auth_token, is_fqdn, attestation_certificate_allowed,
... | 19,087 | Python | .py | 329 | 38.130699 | 116 | 0.504729 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,175 | test_lib_counter.py | privacyidea_privacyidea/tests/test_lib_counter.py | """
This tests the files
lib/counter.py
"""
import mock
from contextlib import contextmanager
from .base import MyTestCase
from privacyidea.lib.counter import increase, decrease, reset, read
from privacyidea.models import EventCounter
def increase_and_read(name):
""" helper function that increases the event co... | 5,817 | Python | .py | 118 | 40.652542 | 113 | 0.6546 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,176 | test_lib_user.py | privacyidea_privacyidea/tests/test_lib_user.py | """
This test file tests the lib.user
The lib.user.py only depends on the database model
"""
import logging
from testfixtures import log_capture, LogCapture
from .base import MyTestCase
from privacyidea.lib.resolver import (save_resolver, delete_resolver)
from privacyidea.lib.config import set_privacyidea_config
fro... | 28,768 | Python | .py | 597 | 33.571189 | 114 | 0.530642 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,177 | test_api_offline_no_token.py | privacyidea_privacyidea/tests/test_api_offline_no_token.py | from .base import MyApiTestCase
from privacyidea.lib.user import (User)
from privacyidea.lib.token import init_token
from privacyidea.lib.policy import SCOPE, ACTION, set_policy
from privacyidea.lib.machine import attach_token
class OfflinePassNoTokenTestCase(MyApiTestCase):
"""
Ensure that an user with no to... | 5,123 | Python | .py | 98 | 35.091837 | 88 | 0.517839 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,178 | ldap3mock.py | privacyidea_privacyidea/tests/ldap3mock.py | """
2020-09-07 Cornelius Kölbel <cornelius.koelbel@netknights.it>
Add exception
2017-04-26 Friedrich Weber <friedrich.weber@netknights.it>
Make it possible to check for correct LDAPS/STARTTLS settings
2017-01-08 Cornelius Kölbel <cornelius.koelbel@netknights.it>
Remove objectGUID. Since... | 28,940 | Python | .py | 662 | 28.534743 | 98 | 0.512155 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,179 | test_lib_tokens_paper.py | privacyidea_privacyidea/tests/test_lib_tokens_paper.py | """
This test file tests the lib.tokens.papertoken
This depends on lib.tokenclass
"""
import logging
from testfixtures import LogCapture
from .base import MyTestCase
from privacyidea.lib.tokens.papertoken import PaperTokenClass
from privacyidea.lib.token import init_token
from privacyidea.models import Token
OTPKEY =... | 3,048 | Python | .py | 69 | 35.434783 | 82 | 0.633727 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,180 | test_lib_audit.py | privacyidea_privacyidea/tests/test_lib_audit.py | """
This tests the files
lib/audit.py and
lib/auditmodules/sqlaudit.py
"""
import datetime
import os
import types
import sqlalchemy.engine
from mock import mock
from privacyidea.config import TestingConfig
from privacyidea.lib.audit import getAudit, search
from privacyidea.lib.auditmodules.containeraudit import A... | 23,017 | Python | .py | 439 | 40.744875 | 116 | 0.603718 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,181 | test_lib_importotp.py | privacyidea_privacyidea/tests/test_lib_importotp.py | """
This test file tests the lib.importotp
"""
import gnupg
import unittest
from .base import MyTestCase
from privacyidea.lib.importotp import (parseOATHcsv, parseYubicoCSV,
parseSafeNetXML,
parsePSKCdata, GPGImport)
from privacyidea.lib.er... | 29,740 | Python | .py | 706 | 33.011331 | 135 | 0.638657 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,182 | test_api_machines.py | privacyidea_privacyidea/tests/test_api_machines.py | """
This testcase is used to test the REST API in api/machines.py
to fetch machine information and to attach token to machines
"""
import passlib
from privacyidea.lib.user import User
from .base import MyApiTestCase
from privacyidea.lib.token import init_token, get_tokens, remove_token
from privacyidea.lib.machine im... | 38,793 | Python | .py | 684 | 39.830409 | 118 | 0.543838 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,183 | test_lib_tokens_daypassword.py | privacyidea_privacyidea/tests/test_lib_tokens_daypassword.py | """
This test file tests the lib.tokens.daypasswordtoken.py
"""
import binascii
import logging
import time
from testfixtures import LogCapture
from unittest import mock
from .base import MyTestCase, FakeAudit, FakeFlaskG
from privacyidea.lib.resolver import (save_resolver)
from privacyidea.lib.realm import (set_realm)
... | 28,338 | Python | .py | 595 | 36.359664 | 102 | 0.600615 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,184 | test_lib_lifecycle.py | privacyidea_privacyidea/tests/test_lib_lifecycle.py | """
This file contains the tests for the lifecycle module lib/lifecycle.py
"""
from mock import mock
from privacyidea.lib.lifecycle import register_finalizer, call_finalizers
from .base import MyTestCase
class LifecycleTestCase(MyTestCase):
# Create admin authentication token for each testcase
def setUp(self... | 2,834 | Python | .py | 64 | 32.28125 | 79 | 0.603835 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,185 | test_lib_tokens_passwordtoken.py | privacyidea_privacyidea/tests/test_lib_tokens_passwordtoken.py | """
This test file tests the lib.tokens.passwordtoken
This depends on lib.tokenclass
"""
from .base import MyTestCase
from privacyidea.lib.tokens.passwordtoken import PasswordTokenClass
from privacyidea.models import Token
class PasswordTokenTestCase(MyTestCase):
"""
Test the token on the database level
... | 1,868 | Python | .py | 43 | 36.395349 | 77 | 0.664456 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,186 | smtpmock.py | privacyidea_privacyidea/tests/smtpmock.py | """
2016-01-20 Cornelius Kölbel <cornelius@privacyidea.org>
Support STARTTLS mock
2015-01-30 Cornelius Kölbel <cornelius@privacyidea.org>
Change responses.py to be able to run with SMTP
Original responses.py is:
Copyright 2013 Dropbox, Inc.
Licensed under the Apache License, Version 2.0 (the "... | 7,527 | Python | .py | 186 | 31.580645 | 79 | 0.611698 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,187 | test_lib_tokens_sms.py | privacyidea_privacyidea/tests/test_lib_tokens_sms.py | """
This test file tests the lib.tokens.smstoken
"""
import logging
from .base import MyTestCase, FakeFlaskG, FakeAudit
from privacyidea.lib.resolver import (save_resolver)
from privacyidea.lib.realm import (set_realm)
from privacyidea.lib.user import (User)
from privacyidea.lib.utils import is_true
from privacyidea.l... | 20,890 | Python | .py | 441 | 36.471655 | 111 | 0.607989 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,188 | test_api_periodictask.py | privacyidea_privacyidea/tests/test_api_periodictask.py | """
This file contains the tests for the periodic tasks API.
This tests api/periodictask.py
"""
import jwt
from contextlib import contextmanager
import mock
from dateutil.parser import parse as parse_timestamp
from privacyidea.lib.periodictask import TASK_MODULES
from privacyidea.models import NodeName, db
from tests... | 13,373 | Python | .py | 270 | 37.496296 | 110 | 0.563012 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,189 | test_api_lib_policy.py | privacyidea_privacyidea/tests/test_api_lib_policy.py | """
This test file tests the api.lib.policy.py
The api.lib.policy.py depends on lib.policy and on flask!
"""
import json
import logging
from testfixtures import log_capture
from privacyidea.lib.tokens.webauthn import (webauthn_b64_decode, AUTHENTICATOR_ATTACHMENT_TYPE,
ATTE... | 196,695 | Python | .py | 4,182 | 33.159971 | 165 | 0.548139 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,190 | test_api_applications.py | privacyidea_privacyidea/tests/test_api_applications.py | """
This test case test the REST API
api/applications.py
"""
import json
from .base import MyApiTestCase
class APIApplicationsResolverTestCase(MyApiTestCase):
def test_get_applications(self):
with self.app.test_request_context('/application/',
method='GET',
... | 1,497 | Python | .py | 30 | 37.9 | 96 | 0.601504 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,191 | test_lib_privacyideaserver.py | privacyidea_privacyidea/tests/test_lib_privacyideaserver.py | """
This test file tests the lib/privacyideaserver.py
"""
from .base import MyTestCase
from privacyidea.lib.error import ConfigAdminError
from privacyidea.lib.privacyideaserver import (add_privacyideaserver,
delete_privacyideaserver,
... | 13,699 | Python | .py | 227 | 44.933921 | 648 | 0.63777 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,192 | test_api_auth.py | privacyidea_privacyidea/tests/test_api_auth.py | """ Test for the '/auth' API-endpoint """
import logging
from testfixtures import log_capture
from .base import MyApiTestCase, OverrideConfigTestCase
import mock
from privacyidea.lib.config import set_privacyidea_config, SYSCONF
from privacyidea.lib.policy import (set_policy, SCOPE, ACTION, REMOTE_USER,
... | 48,692 | Python | .py | 815 | 40.110429 | 102 | 0.516079 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,193 | test_lib_tokens_hotp.py | privacyidea_privacyidea/tests/test_lib_tokens_hotp.py | """
This test file tests the lib.tokenclass
The lib.tokenclass depends on the DB model and lib.user
"""
import warnings
from testfixtures import log_capture
from .base import MyTestCase, FakeFlaskG, FakeAudit
from privacyidea.lib.error import ParameterError
from privacyidea.lib.resolver import (save_resolver)
from pri... | 35,411 | Python | .py | 771 | 35.204929 | 106 | 0.594241 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,194 | test_lib_radiusserver.py | privacyidea_privacyidea/tests/test_lib_radiusserver.py | """
This test file tests the lib/radiusserver.py
"""
from .base import MyTestCase
from privacyidea.lib.error import ConfigAdminError, privacyIDEAError
from privacyidea.lib.radiusserver import (add_radius, delete_radius,
get_radiusservers, get_radius,
... | 4,677 | Python | .py | 95 | 38.010526 | 74 | 0.622178 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,195 | test_api_events.py | privacyidea_privacyidea/tests/test_api_events.py | from privacyidea.lib.container import init_container, add_token_to_container
from privacyidea.lib.event import set_event, delete_event
from privacyidea.lib.eventhandler.containerhandler import ContainerEventHandler
from privacyidea.lib.eventhandler.customuserattributeshandler import ACTION_TYPE, USER_TYPE
from privacyi... | 41,931 | Python | .py | 762 | 35.845144 | 104 | 0.498004 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,196 | test_lib_tokens_u2f.py | privacyidea_privacyidea/tests/test_lib_tokens_u2f.py | """
This test file tests the lib.tokens.u2ftoken
This depends on lib.tokenclass
"""
from .base import MyTestCase
from privacyidea.lib.tokens.u2ftoken import U2fTokenClass
from privacyidea.lib.tokens.u2f import (check_registration_data,
parse_registration_data, url_decode,
... | 22,606 | Python | .py | 326 | 55.196319 | 1,069 | 0.701097 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,197 | test_lib_machine_resolver_ldap.py | privacyidea_privacyidea/tests/test_lib_machine_resolver_ldap.py | """
This test file tests the LDAP machine resolver in
lib/machines/ldap.py
"""
HOSTSFILE = "tests/testdata/hosts"
from .base import MyTestCase
from privacyidea.lib.machines.ldap import LdapMachineResolver
from privacyidea.lib.machines.base import MachineResolverError
from . import ldap3mock
import netaddr
LDAPDirecto... | 7,182 | Python | .py | 146 | 35.308219 | 104 | 0.562259 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,198 | test_lib_applications.py | privacyidea_privacyidea/tests/test_lib_applications.py | """
This test file tests the applications definitions standalone
lib/applications/*
"""
from privacyidea.lib.error import ParameterError
from .base import MyTestCase
from privacyidea.lib.applications import MachineApplicationBase
from privacyidea.lib.applications.ssh import (MachineApplication as
... | 9,860 | Python | .py | 188 | 41.037234 | 113 | 0.636967 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |
39,199 | test_lib_queue.py | privacyidea_privacyidea/tests/test_lib_queue.py | """
This file contains the tests for the job queue modules.
In particular, this tests
lib/queue/*.py
"""
from huey import RedisHuey
import mock
from privacyidea.app import create_app
from privacyidea.config import TestingConfig
from privacyidea.lib.error import ServerError
from privacyidea.lib.queue import job, JOB_C... | 3,624 | Python | .py | 80 | 38.05 | 106 | 0.668276 | privacyidea/privacyidea | 1,470 | 314 | 197 | AGPL-3.0 | 9/5/2024, 5:15:38 PM (Europe/Amsterdam) |