---
# System prepended metadata

title: Untitled

---

```
package fermyon:kubecon

interface github-oauth {
    exchange: func(headers: list<tuple<string,string>>, state_param: string) -> bool
    validate: func(code: string, redirect-url: string, client-id: string, client-secret: string) -> string
}

/// An implementation of oauth middleware targets this world.
world oauth-component-library {
    import wasi:http/outgoing-handler
    export github-oauth
}

world github-oauth-handler {
    export wasi:http/incoming-handler
    import oauth-component-library
}
```

Workflow
- cargo component new --reactor <name>
- Update wit
- add deps directory for wasi outgoing http wit file
- call outgoing request and handle in func

Add new world for handler.
    
    
    
Notes:
    cargo-component-component 0.2.0 (wasi:aec4b25)
    aec4b25 sha refers to commit in wasmtime