grafeas 1.8.0 → 1.9.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1087e39659813d1e6c30834df5a98d5562184daec175966b781ae3a8d019de2a
4
- data.tar.gz: 90657983a568ee12dab8b730be9ca49a7bfe2c3745309b6110ae00e034f98a3c
3
+ metadata.gz: 832d684e2b8d435f0a32550293f644e76bd0f1993f55bd7b6df511c55af20e22
4
+ data.tar.gz: b723af450a0e52cfd31d492fd60ea5c81013f267a07942f38f492e8d5f442406
5
5
  SHA512:
6
- metadata.gz: fded3e00ca3c558c3d884613bcdcbf9e12bcfc9e66bdf68816b9f9d49cc6fbd9537a449d4cc1c5e23cab9470d02e8f192ad9455915342ad80dcbefaaecd3cf4d
7
- data.tar.gz: 679510fe5f87fc90da57d7c01f0a2e4ffeddfcdf09a471ba3bf3e093bb65554c3a69d6a89bce7c0a0ba4a7922c9bc8d22b49b73acce01b99aab79f241e0baca2
6
+ metadata.gz: c5543019c2dba132cbc12339dfe81fd701fd5ff5b0ac307e82b66d2d16492d281338745f6f6b30f35195692321e54dbdb5e52cb7b47b07479536aad76549fb35
7
+ data.tar.gz: 5bf05e81d690eff99d3df0e4ff168a0a667fb65b074bb8d773b0e76db8a3a8159798d1d9901cd2029cadd038635fbacbdb693fbf3227758ab56e37290bea424b
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title="Grafeas API"
2
+ --title="Container Analysis API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
@@ -7,5 +7,6 @@
7
7
  ./lib/**/*.rb
8
8
  -
9
9
  README.md
10
+ AUTHENTICATION.md
10
11
  MIGRATING.md
11
12
  LICENSE.md
