earthaccess-auth 0.1.0b2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. earthaccess_auth-0.1.0b2/.codespellignore +2 -0
  2. earthaccess_auth-0.1.0b2/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
  3. earthaccess_auth-0.1.0b2/.github/ISSUE_TEMPLATE/feature_request.md +18 -0
  4. earthaccess_auth-0.1.0b2/.github/dependabot.yml +25 -0
  5. earthaccess_auth-0.1.0b2/.github/pull_request_template.md +9 -0
  6. earthaccess_auth-0.1.0b2/.github/workflows/docs.yml +55 -0
  7. earthaccess_auth-0.1.0b2/.github/workflows/publish.yml +39 -0
  8. earthaccess_auth-0.1.0b2/.github/workflows/scorecard.yml +41 -0
  9. earthaccess_auth-0.1.0b2/.github/workflows/sync-bucket-registry.yml +80 -0
  10. earthaccess_auth-0.1.0b2/.github/workflows/test.yml +118 -0
  11. earthaccess_auth-0.1.0b2/.github/workflows/zizmor.yml +28 -0
  12. earthaccess_auth-0.1.0b2/.gitignore +22 -0
  13. earthaccess_auth-0.1.0b2/.pre-commit-config.yaml +69 -0
  14. earthaccess_auth-0.1.0b2/.readthedocs.yaml +19 -0
  15. earthaccess_auth-0.1.0b2/.yamlfmt.yml +3 -0
  16. earthaccess_auth-0.1.0b2/CHANGELOG.md +37 -0
  17. earthaccess_auth-0.1.0b2/CITATION.cff +19 -0
  18. earthaccess_auth-0.1.0b2/CODE_OF_CONDUCT.md +73 -0
  19. earthaccess_auth-0.1.0b2/CONTRIBUTING.md +65 -0
  20. earthaccess_auth-0.1.0b2/LICENSE +22 -0
  21. earthaccess_auth-0.1.0b2/PKG-INFO +58 -0
  22. earthaccess_auth-0.1.0b2/README.md +30 -0
  23. earthaccess_auth-0.1.0b2/RELEASING.md +41 -0
  24. earthaccess_auth-0.1.0b2/SECURITY.md +29 -0
  25. earthaccess_auth-0.1.0b2/docs/explanation/choosing-a-backend.md +26 -0
  26. earthaccess_auth-0.1.0b2/docs/explanation/cmr-s3-buckets.md +117 -0
  27. earthaccess_auth-0.1.0b2/docs/howto/list-bucket-contents.md +41 -0
  28. earthaccess_auth-0.1.0b2/docs/howto/magic-bytes.md +30 -0
  29. earthaccess_auth-0.1.0b2/docs/howto/read-a-dataset.md +77 -0
  30. earthaccess_auth-0.1.0b2/docs/howto/s3-credentials-and-bearer-token.md +63 -0
  31. earthaccess_auth-0.1.0b2/docs/index.md +44 -0
  32. earthaccess_auth-0.1.0b2/docs/reference/api.md +87 -0
  33. earthaccess_auth-0.1.0b2/examples/bearer_token.py +15 -0
  34. earthaccess_auth-0.1.0b2/examples/http_headers.py +16 -0
  35. earthaccess_auth-0.1.0b2/examples/list_bucket_contents_obstore.py +32 -0
  36. earthaccess_auth-0.1.0b2/examples/list_bucket_contents_s3fs.py +33 -0
  37. earthaccess_auth-0.1.0b2/examples/magic_bytes.py +41 -0
  38. earthaccess_auth-0.1.0b2/examples/read_a_dataset_fsspec.py +27 -0
  39. earthaccess_auth-0.1.0b2/examples/read_a_dataset_obspec_utils.py +36 -0
  40. earthaccess_auth-0.1.0b2/examples/read_a_dataset_obstore.py +38 -0
  41. earthaccess_auth-0.1.0b2/examples/read_a_dataset_s3fs.py +35 -0
  42. earthaccess_auth-0.1.0b2/examples/s3_credential_provider.py +21 -0
  43. earthaccess_auth-0.1.0b2/examples/s3_credentials.py +16 -0
  44. earthaccess_auth-0.1.0b2/mkdocs.yml +81 -0
  45. earthaccess_auth-0.1.0b2/pyproject.toml +139 -0
  46. earthaccess_auth-0.1.0b2/scripts/bucket_registry.latest.json +257 -0
  47. earthaccess_auth-0.1.0b2/scripts/sync_bucket_registry.py +309 -0
  48. earthaccess_auth-0.1.0b2/scripts/yamlfmt.py +26 -0
  49. earthaccess_auth-0.1.0b2/src/earthaccess_auth/__init__.py +89 -0
  50. earthaccess_auth-0.1.0b2/src/earthaccess_auth/adapters/__init__.py +7 -0
  51. earthaccess_auth-0.1.0b2/src/earthaccess_auth/adapters/fsspec.py +33 -0
  52. earthaccess_auth-0.1.0b2/src/earthaccess_auth/adapters/obstore.py +81 -0
  53. earthaccess_auth-0.1.0b2/src/earthaccess_auth/auth.py +432 -0
  54. earthaccess_auth-0.1.0b2/src/earthaccess_auth/daac.py +280 -0
  55. earthaccess_auth-0.1.0b2/src/earthaccess_auth/exceptions.py +38 -0
  56. earthaccess_auth-0.1.0b2/src/earthaccess_auth/py.typed +0 -0
  57. earthaccess_auth-0.1.0b2/src/earthaccess_auth/system.py +36 -0
  58. earthaccess_auth-0.1.0b2/tests/test_adapter_fsspec.py +26 -0
  59. earthaccess_auth-0.1.0b2/tests/test_adapter_obstore.py +86 -0
  60. earthaccess_auth-0.1.0b2/tests/test_auth.py +177 -0
  61. earthaccess_auth-0.1.0b2/tests/test_daac.py +47 -0
  62. earthaccess_auth-0.1.0b2/tests/test_import_guard.py +26 -0
  63. earthaccess_auth-0.1.0b2/tests/test_login.py +90 -0
  64. earthaccess_auth-0.1.0b2/tests/test_sync_bucket_registry.py +196 -0
  65. earthaccess_auth-0.1.0b2/tests/test_system.py +11 -0
  66. earthaccess_auth-0.1.0b2/tests/test_version.py +9 -0
  67. earthaccess_auth-0.1.0b2/uv.lock +1620 -0
@@ -0,0 +1,2 @@
1
+ ges
2
+ cach
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Bug report
3
+ about: Something in earthaccess-auth doesn't work as documented
4
+ labels: bug
5
+ ---
6
+
7
+ ## What happened
8
+
9
+ <!-- What did you do, what did you expect, and what happened instead? -->
10
+
11
+ ## Reproduction
12
+
13
+ ```python
14
+ # Minimal code to reproduce. Please REDACT credentials, tokens, and
15
+ # anything from your .netrc — never paste an EARTHDATA_TOKEN value.
16
+ ```
17
+
18
+ ## Environment
19
+
20
+ - `earthaccess-auth` version:
21
+ - Python version:
22
+ - Operating system:
23
+ - Installed extras (`fsspec`/`obstore`), if any:
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an improvement to earthaccess-auth
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## The problem
8
+
9
+ <!-- What are you trying to do that the package doesn't support today? -->
10
+
11
+ ## Proposed solution
12
+
13
+ <!-- What would the API or behavior look like? -->
14
+
15
+ ## Alternatives considered
16
+
17
+ <!-- Note: features beyond EDL auth (search, download) belong in
18
+ https://github.com/earthaccess-dev/earthaccess instead. -->
@@ -0,0 +1,25 @@
1
+ # Please see the documentation for all configuration options:
2
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
3
+
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: "uv"
7
+ directory: "/"
8
+ schedule:
9
+ interval: "monthly"
10
+ groups:
11
+ uv-dependencies:
12
+ patterns:
13
+ - "*"
14
+ cooldown:
15
+ default-days: 14
16
+ - package-ecosystem: "github-actions"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "monthly"
20
+ groups:
21
+ gha-dependencies:
22
+ patterns:
23
+ - "*"
24
+ cooldown:
25
+ default-days: 14
@@ -0,0 +1,9 @@
1
+ <!-- Thanks for contributing! Please see CONTRIBUTING.md. -->
2
+
3
+ ## What this PR does
4
+
5
+ ## Checklist
6
+
7
+ - [ ] Tests added or updated
8
+ - [ ] `CHANGELOG.md` entry added (for user-visible changes)
9
+ - [ ] `uv run pytest`, `uv run mypy`, and `uvx prek run -a` pass locally
@@ -0,0 +1,55 @@
1
+ # Docs are built and hosted by Read the Docs (including pull request
2
+ # previews); this job is only the strict-build gate for CI.
3
+ name: Docs
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - main
9
+ paths:
10
+ - "docs/**"
11
+ - "src/**"
12
+ - "examples/**"
13
+ - "mkdocs.yml"
14
+ - "pyproject.toml"
15
+ - ".github/workflows/docs.yml"
16
+ pull_request:
17
+ types: [opened, synchronize, reopened]
18
+ paths:
19
+ - "docs/**"
20
+ - "src/**"
21
+ - "examples/**"
22
+ - "mkdocs.yml"
23
+ - "pyproject.toml"
24
+ - ".github/workflows/docs.yml"
25
+ workflow_dispatch:
26
+
27
+ concurrency:
28
+ group: docs-${{ github.ref }}
29
+ cancel-in-progress: true
30
+
31
+ permissions:
32
+ contents: read
33
+
34
+ jobs:
35
+ test:
36
+ name: Test docs build
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - name: Checkout sources
40
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41
+ with:
42
+ persist-credentials: false
43
+
44
+ - name: Install uv
45
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
46
+ with:
47
+ enable-cache: true
48
+ cache-suffix: docs
49
+
50
+ - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
51
+ with:
52
+ python-version: "3.12"
53
+
54
+ - name: Build docs (strict)
55
+ run: uv run --locked --group docs mkdocs build --strict
@@ -0,0 +1,39 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build:
12
+ name: Build package
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16
+ with:
17
+ persist-credentials: false
18
+ # hatch-vcs derives the version from the tag, so the full history
19
+ # and tags must be present.
20
+ fetch-depth: 0
21
+
22
+ - uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1
23
+
24
+ publish:
25
+ name: Publish to PyPI
26
+ needs: ["build"]
27
+ runs-on: ubuntu-latest
28
+ environment:
29
+ name: pypi
30
+ url: https://pypi.org/p/earthaccess-auth
31
+ permissions:
32
+ id-token: write
33
+ steps:
34
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
35
+ with:
36
+ name: Packages
37
+ path: dist
38
+
39
+ - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
@@ -0,0 +1,41 @@
1
+ name: OpenSSF Scorecard
2
+
3
+ on:
4
+ branch_protection_rule:
5
+ schedule:
6
+ # Tuesdays at 07:20 UTC.
7
+ - cron: "20 7 * * 2"
8
+ push:
9
+ branches:
10
+ - main
11
+
12
+ permissions: read-all
13
+
14
+ jobs:
15
+ analysis:
16
+ name: Scorecard analysis
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ # Needed to upload the results to the code-scanning dashboard and to
20
+ # publish them to the OpenSSF REST API.
21
+ security-events: write
22
+ id-token: write
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26
+ with:
27
+ persist-credentials: false
28
+
29
+ - name: Run analysis
30
+ uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
31
+ with:
32
+ results_file: results.sarif
33
+ results_format: sarif
34
+ publish_results: true
35
+
36
+ - name: Upload artifact
37
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
38
+ with:
39
+ name: SARIF file
40
+ path: results.sarif
41
+ retention-days: 5
@@ -0,0 +1,80 @@
1
+ name: Sync S3 bucket registry from CMR
2
+
3
+ on:
4
+ schedule:
5
+ # Mondays at 06:00 UTC.
6
+ - cron: "0 6 * * 1"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ sync:
14
+ name: Sweep CMR and diff against the vendored bucket registry
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: write # only the sync branch, via create-pull-request below
18
+ pull-requests: write
19
+ steps:
20
+ - name: Checkout sources
21
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ with:
23
+ persist-credentials: false
24
+
25
+ - name: Install uv
26
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
27
+ with:
28
+ enable-cache: true
29
+ cache-suffix: sync-bucket-registry
30
+
31
+ - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
32
+ with:
33
+ python-version: "3.12"
34
+
35
+ - name: Install package
36
+ run: uv sync --locked --no-default-groups
37
+
38
+ - name: Sweep CMR for the current bucket -> endpoint mapping
39
+ run: |
40
+ uv run --no-sync python scripts/sync_bucket_registry.py \
41
+ --output scripts/bucket_registry.latest.json
42
+
43
+ - name: Diff against the vendored BUCKET_ENDPOINTS (for the PR body)
44
+ id: diff
45
+ run: |
46
+ uv run --no-sync python scripts/sync_bucket_registry.py \
47
+ --check > drift.txt || true
48
+ {
49
+ echo "summary<<EOF"
50
+ cat drift.txt
51
+ echo "EOF"
52
+ } >> "$GITHUB_OUTPUT"
53
+
54
+ # bucket_registry.latest.json only changes when the live CMR sweep's
55
+ # output differs from what's committed, so this naturally no-ops (no
56
+ # PR opened) when there's no drift.
57
+ - name: Open a PR if the sweep changed
58
+ uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
59
+ with:
60
+ commit-message: "chore: update CMR bucket registry snapshot"
61
+ title: "chore: CMR bucket registry drift detected"
62
+ body: |
63
+ The weekly CMR sweep (`scripts/sync_bucket_registry.py`) found a
64
+ different bucket -> `s3credentials` endpoint mapping than what's
65
+ committed in `scripts/bucket_registry.latest.json`.
66
+
67
+ Diff against the vendored `BUCKET_ENDPOINTS` in
68
+ `src/earthaccess_auth/daac.py`:
69
+
70
+ ```
71
+ ${{ steps.diff.outputs.summary }}
72
+ ```
73
+
74
+ If this reflects a real, intentional CMR change (new mission, new
75
+ DAAC, endpoint migration), update `BUCKET_ENDPOINTS` in `daac.py` by
76
+ hand to match before merging — see
77
+ `docs/explanation/cmr-s3-buckets.md`.
78
+ branch: sync/bucket-registry
79
+ delete-branch: true
80
+ add-paths: scripts/bucket_registry.latest.json
@@ -0,0 +1,118 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ types: [opened, synchronize, reopened]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ lint:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout sources
18
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
+ with:
20
+ persist-credentials: false
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
24
+ with:
25
+ enable-cache: true
26
+ cache-suffix: lint
27
+
28
+ - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
29
+ with:
30
+ python-version: "3.12"
31
+
32
+ - name: Run pre-commit hooks via prek
33
+ env:
34
+ # Guards interactive commits, not CI checkouts of main itself.
35
+ SKIP: no-commit-to-branch
36
+ run: uvx prek@0.4.13 run --all-files --show-diff-on-failure
37
+
38
+ typecheck:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - name: Checkout sources
42
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43
+ with:
44
+ persist-credentials: false
45
+
46
+ - name: Install uv
47
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
48
+ with:
49
+ enable-cache: true
50
+ cache-suffix: typecheck
51
+
52
+ - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
53
+ with:
54
+ python-version: "3.12"
55
+
56
+ - name: Typecheck
57
+ run: uv run --locked --group typecheck mypy
58
+
59
+ core-tests:
60
+ runs-on: ubuntu-latest
61
+ strategy:
62
+ matrix:
63
+ python-version: ["3.12", "3.13"]
64
+ fail-fast: false
65
+
66
+ steps:
67
+ - name: Checkout sources
68
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
69
+ with:
70
+ persist-credentials: false
71
+
72
+ - name: Install uv
73
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
74
+ with:
75
+ enable-cache: true
76
+ cache-suffix: core-${{ matrix.python-version }}
77
+
78
+ - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
79
+ with:
80
+ python-version: ${{ matrix.python-version }}
81
+
82
+ # No extras on purpose: this env must contain only the auth core's
83
+ # runtime deps plus the test runner, to prove nothing heavy leaks in.
84
+ # Adapter tests self-skip via importorskip.
85
+ - name: Install auth core with minimal dependencies
86
+ run: uv sync --locked --no-default-groups --group test
87
+
88
+ - name: Test
89
+ run: uv run --no-sync pytest --verbose --color=yes --tb=native --cov=earthaccess_auth --cov-report=term-missing
90
+
91
+ extras-tests:
92
+ runs-on: ubuntu-latest
93
+ strategy:
94
+ matrix:
95
+ python-version: ["3.12", "3.13"]
96
+ fail-fast: false
97
+
98
+ steps:
99
+ - name: Checkout sources
100
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
101
+ with:
102
+ persist-credentials: false
103
+
104
+ - name: Install uv
105
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
106
+ with:
107
+ enable-cache: true
108
+ cache-suffix: extras-${{ matrix.python-version }}
109
+
110
+ - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
111
+ with:
112
+ python-version: ${{ matrix.python-version }}
113
+
114
+ - name: Install auth core with adapter extras
115
+ run: uv sync --locked --no-default-groups --group test --extra fsspec --extra obstore
116
+
117
+ - name: Test
118
+ run: uv run --no-sync pytest --verbose --color=yes --tb=native --cov=earthaccess_auth --cov-report=term-missing
@@ -0,0 +1,28 @@
1
+ name: "GitHub Actions Security Analysis with zizmor 🌈"
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "main"
7
+ paths:
8
+ - ".github/workflows/*"
9
+ pull_request:
10
+ paths:
11
+ - ".github/workflows/*"
12
+
13
+ permissions: {}
14
+
15
+ jobs:
16
+ zizmor:
17
+ name: "Run zizmor 🌈"
18
+ runs-on: "ubuntu-latest"
19
+ permissions:
20
+ security-events: "write" # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
21
+ steps:
22
+ - name: "Checkout repository"
23
+ uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1
24
+ with:
25
+ persist-credentials: false
26
+
27
+ - name: "Run zizmor 🌈"
28
+ uses: "zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054" # v0.6.2
@@ -0,0 +1,22 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ build/
5
+ dist/
6
+ site/
7
+ .venv/
8
+ venv/
9
+ .env
10
+ .python-version
11
+ .mypy_cache/
12
+ .pytest_cache/
13
+ .ruff_cache/
14
+ .nox/
15
+ .coverage
16
+ .coverage.*
17
+ coverage.xml
18
+ htmlcov/
19
+ src/earthaccess_auth/_version.py
20
+ .DS_Store
21
+ .idea/
22
+ .vscode/
@@ -0,0 +1,69 @@
1
+ ci:
2
+ autoupdate_schedule: "quarterly"
3
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
4
+ autofix_prs: false # Comment "pre-commit.ci autofix" on a PR to trigger
5
+
6
+ repos:
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v6.0.0
9
+ hooks:
10
+ # Validate format
11
+ - id: check-yaml
12
+ - id: check-toml
13
+ - id: check-json
14
+ # Check for common mistakes
15
+ - id: check-added-large-files
16
+ - id: check-case-conflict
17
+ - id: check-merge-conflict
18
+ - id: check-executables-have-shebangs
19
+ - id: check-shebang-scripts-are-executable
20
+ - id: check-symlinks
21
+ - id: check-vcs-permalinks
22
+ - id: destroyed-symlinks
23
+ - id: detect-private-key
24
+ - id: end-of-file-fixer
25
+ - id: mixed-line-ending
26
+ - id: no-commit-to-branch # protects `main` by default
27
+ - id: trailing-whitespace
28
+
29
+ - repo: https://github.com/astral-sh/ruff-pre-commit
30
+ rev: v0.16.2
31
+ hooks:
32
+ - id: ruff
33
+ args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
34
+ - id: ruff-format
35
+
36
+ - repo: https://github.com/astral-sh/uv-pre-commit
37
+ rev: "0.11.26"
38
+ hooks:
39
+ # Asserts that the lockfile is valid for pyproject.toml.
40
+ # If it fails, update the lockfile by running:
41
+ #
42
+ # prek run -a --hook-stage manual uv-lock
43
+ #
44
+ # Or, if you have `uv` installed, run `uv lock`.
45
+ - id: uv-lock
46
+ args: ["--locked", "--offline"]
47
+ - id: uv-lock
48
+ stages: ["manual"]
49
+
50
+ - repo: https://github.com/google/yamlfmt
51
+ rev: v0.21.0
52
+ hooks:
53
+ - id: yamlfmt
54
+ entry: python scripts/yamlfmt.py
55
+ types_or: [yaml]
56
+
57
+ - repo: https://github.com/citation-file-format/cffconvert
58
+ rev: "054bda51dbe278b3e86f27c890e3f3ac877d616c"
59
+ hooks:
60
+ - id: "validate-cff"
61
+ args:
62
+ - "--verbose"
63
+
64
+ - repo: https://github.com/codespell-project/codespell
65
+ rev: "v2.4.2"
66
+ hooks:
67
+ - id: "codespell"
68
+ exclude: ".codespellignore|tests/.*"
69
+ additional_dependencies: ["tomli"]
@@ -0,0 +1,19 @@
1
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
2
+ version: 2
3
+
4
+ build:
5
+ os: ubuntu-22.04
6
+ tools:
7
+ python: "3.12"
8
+ jobs:
9
+ pre_create_environment:
10
+ - asdf plugin add uv
11
+ - asdf install uv latest
12
+ - asdf global uv latest
13
+ create_environment:
14
+ - uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
15
+ install:
16
+ - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
17
+
18
+ mkdocs:
19
+ configuration: mkdocs.yml
@@ -0,0 +1,3 @@
1
+ formatter:
2
+ retain_line_breaks_single: true
3
+ scan_folded_as_literal: true
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Common Changelog](https://common-changelog.org/)
6
+ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+ `earthaccess-auth` was extracted from
8
+ [earthaccess](https://github.com/earthaccess-dev/earthaccess) — see its
9
+ changelog for history predating the extraction.
10
+
11
+ ## [Unreleased]
12
+
13
+ ### Added
14
+
15
+ - Initial release. Extracted from `earthaccess`: EDL login (`login`, `Auth`),
16
+ the DAAC registry, systems (`PROD`/`UAT`), and the two login exceptions.
17
+ Optional `fsspec` and `obstore` extras add an authenticated HTTPS session
18
+ and an S3 credential provider, respectively.
19
+ ([#1423](https://github.com/earthaccess-dev/earthaccess/pull/1423))
20
+
21
+ ### Changed
22
+
23
+ Behavior differences from the implementation extracted out of `earthaccess`:
24
+
25
+ - `Auth.login` raises `ValueError` for unknown strategy names instead of
26
+ silently returning an unauthenticated instance.
27
+ - `Auth.login` on an already-authenticated instance is now a no-op unless a
28
+ different `system` is requested.
29
+ - `Auth.get_s3_credentials` raises instead of returning an empty dict:
30
+ `ValueError` when unauthenticated, and the new
31
+ `S3CredentialsRequestFailure` when the `s3credentials` endpoint rejects
32
+ the request (e.g. unaccepted EULA).
33
+ - `find_provider_by_shortname` applies a 15-second timeout to its CMR
34
+ request instead of potentially hanging forever.
35
+ - Python 3.12 or newer is required.
36
+
37
+ [Unreleased]: https://github.com/earthaccess-dev/earthaccess-auth/commits/main/
@@ -0,0 +1,19 @@
1
+ cff-version: 1.2.0
2
+ message: "Please cite this software using these metadata."
3
+
4
+ title: "earthaccess-auth"
5
+ abstract: "NASA Earthdata Login (EDL) authentication core, extracted from earthaccess"
6
+ type: "software"
7
+ license: "MIT"
8
+ repository-code: "https://github.com/earthaccess-dev/earthaccess-auth"
9
+ url: "https://earthaccess-auth.readthedocs.io/"
10
+ contact:
11
+ - name: "The earthaccess community"
12
+ website: "https://github.com/earthaccess-dev/earthaccess/discussions"
13
+ authors:
14
+ - name: "The earthaccess community"
15
+ keywords:
16
+ - "authentication"
17
+ - "NASA"
18
+ - "Earthdata"
19
+ - "EDL"