MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / TestBitbucketProviderOverrides

Function TestBitbucketProviderOverrides

providers/bitbucket_test.go:87–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestBitbucketProviderOverrides(t *testing.T) {
88 p := NewBitbucketProvider(
89 &ProviderData{
90 LoginURL: &url.URL{
91 Scheme: "https",
92 Host: "example.com",
93 Path: "/oauth/auth"},
94 RedeemURL: &url.URL{
95 Scheme: "https",
96 Host: "example.com",
97 Path: "/oauth/token"},
98 ValidateURL: &url.URL{
99 Scheme: "https",
100 Host: "example.com",
101 Path: "/api/v3/user"},
102 Scope: "profile"},
103 options.BitbucketOptions{})
104 assert.NotEqual(t, nil, p)
105 assert.Equal(t, "Bitbucket", p.Data().ProviderName)
106 assert.Equal(t, "https://example.com/oauth/auth",
107 p.Data().LoginURL.String())
108 assert.Equal(t, "https://example.com/oauth/token",
109 p.Data().RedeemURL.String())
110 assert.Equal(t, "https://example.com/api/v3/user",
111 p.Data().ValidateURL.String())
112 assert.Equal(t, "profile", p.Data().Scope)
113}
114
115func TestBitbucketProviderGetEmailAddress(t *testing.T) {
116 b := testBitbucketBackend("{\"values\": [ { \"email\": \"michael.bland@gsa.gov\", \"is_primary\": true } ] }")

Callers

nothing calls this directly

Calls 3

NewBitbucketProviderFunction · 0.85
DataMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected