Documentation ¶
Index ¶
- Constants
- Variables
- type Domain
- type Filter
- type OrgService
- type Repository
- type Service
- func (s Service) Close() error
- func (s Service) Create(ctx context.Context, domain Domain) (Domain, error)
- func (s Service) Delete(ctx context.Context, id string) error
- func (s Service) Get(ctx context.Context, id string) (Domain, error)
- func (s Service) InitDomainVerification(ctx context.Context) error
- func (s Service) Join(ctx context.Context, orgID string, userId string) error
- func (s Service) List(ctx context.Context, flt Filter) ([]Domain, error)
- func (s Service) ListJoinableOrgsByDomain(ctx context.Context, email string) ([]string, error)
- func (s Service) VerifyDomain(ctx context.Context, id string) (Domain, error)
- type Status
- type UserService
Constants ¶
View Source
const ( DNSChallenge = "_frontier-domain-verification=%s" DefaultTokenExpiry = time.Hour * 24 * 7 // 7 days )
Variables ¶
View Source
var ( ErrNotExist = errors.New("org domain request does not exist") ErrInvalidDomain = errors.New("invalid domain. No such host found") ErrTXTrecordNotFound = errors.New("required TXT record not found for domain verification") ErrDomainsMisMatch = errors.New("user domain does not match the organization domain") ErrInvalidId = errors.New("invalid domain id") ErrDuplicateKey = errors.New("domain name already exists for that organization") )
Functions ¶
This section is empty.
Types ¶
type OrgService ¶
type OrgService interface { ListByUser(ctx context.Context, userID string, filter organization.Filter) ([]organization.Organization, error) AddMember(ctx context.Context, orgID, relationName string, principal authenticate.Principal) error Get(ctx context.Context, id string) (organization.Organization, error) }
type Repository ¶
type Repository interface { Create(ctx context.Context, domain Domain) (Domain, error) Get(ctx context.Context, id string) (Domain, error) Update(ctx context.Context, domain Domain) (Domain, error) List(ctx context.Context, flt Filter) ([]Domain, error) Delete(ctx context.Context, id string) error DeleteExpiredDomainRequests(ctx context.Context) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(logger log.Logger, repository Repository, userService UserService, orgService OrgService) *Service
func (Service) Create ¶
Creates a record for the domain in the database and returns the TXT record that needs to be added to the DNS for the domain verification
func (Service) InitDomainVerification ¶
InitDomainVerification starts a cron job that runs once a day to delete expired domain requests which are still in pending state after 7 days of creation
func (Service) Join ¶
Join an organization as a member if the user domain matches the org whitelisted domains
func (Service) ListJoinableOrgsByDomain ¶ added in v0.7.3
Click to show internal directories.
Click to hide internal directories.