MCPcopy Index your code
hub / github.com/coder/coder / formatDeviceTokenURL

Method formatDeviceTokenURL

coderd/externalauth/externalauth.go:789–800  ·  view source on GitHub ↗
(deviceCode string)

Source from the content-addressed store, hash-verified

787}
788
789func (c *DeviceAuth) formatDeviceTokenURL(deviceCode string) (string, error) {
790 tok, err := url.Parse(c.TokenURL)
791 if err != nil {
792 return "", err
793 }
794 tok.RawQuery = url.Values{
795 "client_id": {c.ClientID},
796 "device_code": {deviceCode},
797 "grant_type": {"urn:ietf:params:oauth:grant-type:device_code"},
798 }.Encode()
799 return tok.String(), nil
800}
801
802func (c *DeviceAuth) formatDeviceCodeURL() (string, error) {
803 cod, err := url.Parse(c.CodeURL)

Callers 1

ExchangeDeviceCodeMethod · 0.95

Calls 3

EncodeMethod · 0.80
ParseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected