Skip to content

Commit

Permalink
Adding configurable audience property for flyte clients (flyteorg#485)
Browse files Browse the repository at this point in the history
* Adding configurable audience property for flyte clients

Signed-off-by: pmahindrakar-oss <[email protected]>

* gen

Signed-off-by: pmahindrakar-oss <[email protected]>

Signed-off-by: pmahindrakar-oss <[email protected]>
  • Loading branch information
pmahindrakar-oss authored Nov 10, 2022
1 parent 4c58e78 commit acbf818
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions auth/authzserver/metadata_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (s OAuth2MetadataProvider) GetPublicClientConfig(context.Context, *service.
RedirectUri: s.cfg.AppAuth.ThirdParty.FlyteClientConfig.RedirectURI,
Scopes: s.cfg.AppAuth.ThirdParty.FlyteClientConfig.Scopes,
AuthorizationMetadataKey: s.cfg.GrpcAuthorizationHeader,
Audience: s.cfg.AppAuth.ThirdParty.FlyteClientConfig.Audience,
}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions auth/authzserver/metadata_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func TestOAuth2MetadataProvider_FlyteClient(t *testing.T) {
ClientID: "my-client",
RedirectURI: "client/",
Scopes: []string{"all"},
Audience: "http://dummyServer",
},
},
},
Expand All @@ -35,6 +36,7 @@ func TestOAuth2MetadataProvider_FlyteClient(t *testing.T) {
assert.Equal(t, "my-client", resp.ClientId)
assert.Equal(t, "client/", resp.RedirectUri)
assert.Equal(t, []string{"all"}, resp.Scopes)
assert.Equal(t, "http://dummyServer", resp.Audience)
}

func TestOAuth2MetadataProvider_OAuth2Metadata(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions auth/config/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions auth/config/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions auth/config/third_party_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type FlyteClientConfig struct {
ClientID string `json:"clientId" pflag:",public identifier for the app which handles authorization for a Flyte deployment"`
RedirectURI string `json:"redirectUri" pflag:",This is the callback uri registered with the app which handles authorization for a Flyte deployment"`
Scopes []string `json:"scopes" pflag:",Recommended scopes for the client to request."`
Audience string `json:"audience" pflag:",Audience to use when initiating OAuth2 authorization requests."`
}

func (o ThirdPartyConfigOptions) IsEmpty() bool {
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,6 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flyteorg/flyteidl v1.1.21 h1:09/xqYWFdUA22bVWKLjkSzhhSJfaJmDAraczpJ/Yiis=
github.com/flyteorg/flyteidl v1.1.21/go.mod h1:f0AFl7RFycH7+JLq2th0ReH7v+Xse+QTw4jGdIxiS8I=
github.com/flyteorg/flyteidl v1.2.0 h1:snJPpc5a5Gr4GXYiAMX6Io1edT91ZxN/7oE6uhydrvk=
github.com/flyteorg/flyteidl v1.2.0/go.mod h1:f0AFl7RFycH7+JLq2th0ReH7v+Xse+QTw4jGdIxiS8I=
github.com/flyteorg/flyteplugins v1.0.10 h1:XBycM4aOSE/WlI8iP9vqogKGXy4FMfVCUUfzxJus/p4=
Expand Down
1 change: 1 addition & 0 deletions pkg/config/serverconfig_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions pkg/config/serverconfig_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit acbf818

Please sign in to comment.