// New returns discovery operations.
New returns discovery operations.
// New returns discovery operations .
func New(c *Config, p *Providers) (*Operation, error) {
	u, err := url.Parse(c.BaseURL)
	if err != nil {
		return nil, fmt.Errorf("parse base URL: %w", err)
	}
	if c.WebCASPath == "" {
		return nil, fmt.Errorf("webCAS path cannot be empty")
	}
	return &Operation{
		pubKeys:                   c.PubKeys,
		host:                      u.Host,
		verificationMethodType:    c.VerificationMethodType,
		resolutionPath:            c.ResolutionPath,
		operationPath:             c.OperationPath,
		webCASPath:                c.WebCASPath,
		baseURL:                   c.BaseURL,
		vctURL:                    c.VctURL,
		discoveryMinimumResolvers: c.DiscoveryMinimumResolvers,
		discoveryDomains:          c.DiscoveryDomains,
		discoveryVctDomains:       c.DiscoveryVctDomains,
		anchorInfoRetriever:       NewAnchorInfoRetriever(p.ResourceRegistry),
		cas:                       p.CAS,
		anchorStore:               p.AnchorLinkStore,
		wfClient:                  p.WebfingerClient,
	}, nil
}
func New ( c * Config , p * Providers ) ( * Operation , error ) { u , err := url . Parse ( c . BaseURL ) if err != nil { return nil , fmt . Errorf ( " " , err ) } if c . WebCASPath == " " { return nil , fmt . Errorf ( " " ) } return & Operation { pubKeys : c . PubKeys , host : u . Host , verificationMethodType : c . VerificationMethodType , resolutionPath : c . ResolutionPath , operationPath : c . OperationPath , webCASPath : c . WebCASPath , baseURL : c . BaseURL , vctURL : c . VctURL , discoveryMinimumResolvers : c . DiscoveryMinimumResolvers , discoveryDomains : c . DiscoveryDomains , discoveryVctDomains : c . DiscoveryVctDomains , anchorInfoRetriever : NewAnchorInfoRetriever ( p . ResourceRegistry ) , cas : p . CAS , anchorStore : p . AnchorLinkStore , wfClient : p . WebfingerClient , } , nil }
New returns discovery operations.
New returns discovery operations .
// If the WebCAS path is empty, it'll cause certain WebFinger queries to be matched incorrectly