Initial import with modified Dockerfile for env-based config generation
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package identity
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/vincentc-afk/gitea-notification-hub/internal/event"
|
||||
)
|
||||
|
||||
// ResolvedIdentity represents a resolved external identity
|
||||
type ResolvedIdentity struct {
|
||||
Email string `json:"email"`
|
||||
SlackID string `json:"slack_id"`
|
||||
SlackName string `json:"slack_name"`
|
||||
}
|
||||
|
||||
// Resolver resolves Gitea users to external identities (e.g., Slack)
|
||||
// This interface allows for different identity providers (Gitea API, LDAP, etc.)
|
||||
type Resolver interface {
|
||||
// Resolve returns the external identity for a Gitea user
|
||||
Resolve(ctx context.Context, user event.User) (*ResolvedIdentity, error)
|
||||
}
|
||||
|
||||
// EmailLookup provides email lookup functionality
|
||||
type EmailLookup interface {
|
||||
// LookupEmail looks up a user's email address by username
|
||||
LookupEmail(ctx context.Context, username string) (string, error)
|
||||
}
|
||||
|
||||
// SlackLookup provides Slack user lookup functionality
|
||||
type SlackLookup interface {
|
||||
// LookupSlackIDByEmail finds a Slack user ID by email
|
||||
LookupSlackIDByEmail(ctx context.Context, email string) (slackID, slackName string, err error)
|
||||
}
|
||||
Reference in New Issue
Block a user