Skip to content

Commit

Permalink
Run the Generator (from Proto-generated JSON Schemas) – Nov 3, 2020 (#32
Browse files Browse the repository at this point in the history
)

* feat: run the generator, 11/2020
  • Loading branch information
grant committed Nov 10, 2020
1 parent 3157b4a commit 8aa79e8
Show file tree
Hide file tree
Showing 112 changed files with 5,636 additions and 526 deletions.
138 changes: 0 additions & 138 deletions src/main/java/com/google/events/cloud/audit/v1/AuditLog.java

This file was deleted.

71 changes: 64 additions & 7 deletions src/main/java/com/google/events/cloud/audit/v1/Auth.java
@@ -1,11 +1,11 @@
/*
/**
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -16,27 +16,84 @@

package com.google.events.cloud.audit.v1;

import java.util.Map;

/**
* The request authentication. May be absent for unauthenticated requests.
* Derived from the HTTP request `Authorization` header or equivalent.
*/
public class Auth {
private String[] accessLevels;
private String[] audiences;
private Map<String, Object> claims;
private Claims claims;
private String presenter;
private String principal;

/**
* A list of access level resource names that allow resources to be
* accessed by authenticated requester. It is part of Secure GCP processing
* for the incoming request. An access level string has the format:
* "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}"
*
* Example:
* "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL"
*/
public String[] getAccessLevels() { return accessLevels; }
public void setAccessLevels(String[] value) { this.accessLevels = value; }

/**
* The intended audience(s) for this authentication information. Reflects
* the audience (`aud`) claim within a JWT. The audience
* value(s) depends on the `issuer`, but typically include one or more of
* the following pieces of information:
*
* * The services intended to receive the credential such as
* ["pubsub.googleapis.com", "storage.googleapis.com"]
* * A set of service-based scopes. For example,
* ["https://www.googleapis.com/auth/cloud-platform"]
* * The client id of an app, such as the Firebase project id for JWTs
* from Firebase Auth.
*
* Consult the documentation for the credential issuer to determine the
* information provided.
*/
public String[] getAudiences() { return audiences; }
public void setAudiences(String[] value) { this.audiences = value; }

public Map<String, Object> getClaims() { return claims; }
public void setClaims(Map<String, Object> value) { this.claims = value; }
/**
* Structured claims presented with the credential. JWTs include
* `{key: value}` pairs for standard and private claims. The following
* is a subset of the standard required and optional claims that would
* typically be presented for a Google-based JWT:
*
* {'iss': 'accounts.google.com',
* 'sub': '113289723416554971153',
* 'aud': ['123456789012', 'pubsub.googleapis.com'],
* 'azp': '123456789012.apps.googleusercontent.com',
* 'email': 'jsmith@example.com',
* 'iat': 1353601026,
* 'exp': 1353604926}
*
* SAML assertions are similarly specified, but with an identity provider
* dependent structure.
*/
public Claims getClaims() { return claims; }
public void setClaims(Claims value) { this.claims = value; }

/**
* The authorized presenter of the credential. Reflects the optional
* Authorized Presenter (`azp`) claim within a JWT or the
* OAuth client id. For example, a Google Cloud Platform client id looks
* as follows: "123456789012.apps.googleusercontent.com".
*/
public String getPresenter() { return presenter; }
public void setPresenter(String value) { this.presenter = value; }

/**
* The authenticated principal. Reflects the issuer (`iss`) and subject
* (`sub`) claims within a JWT. The issuer and subject should be `/`
* delimited, with `/` percent-encoded within the subject fragment. For
* Google accounts, the principal format is:
* "https://accounts.google.com/{id}"
*/
public String getPrincipal() { return principal; }
public void setPrincipal(String value) { this.principal = value; }
}
@@ -1,11 +1,11 @@
/*
/**
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -16,65 +16,66 @@

package com.google.events.cloud.audit.v1;

import java.util.Map;

/**
* Authentication information.
*
* Authentication information for the operation.
*/
public class AuthenticationInfo {
private String authoritySelector;
private String principalEmail;
private String principalSubject;
private ServiceAccountDelegationInfo[] serviceAccountDelegationInfo;
private String serviceAccountKeyName;
private Map<String, Object> thirdPartyPrincipal;
private AuthenticationInfoThirdPartyPrincipal thirdPartyPrincipal;

/**
* The authority selector specified by the requestor, if any. It is not guaranteed that the
* principal was allowed to use this authority.
* The authority selector specified by the requestor, if any.
* It is not guaranteed that the principal was allowed to use this authority.
*/
public String getAuthoritySelector() { return authoritySelector; }
public void setAuthoritySelector(String value) { this.authoritySelector = value; }

/**
* The email address of the authenticated user (or service account on behalf of third party
* principal) making the request. For privacy reasons, the principal email address is
* redacted for all read-only operations that fail with a "permission denied" error.
* The email address of the authenticated user (or service account on behalf
* of third party principal) making the request. For privacy reasons, the
* principal email address is redacted for all read-only operations that fail
* with a "permission denied" error.
*/
public String getPrincipalEmail() { return principalEmail; }
public void setPrincipalEmail(String value) { this.principalEmail = value; }

/**
* String representation of identity of requesting party. Populated for both first and third
* party identities.
* String representation of identity of requesting party.
* Populated for both first and third party identities.
*/
public String getPrincipalSubject() { return principalSubject; }
public void setPrincipalSubject(String value) { this.principalSubject = value; }

/**
* Identity delegation history of an authenticated service account that makes the request.
* It contains information on the real authorities that try to access GCP resources by
* delegating on a service account. When multiple authorities present, they are guaranteed
* to be sorted based on the original ordering of the identity delegation events.
* Identity delegation history of an authenticated service account that makes
* the request. It contains information on the real authorities that try to
* access GCP resources by delegating on a service account. When multiple
* authorities present, they are guaranteed to be sorted based on the original
* ordering of the identity delegation events.
*/
public ServiceAccountDelegationInfo[] getServiceAccountDelegationInfo() { return serviceAccountDelegationInfo; }
public void setServiceAccountDelegationInfo(ServiceAccountDelegationInfo[] value) { this.serviceAccountDelegationInfo = value; }

/**
* The name of the service account key used to create or exchange credentials for
* authenticating the service account making the request. This is a scheme-less URI full
* resource name.
* The name of the service account key used to create or exchange
* credentials for authenticating the service account making the request.
* This is a scheme-less URI full resource name. For example:
*
* "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}"
*/
public String getServiceAccountKeyName() { return serviceAccountKeyName; }
public void setServiceAccountKeyName(String value) { this.serviceAccountKeyName = value; }

/**
* The third party identification (if any) of the authenticated user making the request.
* When the JSON object represented here has a proto equivalent, the proto name will be
* indicated in the @type property.
* The third party identification (if any) of the authenticated user making
* the request.
* When the JSON object represented here has a proto equivalent, the proto
* name will be indicated in the `@type` property.
*/
public Map<String, Object> getThirdPartyPrincipal() { return thirdPartyPrincipal; }
public void setThirdPartyPrincipal(Map<String, Object> value) { this.thirdPartyPrincipal = value; }
public AuthenticationInfoThirdPartyPrincipal getThirdPartyPrincipal() { return thirdPartyPrincipal; }
public void setThirdPartyPrincipal(AuthenticationInfoThirdPartyPrincipal value) { this.thirdPartyPrincipal = value; }
}
@@ -0,0 +1,35 @@
/**
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.events.cloud.audit.v1;

import java.util.Map;

/**
* The third party identification (if any) of the authenticated user making
* the request.
* When the JSON object represented here has a proto equivalent, the proto
* name will be indicated in the `@type` property.
*/
public class AuthenticationInfoThirdPartyPrincipal {
private Map<String, Map<String, Object>> fields;

/**
* Unordered map of dynamically typed values.
*/
public Map<String, Map<String, Object>> getFields() { return fields; }
public void setFields(Map<String, Map<String, Object>> value) { this.fields = value; }
}

0 comments on commit 8aa79e8

Please sign in to comment.