| 1 |
/* |
| 2 |
Copyright The ORAS Authors. |
| 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 |
|
| 16 |
package auth |
| 17 |
|
| 18 |
// EmptyCredential represents an empty credential. |
| 19 |
var EmptyCredential Credential |
| 20 |
|
| 21 |
// Credential contains authentication credentials used to access remote |
| 22 |
// registries. |
| 23 |
type Credential struct { |
| 24 |
// Username is the name of the user for the remote registry. |
| 25 |
Username string |
| 26 |
|
| 27 |
// Password is the secret associated with the username. |
| 28 |
Password string |
| 29 |
|
| 30 |
// RefreshToken is a bearer token to be sent to the authorization service |
| 31 |
// for fetching access tokens. |
| 32 |
// A refresh token is often referred as an identity token. |
| 33 |
// Reference: https://distribution.github.io/distribution/spec/auth/oauth/ |
| 34 |
RefreshToken string |
| 35 |
|
| 36 |
// AccessToken is a bearer token to be sent to the registry. |
| 37 |
// An access token is often referred as a registry token. |
| 38 |
// Reference: https://distribution.github.io/distribution/spec/auth/token/ |
| 39 |
AccessToken string |
| 40 |
} |