oauth

OAuth 2.0 client library for Kit

Files

FileDescription
.editorconfigEditor formatting configuration
.gitignoreGit ignore rules for build artifacts and dependencies
.tool-versionsasdf tool versions (Zig, Kit)
LICENSEMIT license file
README.mdThis file
examples/client-credentials.kitExample: client credentials
examples/github.kitExample: github
kit.tomlPackage manifest with metadata and dependencies
src/oauth.kitNote: This module uses Kit's standard Result type (Ok aErr String).
tests/oauth.test.kitTests for oauth
tests/types.test.kitTests for types

Architecture

Authorization Code Flow

sequenceDiagram participant App participant User participant AuthServer participant ResourceServer App->>User: Redirect to Auth URL User->>AuthServer: Login & Consent AuthServer->>App: Authorization Code App->>AuthServer: Exchange Code + Secret AuthServer->>App: Access Token App->>ResourceServer: API Request + Token ResourceServer->>App: Protected Resource

Client Credentials Flow

sequenceDiagram participant App participant AuthServer participant ResourceServer App->>AuthServer: Client ID + Secret AuthServer->>App: Access Token App->>ResourceServer: API Request + Token ResourceServer->>App: Protected Resource

Dependencies

  • base64

Installation

kit add gitlab.com/kit-lang/packages/kit-oauth.git

Usage

import Kit.Oauth

License

MIT License - see LICENSE for details.