Class: Authentication::OAuth2

Inherits:
Base
  • Object
show all
Defined in:
lib/haveapi/go_client/authentication/oauth2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_version, name, desc) ⇒ OAuth2

Returns a new instance of OAuth2.



15
16
17
18
19
# File 'lib/haveapi/go_client/authentication/oauth2.rb', line 15

def initialize(api_version, name, desc)
  super
  @http_header = desc[:http_header]
  @revoke_url = desc[:revoke_url]
end

Instance Attribute Details

#http_headerString (readonly)

HTTP header the token is sent in

Returns:

  • (String)


9
10
11
# File 'lib/haveapi/go_client/authentication/oauth2.rb', line 9

def http_header
  @http_header
end

#revoke_urlString (readonly)

Token revocation URL

Returns:

  • (String)


13
14
15
# File 'lib/haveapi/go_client/authentication/oauth2.rb', line 13

def revoke_url
  @revoke_url
end

Instance Method Details

#generate(gen) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/haveapi/go_client/authentication/oauth2.rb', line 21

def generate(gen)
  ErbTemplate.render_to_if_changed(
    'authentication/oauth2.go',
    {
      package: gen.package,
      auth: self
    },
    File.join(gen.dst, 'auth_oauth2.go')
  )
end