-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcredentials.py
More file actions
79 lines (69 loc) · 2.02 KB
/
credentials.py
File metadata and controls
79 lines (69 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""``click`` options regarding credentials."""
from collections.abc import Callable
from typing import Any
import click
from beartype import beartype
@beartype
def server_access_key_option(
command: Callable[..., Any],
) -> Callable[..., Any]:
"""An option decorator for the Vuforia server access key."""
return click.option(
"--server-access-key",
type=str,
help=(
"A Vuforia server access key to use to access the Vuforia Web "
"Services API."
),
required=True,
envvar="VUFORIA_SERVER_ACCESS_KEY",
show_envvar=True,
)(command)
@beartype
def server_secret_key_option(
command: Callable[..., Any],
) -> Callable[..., Any]:
"""An option decorator for the Vuforia server secret key."""
return click.option(
"--server-secret-key",
type=str,
help=(
"A Vuforia server secret key to use to access the Vuforia Web "
"Services API."
),
required=True,
envvar="VUFORIA_SERVER_SECRET_KEY",
show_envvar=True,
)(command)
@beartype
def client_access_key_option(
command: Callable[..., Any],
) -> Callable[..., Any]:
"""An option decorator for the Vuforia client access key."""
return click.option(
"--client-access-key",
type=str,
help=(
"A Vuforia client access key to use to access the Vuforia "
"Cloud Recognition API."
),
required=True,
envvar="VUFORIA_CLIENT_ACCESS_KEY",
show_envvar=True,
)(command)
@beartype
def client_secret_key_option(
command: Callable[..., Any],
) -> Callable[..., Any]:
"""An option decorator for the Vuforia client secret key."""
return click.option(
"--client-secret-key",
type=str,
help=(
"A Vuforia client secret key to use to access the Vuforia "
"Cloud Recognition API."
),
required=True,
envvar="VUFORIA_CLIENT_SECRET_KEY",
show_envvar=True,
)(command)