Versions in this module Expand all Collapse all v0 v0.1.0 Sep 17, 2026 Changes in this version + const DefaultAPIBase + const DefaultIssuer + const DefaultWebhookTolerance + const EventHeader + const ScopeOpenID + const SignatureHeader + const TimestampHeader + const Version + var ErrConfig = errors.New("gti: yapılandırma eksik") + var ErrDenied = errors.New("gti: giriş reddedildi") + var ErrStateMismatch = errors.New("gti: state eşleşmedi") + var ErrTransport = errors.New("gti: sunucuya ulaşılamadı") + func ChipOnlyScopes() []string + type APIError struct + Code int + HTTPStatus int + Message string + func (e *APIError) Error() string + type Client struct + func New(cfg Config) (*Client, error) + func (c *Client) BeginLogin(scope ...string) (*LoginRequest, error) + func (c *Client) CompleteLogin(ctx context.Context, query url.Values, expectedState, verifier string) (*TokenSet, error) + func (c *Client) CreateSession(ctx context.Context, scope []string, webhookURL string) (*Session, error) + func (c *Client) Exchange(ctx context.Context, code, verifier string) (*TokenSet, error) + func (c *Client) FetchSession(ctx context.Context, sessionID string) (*SessionResult, error) + func (c *Client) FetchUserInfo(ctx context.Context, accessToken string) (*UserInfo, error) + func (c *Client) QRURL(sessionID string) string + func (c *Client) Refresh(ctx context.Context, refreshToken string) (*TokenSet, error) + func (c *Client) VerifyWebhook(body []byte, signature, timestamp string, tolerance time.Duration) error + func (c *Client) VerifyWebhookRequest(r *http.Request, body []byte, tolerance time.Duration) error + type Config struct + APIBase string + APIKey string + ClientID string + ClientSecret string + HTTPClient *http.Client + Issuer string + RedirectURI string + WebhookSecret string + type LoginRequest struct + State string + URL string + Verifier string + type OAuthError struct + Code string + Description string + HTTPStatus int + func (e *OAuthError) Error() string + func (e *OAuthError) Is(target error) bool + type Session struct + ExpiresAt string + QR string + Scope []string + SessionID string + Status string + type SessionResult struct + ExpiresAt string + Identity map[string]string + Scope []string + SessionID string + Status string + func (r SessionResult) Approved() bool + func (r SessionResult) IdentityVerified() bool + type TokenSet struct + AccessToken string + ExpiresIn int + IDToken string + RefreshToken string + Scope string + TokenType string + func (t TokenSet) Scopes() []string + type UserInfo struct + Address string + AgeOver18 string + Birthdate string + DocumentNumber string + Email string + FamilyName string + Gender string + GivenName string + Name string + NationalID string + Nationality string + PassportNumber string + PhoneNumber string + Picture string + Subject string