| 1 | # Copyright 2022 Google LLC and contributors | ||
| 2 | # | ||
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | # you may not use this file except in compliance with the License. | ||
| 5 | # You may obtain a copy of the License at | ||
| 6 | # | ||
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | # | ||
| 9 | # Unless required by applicable law or agreed to in writing, software | ||
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | # See the License for the specific language governing permissions and | ||
| 13 | # limitations under the License. | ||
| 14 | |||
| 15 | package Google::Auth::EnvironmentVars; | ||
| 16 | |||
| 17 | 14 | ▶ | use 5.006; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 14 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 14 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | 14 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | =head1 NAME | ||
| 24 | |||
| 25 | Google::Auth::EnvironmentVars - Environment variables used by Google::Auth | ||
| 26 | |||
| 27 | =head1 VERSION | ||
| 28 | |||
| 29 | Version 0.09 | ||
| 30 | |||
| 31 | =cut | ||
| 32 | |||
| 33 | =head1 SYNOPSIS | ||
| 34 | |||
| 35 | Canonical package for reading environment variables used with Google::Auth | ||
| 36 | |||
| 37 | =head1 METHODS | ||
| 38 | |||
| 39 | =head2 PROJECT | ||
| 40 | |||
| 41 | This env variable is used by Google::Auth to explicitly set a project | ||
| 42 | ID. This environment variable is also used by the Google Cloud Perl | ||
| 43 | Library. | ||
| 44 | |||
| 45 | =cut | ||
| 46 | |||
| 47 | has PROJECT => ( | ||
| 48 | is => 'ro', | ||
| 49 | 8 | ▶ | builder => sub { $ENV{GOOGLE_CLOUD_PROJECT} }, |
|
Subroutine
_build_PROJECT: called CC=1 SCAR=0.0
| |||
| 50 | 14 | documentation => 'Environment variable defining default project', | |
| 51 | ); | ||
| 52 | |||
| 53 | =head2 LEGACY_PROJECT | ||
| 54 | |||
| 55 | This environment variable is used instead of the current one in some | ||
| 56 | situations (such as Google App Engine). | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | has LEGACY_PROJECT => ( | ||
| 61 | is => 'ro', | ||
| 62 | 2 | ▶ | builder => sub { $ENV{GCLOUD_PROJECT} }, |
|
Subroutine
_build_LEGACY_PROJECT: called CC=1 SCAR=0.0
| |||
| 63 | 14 | documentation => | |
| 64 | 'Previously used environment variable defining the default project', | ||
| 65 | ); | ||
| 66 | |||
| 67 | =head2 CREDENTIALS | ||
| 68 | |||
| 69 | Environment variable defining the location of Google application | ||
| 70 | default credentials | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | has CREDENTIALS => ( | ||
| 75 | is => 'ro', | ||
| 76 | 8 | ▶ | builder => sub { $ENV{GOOGLE_APPLICATION_CREDENTIALS} }, |
|
Subroutine
_build_CREDENTIALS: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 77 | 14 | documentation => | |
| 78 | 'Environment variable defining the location of Google application default credentials', | ||
| 79 | ); | ||
| 80 | |||
| 81 | =head2 CLOUD_SDK_CONFIG_DIR | ||
| 82 | |||
| 83 | The environment variable name which can replace ~/.config if set | ||
| 84 | |||
| 85 | =cut | ||
| 86 | |||
| 87 | has CLOUD_SDK_CONFIG_DIR => ( | ||
| 88 | is => 'ro', | ||
| 89 | 8 | ▶ | builder => sub { $ENV{CLOUDSDK_CONFIG} }, |
|
Subroutine
_build_CLOUD_SDK_CONFIG_DIR: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 90 | 14 | documentation => | |
| 91 | q{Environment variable defines the location of Google Cloud SDK's config files}, | ||
| 92 | ); | ||
| 93 | |||
| 94 | =head2 GCE_METADATA_ROOT | ||
| 95 | |||
| 96 | This and the following variable allow for customization of the | ||
| 97 | addresses used when contacting the GCE metadata service. | ||
| 98 | |||
| 99 | =cut | ||
| 100 | |||
| 101 | has GCE_METADATA_ROOT => ( | ||
| 102 | is => 'ro', | ||
| 103 | 4 | ▶ | builder => sub { $ENV{GCE_METADATA_ROOT} }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
_build_GCE_METADATA_ROOT: called CC=1 SCAR=0.0
| |||
| 104 | 14 | documentation => | |
| 105 | 'Environment variable providing an alternate hostname or host:port to be ' | ||
| 106 | . 'used for GCE metadata requests', | ||
| 107 | ); | ||
| 108 | |||
| 109 | =head2 GCE_METADATA_IP | ||
| 110 | |||
| 111 | =cut | ||
| 112 | |||
| 113 | has GCE_METADATA_IP => ( | ||
| 114 | is => 'ro', | ||
| 115 | 12 | ▶ | builder => sub { $ENV{GCE_METADATA_IP} }, |
|
Subroutine
_build_GCE_METADATA_IP: called CC=1 SCAR=0.0
| |||
| 116 | 14 | documentation => | |
| 117 | 'Environment variable providing an alternate ip:port to be used for ip-only ' | ||
| 118 | . 'GCE metadata requests', | ||
| 119 | ); | ||
| 120 | |||
| 121 | =head1 AUTHOR | ||
| 122 | |||
| 123 | C.J. Collier, C<< <cjac at google.com> >> | ||
| 124 | |||
| 125 | =head1 BUGS AND SUPPORT | ||
| 126 | |||
| 127 | Please report any bugs or feature requests to the GitHub issue tracker at | ||
| 128 | L<https://github.com/GoogleCloudPlatform/google-auth-library-perl/issues> or via RT at | ||
| 129 | L<https://rt.cpan.org/Dist/Display.html?Name=Google-Auth>. | ||
| 130 | |||
| 131 | You can also look for information at: | ||
| 132 | |||
| 133 | =over 4 | ||
| 134 | |||
| 135 | =item * GitHub Issue Tracker | ||
| 136 | |||
| 137 | L<https://github.com/GoogleCloudPlatform/google-auth-library-perl/issues> | ||
| 138 | |||
| 139 | =item * RT: CPAN's Request Tracker | ||
| 140 | |||
| 141 | L<https://rt.cpan.org/Dist/Display.html?Name=Google-Auth> | ||
| 142 | |||
| 143 | =item * MetaCPAN | ||
| 144 | |||
| 145 | L<https://metacpan.org/release/Google-Auth> | ||
| 146 | |||
| 147 | =back | ||
| 148 | |||
| 149 | |||
| 150 | =head1 ACKNOWLEDGEMENTS | ||
| 151 | |||
| 152 | |||
| 153 | =head1 LICENSE AND COPYRIGHT | ||
| 154 | |||
| 155 | Copyright 2020 Google LLC and contributors | ||
| 156 | |||
| 157 | This program is released under the following license: Apache 2.0 | ||
| 158 | |||
| 159 | |||
| 160 | =cut | ||
| 161 | |||
| 162 | 14 | 1; # End of Google::Auth | |