Skip to content

Commit

Permalink
feat: add workload identity federation support (#547)
Browse files Browse the repository at this point in the history
Adds new credential types for File/URL based external credentials.
Adds utilities for STS token exchange

See go/guac-3pi-java.

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
lsirac and chingor13 committed Feb 18, 2021
1 parent 2142db3 commit b8dde1e
Show file tree
Hide file tree
Showing 24 changed files with 5,159 additions and 7 deletions.
56 changes: 56 additions & 0 deletions oauth2_http/java/com/google/auth/oauth2/ActingParty.java
@@ -0,0 +1,56 @@
/*
* Copyright 2021 Google LLC
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Google LLC nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package com.google.auth.oauth2;

import static com.google.common.base.Preconditions.checkNotNull;

/**
* The acting party as defined in <a href="https://tools.ietf.org/html/rfc8693">OAuth 2.0 Token
* Exchange</a>.
*/
final class ActingParty {
private final String actorToken;
private final String actorTokenType;

ActingParty(String actorToken, String actorTokenType) {
this.actorToken = checkNotNull(actorToken);
this.actorTokenType = checkNotNull(actorTokenType);
}

String getActorToken() {
return actorToken;
}

String getActorTokenType() {
return actorTokenType;
}
}

0 comments on commit b8dde1e

Please sign in to comment.