-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into use-openapi-gener…
…ator
- Loading branch information
Showing
30 changed files
with
151 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -345,6 +345,34 @@ func TestGetUserIdentity(t *testing.T) { | |
assert.Equal(t, "[email protected]", userIdentity) | ||
} | ||
|
||
func TestGetUserIdentityError(t *testing.T) { | ||
md := metadata.New(map[string]string{"no-identity-header": "user"}) | ||
ctx := metadata.NewIncomingContext(context.Background(), md) | ||
_, err := getUserIdentity(ctx) | ||
assert.NotNil(t, err) | ||
assert.Contains(t, err.Error(), "Request header error: there is no user identity header.") | ||
} | ||
|
||
func TestGetUserIdentityFromHeaderGoogle(t *testing.T) { | ||
userIdentity, err := getUserIdentityFromHeader(common.GoogleIAPUserIdentityPrefix+"[email protected]", common.GoogleIAPUserIdentityPrefix) | ||
assert.Nil(t, err) | ||
assert.Equal(t, "[email protected]", userIdentity) | ||
} | ||
|
||
func TestGetUserIdentityFromHeaderNonGoogle(t *testing.T) { | ||
prefix := "" | ||
userIdentity, err := getUserIdentityFromHeader(prefix+"user", prefix) | ||
assert.Nil(t, err) | ||
assert.Equal(t, "user", userIdentity) | ||
} | ||
|
||
func TestGetUserIdentityFromHeaderError(t *testing.T) { | ||
prefix := "expected-prefix" | ||
_, err := getUserIdentityFromHeader("user", prefix) | ||
assert.NotNil(t, err) | ||
assert.Contains(t, err.Error(), "Request header error: user identity value is incorrectly formatted") | ||
} | ||
|
||
func TestCanAccessNamespaceInResourceReferences_Unauthorized(t *testing.T) { | ||
viper.Set(common.MultiUserMode, "true") | ||
defer viper.Set(common.MultiUserMode, "false") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# A marker file that marks the location of a repository of Kubeflow Pipelines components | ||
# This marker file makes it easier to find public repositories online |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.