| 1 |
package generic |
| 2 |
|
| 3 |
import ( |
| 4 |
"context" |
| 5 |
"net/http" |
| 6 |
|
| 7 |
"github.com/jkroepke/openvpn-auth-oauth2/v2/internal/config" |
| 8 |
) |
| 9 |
|
| 10 |
const Name = "generic" |
| 11 |
|
| 12 |
type Provider struct { |
| 13 |
Conf *config.Config |
| 14 |
} |
| 15 |
|
| 16 |
// NewProvider creates a new generic provider from the supplied configuration. |
| 17 |
// The http.Client argument is ignored because the provider uses the global |
| 18 |
// client from the oauth2 package. |
| 19 |
func NewProvider(_ context.Context, conf *config.Config, _ *http.Client) (*Provider, error) { |
| 20 |
return &Provider{ |
| 21 |
Conf: conf, |
| 22 |
}, nil |
| 23 |
} |
| 24 |
|
| 25 |
// GetName returns the identifier of this provider implementation. |
| 26 |
func (p Provider) GetName() string { |
| 27 |
return Name |
| 28 |
} |