Skip to content

Commit b304bf0

Browse files
Merge pull request #325 from codecov/scott/token-validation
Allow JWT tokens
2 parents 424e8ee + 6cf4f9c commit b304bf0

21 files changed

Lines changed: 25 additions & 58 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Codecov-cli supports user input. These inputs, along with their descriptions and
225225
| :---: | :---: | :---: |
226226
| -C, --sha, --commit-sha TEXT |Commit SHA (with 40 chars) | Required
227227
| -r, --slug TEXT |owner/repo slug used instead of the private repo token in Self-hosted | Required
228-
| -t, --token UUID |Codecov upload token | Required
228+
| -t, --token TEXT |Codecov upload token | Required
229229
| --git-service | Git provider. Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Optional
230230
| -h,--help |Show this message and exit.
231231

codecov_cli/commands/base_picking.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import typing
3-
import uuid
43

54
import click
65

@@ -36,7 +35,6 @@
3635
"-t",
3736
"--token",
3837
help="Codecov upload token",
39-
type=click.UUID,
4038
envvar="CODECOV_TOKEN",
4139
)
4240
@click.option(
@@ -51,7 +49,7 @@ def pr_base_picking(
5149
base_sha: str,
5250
pr: typing.Optional[int],
5351
slug: typing.Optional[str],
54-
token: typing.Optional[uuid.UUID],
52+
token: typing.Optional[str],
5553
service: typing.Optional[str],
5654
):
5755
enterprise_url = ctx.obj.get("enterprise_url")

codecov_cli/commands/commit.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import typing
3-
import uuid
43

54
import click
65

@@ -42,7 +41,7 @@ def create_commit(
4241
pull_request_number: typing.Optional[int],
4342
branch: typing.Optional[str],
4443
slug: typing.Optional[str],
45-
token: typing.Optional[uuid.UUID],
44+
token: typing.Optional[str],
4645
git_service: typing.Optional[str],
4746
fail_on_error: bool,
4847
):

codecov_cli/commands/create_report_result.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import logging
2-
import uuid
32

43
import click
54

6-
from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
7-
from codecov_cli.helpers.git import GitService
85
from codecov_cli.helpers.options import global_options
96
from codecov_cli.services.report import create_report_results_logic
107

@@ -23,7 +20,7 @@ def create_report_results(
2320
code: str,
2421
slug: str,
2522
git_service: str,
26-
token: uuid.UUID,
23+
token: str,
2724
fail_on_error: bool,
2825
):
2926
enterprise_url = ctx.obj.get("enterprise_url")

codecov_cli/commands/empty_upload.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import typing
3-
import uuid
43

54
import click
65

@@ -19,7 +18,7 @@ def empty_upload(
1918
ctx,
2019
commit_sha: str,
2120
slug: typing.Optional[str],
22-
token: typing.Optional[uuid.UUID],
21+
token: typing.Optional[str],
2322
git_service: typing.Optional[str],
2423
fail_on_error: typing.Optional[bool],
2524
):

codecov_cli/commands/get_report_results.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
import uuid
32

43
import click
54

@@ -24,7 +23,7 @@ def get_report_results(
2423
code: str,
2524
slug: str,
2625
git_service: str,
27-
token: uuid.UUID,
26+
token: str,
2827
fail_on_error: bool,
2928
):
3029
enterprise_url = ctx.obj.get("enterprise_url")

codecov_cli/commands/report.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import logging
2-
import uuid
32

43
import click
54

65
from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
7-
from codecov_cli.helpers.git import GitService
86
from codecov_cli.helpers.options import global_options
97
from codecov_cli.services.report import create_report_logic
108

@@ -32,7 +30,7 @@ def create_report(
3230
code: str,
3331
slug: str,
3432
git_service: str,
35-
token: uuid.UUID,
33+
token: str,
3634
fail_on_error: bool,
3735
pull_request_number: int,
3836
):

codecov_cli/commands/send_notifications.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import typing
3-
import uuid
43

54
import click
65

@@ -19,7 +18,7 @@ def send_notifications(
1918
ctx,
2019
commit_sha: str,
2120
slug: typing.Optional[str],
22-
token: typing.Optional[uuid.UUID],
21+
token: typing.Optional[str],
2322
git_service: typing.Optional[str],
2423
fail_on_error: bool,
2524
):

codecov_cli/commands/upload.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import pathlib
44
import typing
5-
import uuid
65

76
import click
87

@@ -185,7 +184,7 @@ def do_upload(
185184
coverage_files_search_explicitly_listed_files: typing.List[pathlib.Path],
186185
disable_search: bool,
187186
disable_file_fixes: bool,
188-
token: typing.Optional[uuid.UUID],
187+
token: typing.Optional[str],
189188
plugin_names: typing.List[str],
190189
branch: typing.Optional[str],
191190
slug: typing.Optional[str],

codecov_cli/commands/upload_process.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import logging
22
import pathlib
33
import typing
4-
import uuid
54

65
import click
76

@@ -38,7 +37,7 @@ def upload_process(
3837
coverage_files_search_explicitly_listed_files: typing.List[pathlib.Path],
3938
disable_search: bool,
4039
disable_file_fixes: bool,
41-
token: typing.Optional[uuid.UUID],
40+
token: typing.Optional[str],
4241
plugin_names: typing.List[str],
4342
branch: typing.Optional[str],
4443
slug: typing.Optional[str],

0 commit comments

Comments
 (0)