MCPcopy Create free account
hub / github.com/pace/bricks / getValuesFromFlow

Function getValuesFromFlow

http/jsonapi/generator/generate_security.go:130–141  ·  view source on GitHub ↗

getValuesFromFlow puts the values from the OAuth Flow in a jen.Dict to generate it

(flow *openapi3.OAuthFlow)

Source from the content-addressed store, hash-verified

128
129// getValuesFromFlow puts the values from the OAuth Flow in a jen.Dict to generate it
130func getValuesFromFlow(flow *openapi3.OAuthFlow) jen.Dict {
131 r := jen.Dict{}
132 r[jen.Id("AuthorizationURL")] = jen.Lit(flow.AuthorizationURL)
133 r[jen.Id("TokenURL")] = jen.Lit(flow.TokenURL)
134 r[jen.Id("RefreshURL")] = jen.Lit(flow.RefreshURL)
135 scopes := jen.Dict{}
136 for scope, descr := range flow.Scopes {
137 scopes[jen.Lit(scope)] = jen.Lit(descr)
138 }
139 r[jen.Id("Scopes")] = jen.Map(jen.String()).String().Values(scopes)
140 return r
141}

Callers 1

buildSecurityConfigsMethod · 0.85

Calls 2

MapMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…