Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/uc-cdis/fence into feat/c…
Browse files Browse the repository at this point in the history
…ustom-data-access
  • Loading branch information
BinamB committed Jul 14, 2022
2 parents d99ceca + 619fdd5 commit 2add969
Show file tree
Hide file tree
Showing 17 changed files with 2,013 additions and 1,630 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: git@github.com:Yelp/detect-secrets
rev: v1.1.0
rev: v1.2.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
Expand All @@ -12,7 +16,3 @@ repos:
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [--branch, develop, --branch, master, --pattern, release/.*]
- repo: https://github.com/psf/black
rev: 21.5b2
hooks:
- id: black
82 changes: 43 additions & 39 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.2.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
Expand All @@ -20,9 +20,12 @@
{
"name": "CloudantDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
Expand All @@ -46,6 +49,9 @@
{
"name": "PrivateKeyDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
Expand Down Expand Up @@ -115,8 +121,7 @@
"filename": "deployment/scripts/postgresql/postgresql_init.sql",
"hashed_secret": "afc848c316af1a89d49826c5ae9d00ed769415f3",
"is_verified": false,
"line_number": 7,
"is_secret": false
"line_number": 7
}
],
"fence/blueprints/storage_creds/google.py": [
Expand All @@ -125,8 +130,7 @@
"filename": "fence/blueprints/storage_creds/google.py",
"hashed_secret": "1348b145fa1a555461c1b790a2f66614781091e9",
"is_verified": false,
"line_number": 139,
"is_secret": false
"line_number": 139
}
],
"fence/blueprints/storage_creds/other.py": [
Expand All @@ -135,16 +139,14 @@
"filename": "fence/blueprints/storage_creds/other.py",
"hashed_secret": "98c144f5ecbb4dbe575147a39698b6be1a5649dd",
"is_verified": false,
"line_number": 66,
"is_secret": false
"line_number": 66
},
{
"type": "Secret Keyword",
"filename": "fence/blueprints/storage_creds/other.py",
"hashed_secret": "98c144f5ecbb4dbe575147a39698b6be1a5649dd",
"is_verified": false,
"line_number": 66,
"is_secret": false
"line_number": 66
}
],
"fence/config-default.yaml": [
Expand All @@ -153,8 +155,7 @@
"filename": "fence/config-default.yaml",
"hashed_secret": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
"is_verified": false,
"line_number": 31,
"is_secret": false
"line_number": 31
}
],
"fence/local_settings.example.py": [
Expand All @@ -163,16 +164,14 @@
"filename": "fence/local_settings.example.py",
"hashed_secret": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
"is_verified": false,
"line_number": 6,
"is_secret": false
"line_number": 6
},
{
"type": "Secret Keyword",
"filename": "fence/local_settings.example.py",
"hashed_secret": "5d07e1b80e448a213b392049888111e1779a52db",
"is_verified": false,
"line_number": 63,
"is_secret": false
"line_number": 63
}
],
"fence/resources/google/utils.py": [
Expand All @@ -181,7 +180,7 @@
"filename": "fence/resources/google/utils.py",
"hashed_secret": "1348b145fa1a555461c1b790a2f66614781091e9",
"is_verified": false,
"line_number": 129
"line_number": 132
}
],
"fence/utils.py": [
Expand All @@ -190,8 +189,16 @@
"filename": "fence/utils.py",
"hashed_secret": "8318df9ecda039deac9868adf1944a29a95c7114",
"is_verified": false,
"line_number": 105,
"is_secret": false
"line_number": 105
}
],
"migrations/versions/e4c7b0ab68d3_create_tables.py": [
{
"type": "Hex High Entropy String",
"filename": "migrations/versions/e4c7b0ab68d3_create_tables.py",
"hashed_secret": "adb1fcd33b07abf9b6a064745759accea5cb341f",
"is_verified": false,
"line_number": 22
}
],
"tests/conftest.py": [
Expand All @@ -200,14 +207,14 @@
"filename": "tests/conftest.py",
"hashed_secret": "1348b145fa1a555461c1b790a2f66614781091e9",
"is_verified": false,
"line_number": 1513
"line_number": 1516
},
{
"type": "Base64 High Entropy String",
"filename": "tests/conftest.py",
"hashed_secret": "227dea087477346785aefd575f91dd13ab86c108",
"is_verified": false,
"line_number": 1536
"line_number": 1539
}
],
"tests/credentials/google/test_credentials.py": [
Expand All @@ -216,24 +223,30 @@
"filename": "tests/credentials/google/test_credentials.py",
"hashed_secret": "a06bdb09c0106ab559bd6acab2f1935e19f7e939",
"is_verified": false,
"line_number": 381,
"is_secret": false
"line_number": 381
},
{
"type": "Secret Keyword",
"filename": "tests/credentials/google/test_credentials.py",
"hashed_secret": "93aa43c580f5347782e17fba5091f944767b15f0",
"is_verified": false,
"line_number": 474,
"is_secret": false
"line_number": 474
},
{
"type": "Secret Keyword",
"filename": "tests/credentials/google/test_credentials.py",
"hashed_secret": "768b7fe00de4fd233c0c72375d12f87ce9670144",
"is_verified": false,
"line_number": 476,
"is_secret": false
"line_number": 476
}
],
"tests/data/test_indexed_file.py": [
{
"type": "Secret Keyword",
"filename": "tests/data/test_indexed_file.py",
"hashed_secret": "a62f2225bf70bfaccbc7f1ef2a397836717377de",
"is_verified": false,
"line_number": 410
}
],
"tests/keys/2018-05-01T21:29:02Z/jwt_private_key.pem": [
Expand All @@ -242,8 +255,7 @@
"filename": "tests/keys/2018-05-01T21:29:02Z/jwt_private_key.pem",
"hashed_secret": "1348b145fa1a555461c1b790a2f66614781091e9",
"is_verified": false,
"line_number": 1,
"is_secret": false
"line_number": 1
}
],
"tests/login/test_fence_login.py": [
Expand All @@ -252,8 +264,7 @@
"filename": "tests/login/test_fence_login.py",
"hashed_secret": "d300421e208bfd0d432294de15169fd9b8975def",
"is_verified": false,
"line_number": 48,
"is_secret": false
"line_number": 48
}
],
"tests/ras/test_ras.py": [
Expand All @@ -272,15 +283,8 @@
"hashed_secret": "afc848c316af1a89d49826c5ae9d00ed769415f3",
"is_verified": false,
"line_number": 31
},
{
"type": "Secret Keyword",
"filename": "tests/test-fence-config.yaml",
"hashed_secret": "1627df13b5cd8b3521d02bd8eb2ca31334b3aef2",
"is_verified": false,
"line_number": 491
}
]
},
"generated_at": "2022-06-27T19:35:11Z"
"generated_at": "2022-07-08T21:32:25Z"
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ before_script:
- cd -

script:
- poetry run pytest -vv --cov=fence --cov-report xml tests
- poetry run pytest -vv --cov=fence --cov=migrations/versions --cov-report xml tests

after_script:
- python-codacy-coverage -r coverage.xml
Expand Down
100 changes: 100 additions & 0 deletions alembic.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# A generic, single database configuration.

[alembic]
# path to migration scripts
script_location = migrations

# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
prepend_sys_path = .

# timezone to use when rendering the date within the migration file
# as well as the filename.
# If specified, requires the python-dateutil library that can be
# installed by adding `alembic[tz]` to the pip requirements
# string value is passed to dateutil.tz.gettz()
# leave blank for localtime
# timezone =

# max length of characters to apply to the
# "slug" field
# truncate_slug_length = 40

# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false

# set to 'true' to allow .pyc and .pyo files without
# a source .py file to be detected as revisions in the
# versions/ directory
# sourceless = false

# version location specification; This defaults
# to migrations/versions. When using multiple version
# directories, initial revisions must be specified with --version-path.
# The path separator used here should be the separator specified by "version_path_separator" below.
# version_locations = %(here)s/bar:%(here)s/bat:migrations/versions

# version path separator; As mentioned above, this is the character used to split
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
# Valid values for version_path_separator are:
#
# version_path_separator = :
# version_path_separator = ;
# version_path_separator = space
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.

# the output encoding used when revision files
# are written from script.py.mako
# output_encoding = utf-8


[post_write_hooks]
# post_write_hooks defines scripts or Python functions that are run
# on newly generated revision scripts. See the documentation for further
# detail and examples

# format using "black" - use the console_scripts runner, against the "black" entrypoint
# hooks = black
# black.type = console_scripts
# black.entrypoint = black
# black.options = -l 79 REVISION_SCRIPT_FILENAME

# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = DEBUG
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
2 changes: 1 addition & 1 deletion bin/fence_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def main():
DB, args.emails, args.auth_ids, args.check_linking, args.google_project_id
)
elif args.action == "migrate":
migrate_database(DB)
migrate_database()
elif args.action == "update-visas":
access_token_polling_job(
DB,
Expand Down

0 comments on commit 2add969

Please sign in to comment.