data/AUTHENTICATION.md ADDED
@@ -0,0 +1,122 @@
1
+ # Authentication
2
+
3
+ The recommended way to authenticate to the grafeas library is to use
4
+ [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
5
+ To review all of your authentication options, see [Credentials lookup](#credential-lookup).
6
+
7
+ ## Quickstart
8
+
9
+ The following example shows how to set up authentication for a local development
10
+ environment with your user credentials.
11
+
12
+ **NOTE:** This method is _not_ recommended for running in production. User credentials
13
+ should be used only during development.
14
+
15
+ 1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
16
+ 2. Set up a local ADC file with your user credentials:
17
+
18
+ ```sh
19
+ gcloud auth application-default login
20
+ ```
21
+
22
+ 3. Write code as if already authenticated.
23
+
24
+ For more information about setting up authentication for a local development environment, see
25
+ [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
26
+
27
+ ## Credential Lookup
28
+
29
+ The grafeas library provides several mechanisms to configure your system.
30
+ Generally, using Application Default Credentials to facilitate automatic
31
+ credentials discovery is the easist method. But if you need to explicitly specify
32
+ credentials, there are several methods available to you.
33
+
34
+ Credentials are accepted in the following ways, in the following order or precedence:
35
+
36
+ 1. Credentials specified in method arguments
37
+ 2. Credentials specified in configuration
38
+ 3. Credentials pointed to or included in environment variables
39
+ 4. Credentials found in local ADC file
40
+ 5. Credentials returned by the metadata server for the attached service account (GCP)
41
+
42
+ ### Configuration
43
+
44
+ You can configure a path to a JSON credentials file, either for an individual client object or
45
+ globally, for all client objects. The JSON file can contain credentials created for
46
+ [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
47
+ [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
48
+ [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
49
+
50
+ Note: Service account keys are a security risk if not managed correctly. You should
51
+ [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
52
+ whenever possible.
53
+
54
+ To configure a credentials file for an individual client initialization:
55
+
56
+ ```ruby
57
+ require "grafeas"
58
+
59
+ client = Grafeas.grafeas do |config|
60
+ config.credentials = "path/to/credentialfile.json"
61
+ end
62
+ ```
63
+
64
+ To configure a credentials file globally for all clients:
65
+
66
+ ```ruby
67
+ require "grafeas"
68
+
69
+ Grafeas.configure do |config|
70
+ config.credentials = "path/to/credentialfile.json"
71
+ end
72
+
73
+ client = Grafeas.grafeas
74
+ ```
75
+
76
+ ### Environment Variables
77
+
78
+ You can also use an environment variable to provide a JSON credentials file.
79
+ The environment variable can contain a path to the credentials file or, for
80
+ environments such as Docker containers where writing files is not encouraged,
81
+ you can include the credentials file itself.
82
+
83
+ The JSON file can contain credentials created for
84
+ [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
85
+ [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
86
+ [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
87
+
88
+ Note: Service account keys are a security risk if not managed correctly. You should
89
+ [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
90
+ whenever possible.
91
+
92
+ The environment variables that grafeas
93
+ checks for credentials are:
94
+
95
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
96
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
97
+
98
+ ```ruby
99
+ require "grafeas"
100
+
101
+ ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
102
+
103
+ client = Grafeas.grafeas
104
+ ```
105
+
106
+ ### Local ADC file
107
+
108
+ You can set up a local ADC file with your user credentials for authentication during
109
+ development. If credentials are not provided in code or in environment variables,
110
+ then the local ADC credentials are discovered.
111
+
112
+ Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
113
+
114
+ ### Google Cloud Platform environments
115
+
116
+ When running on Google Cloud Platform (GCP), including Google Compute Engine
117
+ (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
118
+ Functions (GCF) and Cloud Run, credentials are retrieved from the attached
119
+ service account automatically. Code should be written as if already authenticated.
120
+
121
+ For more information, see
122
+ [Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # Ruby Client for the Grafeas API
1
+ # Ruby Client for the Container Analysis API
2
2
 
3
- API Client library for the Grafeas API
3
+ An implementation of the Grafeas API, which stores, and enables querying and retrieval of critical metadata about all of your software artifacts.
4
4
 
5
- The Grafeas API stores, and enables querying and retrieval of, critical metadata about all of your software artifacts.
6
5
 
7
6
  Actual client classes for the various versions of this API are defined in
8
7
  _versioned_ client gems, with names of the form `grafeas-v*`.
@@ -18,15 +17,19 @@ themselves can be found in the client library documentation for the versioned
18
17
  client gems:
19
18
  [grafeas-v1](https://cloud.google.com/ruby/docs/reference/grafeas-v1/latest).
20
19
 
21
- See also the [Product Documentation](https://grafeas.io)
22
- for more usage information.
23
-
24
20
  ## Quick Start
25
21
 
26
22
  ```
27
23
  $ gem install grafeas
28
24
  ```
29
25
 
26
+ In order to use this library, you first need to go through the following steps:
27
+
28
+ 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
29
+ 1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
30
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/containeranalysis.googleapis.com)
31
+ 1. {file:AUTHENTICATION.md Set up authentication.}
32
+
30
33
  ```ruby
31
34
  require "grafeas"
32
35
 
@@ -77,12 +80,10 @@ working, try updating the versioned clients in your bundle or installed gems:
77
80
 
78
81
  This library is supported on Ruby 3.2+.
79
82
 
80
- Google provides official support for Ruby versions that are actively supported
81
- by Ruby Core—that is, Ruby versions that are either in normal maintenance or
82
- in security maintenance, and not end of life. Older versions of Ruby _may_
83
- still work, but are unsupported and not recommended. See
84
- https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
85
- support schedule.
83
+ Google provides official support for Ruby versions as described in the
84
+ [Supported Ruby versions](https://docs.cloud.google.com/ruby/getting-started/supported-ruby-versions)
85
+ policy. Older versions of Ruby _may_ still work, but are unsupported and not
86
+ recommended.
86
87
 
87
88
  ## Which client should I use?
88
89
 
@@ -18,5 +18,5 @@
18
18
 
19
19
 
20
20
  module Grafeas
21
- VERSION = "1.8.0"
21
+ VERSION = "1.9.0"
22
22
  end
data/lib/grafeas.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grafeas
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
@@ -43,14 +43,15 @@ dependencies:
43
43
  - - "<"
44
44
  - !ruby/object:Gem::Version
45
45
  version: 2.a
46
- description: The Grafeas API stores, and enables querying and retrieval of, critical
47
- metadata about all of your software artifacts.
46
+ description: An implementation of the Grafeas API, which stores, and enables querying
47
+ and retrieval of critical metadata about all of your software artifacts.
48
48
  email: googleapis-packages@google.com
49
49
  executables: []
50
50
  extensions: []
51
51
  extra_rdoc_files: []
52
52
  files:
53
53
  - ".yardopts"
54
+ - AUTHENTICATION.md
54
55
  - LICENSE.md
55
56
  - MIGRATING.md
56
57
  - README.md
@@ -76,5 +77,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
77
  requirements: []
77
78
  rubygems_version: 3.6.9
78
79
  specification_version: 4
79
- summary: API Client library for the Grafeas API
80
+ summary: An implementation of the Grafeas API, which stores, and enables querying
81
+ and retrieval of critical metadata about all of your software artifacts.
80
82
  test_files: []