File size: 450 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package basic

import (
	"context"

	"github.com/target/goalert/ctxlock"
)

// Provider implements the auth.IdentityProvider interface.
type Provider struct {
	b *Store

	lim *ctxlock.IDLocker[string]
}

// NewProvider creates a new Provider with the associated config.
func NewProvider(ctx context.Context, store *Store) (*Provider, error) {
	return &Provider{
		b:   store,
		lim: ctxlock.NewIDLocker[string](ctxlock.Config{MaxHeld: 1}),
	}, nil
}