- 0.115.1 (latest)
- 0.115.0
- 0.114.0
- 0.113.0
- 0.112.2
- 0.111.0
- 0.110.10
- 0.109.0
- 0.108.0
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.0
- 0.103.0
- 0.102.1
- 0.101.1
- 0.100.2
- 0.99.0
- 0.98.0
- 0.97.0
- 0.96.0
- 0.95.0
- 0.94.1
- 0.93.3
- 0.92.3
- 0.91.1
- 0.90.0
- 0.89.0
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.0
- 0.84.0
- 0.83.0
- 0.82.0
- 0.81.0
- 0.80.0
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
Package iap is an auto-generated package for the Cloud Identity-Aware Proxy API.
Controls access to cloud applications running on Google Cloud Platform.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
IdentityAwareProxyAdminCallOptions
type IdentityAwareProxyAdminCallOptions struct {
SetIamPolicy []gax.CallOption
GetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
GetIapSettings []gax.CallOption
UpdateIapSettings []gax.CallOption
}
IdentityAwareProxyAdminCallOptions contains the retry settings for each method of IdentityAwareProxyAdminClient.
IdentityAwareProxyAdminClient
type IdentityAwareProxyAdminClient struct {
// The call options for this service.
CallOptions *IdentityAwareProxyAdminCallOptions
// contains filtered or unexported fields
}
IdentityAwareProxyAdminClient is a client for interacting with Cloud Identity-Aware Proxy API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
APIs for Identity-Aware Proxy Admin configurations.
func NewIdentityAwareProxyAdminClient
func NewIdentityAwareProxyAdminClient(ctx context.Context, opts ...option.ClientOption) (*IdentityAwareProxyAdminClient, error)
NewIdentityAwareProxyAdminClient creates a new identity aware proxy admin service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
APIs for Identity-Aware Proxy Admin configurations.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*IdentityAwareProxyAdminClient) Close
func (c *IdentityAwareProxyAdminClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*IdentityAwareProxyAdminClient) Connection
func (c *IdentityAwareProxyAdminClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*IdentityAwareProxyAdminClient) GetIamPolicy
func (c *IdentityAwareProxyAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for an Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api (at https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api)
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iampb "google.golang.org/genproto/googleapis/iam/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.GetIamPolicyRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyAdminClient) GetIapSettings
func (c *IdentityAwareProxyAdminClient) GetIapSettings(ctx context.Context, req *iappb.GetIapSettingsRequest, opts ...gax.CallOption) (*iappb.IapSettings, error)
GetIapSettings gets the IAP settings on a particular IAP protected resource.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.GetIapSettingsRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetIapSettings(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyAdminClient) SetIamPolicy
func (c *IdentityAwareProxyAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy for an Identity-Aware Proxy protected resource. Replaces any existing policy. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api (at https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api)
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iampb "google.golang.org/genproto/googleapis/iam/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.SetIamPolicyRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyAdminClient) TestIamPermissions
func (c *IdentityAwareProxyAdminClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the Identity-Aware Proxy protected resource. More information about managing access via IAP can be found at: https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api (at https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api)
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iampb "google.golang.org/genproto/googleapis/iam/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.TestIamPermissionsRequest{
// TODO: Fill request struct fields.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyAdminClient) UpdateIapSettings
func (c *IdentityAwareProxyAdminClient) UpdateIapSettings(ctx context.Context, req *iappb.UpdateIapSettingsRequest, opts ...gax.CallOption) (*iappb.IapSettings, error)
UpdateIapSettings updates the IAP settings on a particular IAP protected resource. It replaces all fields unless the update_mask is set.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.UpdateIapSettingsRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateIapSettings(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
IdentityAwareProxyClientIterator
type IdentityAwareProxyClientIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*iappb.IdentityAwareProxyClient, nextPageToken string, err error)
// contains filtered or unexported fields
}
IdentityAwareProxyClientIterator manages a stream of *iappb.IdentityAwareProxyClient.
func (*IdentityAwareProxyClientIterator) Next
func (it *IdentityAwareProxyClientIterator) Next() (*iappb.IdentityAwareProxyClient, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*IdentityAwareProxyClientIterator) PageInfo
func (it *IdentityAwareProxyClientIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
IdentityAwareProxyOAuthCallOptions
type IdentityAwareProxyOAuthCallOptions struct {
ListBrands []gax.CallOption
CreateBrand []gax.CallOption
GetBrand []gax.CallOption
CreateIdentityAwareProxyClient []gax.CallOption
ListIdentityAwareProxyClients []gax.CallOption
GetIdentityAwareProxyClient []gax.CallOption
ResetIdentityAwareProxyClientSecret []gax.CallOption
DeleteIdentityAwareProxyClient []gax.CallOption
}
IdentityAwareProxyOAuthCallOptions contains the retry settings for each method of IdentityAwareProxyOAuthClient.
IdentityAwareProxyOAuthClient
type IdentityAwareProxyOAuthClient struct {
// The call options for this service.
CallOptions *IdentityAwareProxyOAuthCallOptions
// contains filtered or unexported fields
}
IdentityAwareProxyOAuthClient is a client for interacting with Cloud Identity-Aware Proxy API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
API to programmatically create, list and retrieve Identity Aware Proxy (IAP) OAuth brands; and create, retrieve, delete and reset-secret of IAP OAuth clients.
func NewIdentityAwareProxyOAuthClient
func NewIdentityAwareProxyOAuthClient(ctx context.Context, opts ...option.ClientOption) (*IdentityAwareProxyOAuthClient, error)
NewIdentityAwareProxyOAuthClient creates a new identity aware proxyo auth service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
API to programmatically create, list and retrieve Identity Aware Proxy (IAP) OAuth brands; and create, retrieve, delete and reset-secret of IAP OAuth clients.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*IdentityAwareProxyOAuthClient) Close
func (c *IdentityAwareProxyOAuthClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*IdentityAwareProxyOAuthClient) Connection
func (c *IdentityAwareProxyOAuthClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*IdentityAwareProxyOAuthClient) CreateBrand
func (c *IdentityAwareProxyOAuthClient) CreateBrand(ctx context.Context, req *iappb.CreateBrandRequest, opts ...gax.CallOption) (*iappb.Brand, error)
CreateBrand constructs a new OAuth brand for the project if one does not exist. The created brand is “internal only”, meaning that OAuth clients created under it only accept requests from users who belong to the same G Suite organization as the project. The brand is created in an un-reviewed status. NOTE: The “internal only” status can be manually changed in the Google Cloud console. Requires that a brand does not already exist for the project, and that the specified support email is owned by the caller.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.CreateBrandRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateBrand(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyOAuthClient) CreateIdentityAwareProxyClient
func (c *IdentityAwareProxyOAuthClient) CreateIdentityAwareProxyClient(ctx context.Context, req *iappb.CreateIdentityAwareProxyClientRequest, opts ...gax.CallOption) (*iappb.IdentityAwareProxyClient, error)
CreateIdentityAwareProxyClient creates an Identity Aware Proxy (IAP) OAuth client. The client is owned by IAP. Requires that the brand for the project exists and that it is set for internal-only use.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.CreateIdentityAwareProxyClientRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateIdentityAwareProxyClient(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyOAuthClient) DeleteIdentityAwareProxyClient
func (c *IdentityAwareProxyOAuthClient) DeleteIdentityAwareProxyClient(ctx context.Context, req *iappb.DeleteIdentityAwareProxyClientRequest, opts ...gax.CallOption) error
DeleteIdentityAwareProxyClient deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing obsolete clients, managing the number of clients in a given project, and cleaning up after tests. Requires that the client is owned by IAP.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.DeleteIdentityAwareProxyClientRequest{
// TODO: Fill request struct fields.
}
err = c.DeleteIdentityAwareProxyClient(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*IdentityAwareProxyOAuthClient) GetBrand
func (c *IdentityAwareProxyOAuthClient) GetBrand(ctx context.Context, req *iappb.GetBrandRequest, opts ...gax.CallOption) (*iappb.Brand, error)
GetBrand retrieves the OAuth brand of the project.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.GetBrandRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetBrand(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyOAuthClient) GetIdentityAwareProxyClient
func (c *IdentityAwareProxyOAuthClient) GetIdentityAwareProxyClient(ctx context.Context, req *iappb.GetIdentityAwareProxyClientRequest, opts ...gax.CallOption) (*iappb.IdentityAwareProxyClient, error)
GetIdentityAwareProxyClient retrieves an Identity Aware Proxy (IAP) OAuth client. Requires that the client is owned by IAP.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.GetIdentityAwareProxyClientRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetIdentityAwareProxyClient(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyOAuthClient) ListBrands
func (c *IdentityAwareProxyOAuthClient) ListBrands(ctx context.Context, req *iappb.ListBrandsRequest, opts ...gax.CallOption) (*iappb.ListBrandsResponse, error)
ListBrands lists the existing brands for the project.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.ListBrandsRequest{
// TODO: Fill request struct fields.
}
resp, err := c.ListBrands(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*IdentityAwareProxyOAuthClient) ListIdentityAwareProxyClients
func (c *IdentityAwareProxyOAuthClient) ListIdentityAwareProxyClients(ctx context.Context, req *iappb.ListIdentityAwareProxyClientsRequest, opts ...gax.CallOption) *IdentityAwareProxyClientIterator
ListIdentityAwareProxyClients lists the existing clients for the brand.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
"google.golang.org/api/iterator"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.ListIdentityAwareProxyClientsRequest{
// TODO: Fill request struct fields.
}
it := c.ListIdentityAwareProxyClients(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*IdentityAwareProxyOAuthClient) ResetIdentityAwareProxyClientSecret
func (c *IdentityAwareProxyOAuthClient) ResetIdentityAwareProxyClientSecret(ctx context.Context, req *iappb.ResetIdentityAwareProxyClientSecretRequest, opts ...gax.CallOption) (*iappb.IdentityAwareProxyClient, error)
ResetIdentityAwareProxyClientSecret resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the secret was compromised. Requires that the client is owned by IAP.
Example
package main
import (
"context"
iap "cloud.google.com/go/iap/apiv1"
iappb "google.golang.org/genproto/googleapis/cloud/iap/v1"
)
func main() {
ctx := context.Background()
c, err := iap.NewIdentityAwareProxyOAuthClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iappb.ResetIdentityAwareProxyClientSecretRequest{
// TODO: Fill request struct fields.
}
resp, err := c.ResetIdentityAwareProxyClientSecret(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}