{"id":22166485,"url":"https://github.com/alextanhongpin/go-openid","last_synced_at":"2025-06-29T11:33:11.230Z","repository":{"id":79114972,"uuid":"92317626","full_name":"alextanhongpin/go-openid","owner":"alextanhongpin","description":"Creating an openid with golang","archived":false,"fork":false,"pushed_at":"2019-05-27T17:07:02.000Z","size":5385,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:29:37.998Z","etag":null,"topics":["api","golang","openid","rest-api"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alextanhongpin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-24T17:17:06.000Z","updated_at":"2019-05-27T17:07:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a1112c2-de1c-4eea-9250-f85717c087cc","html_url":"https://github.com/alextanhongpin/go-openid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alextanhongpin/go-openid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-openid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-openid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-openid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-openid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextanhongpin","download_url":"https://codeload.github.com/alextanhongpin/go-openid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fgo-openid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262586617,"owners_count":23332913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","golang","openid","rest-api"],"created_at":"2024-12-02T05:19:41.914Z","updated_at":"2025-06-29T11:33:11.174Z","avatar_url":"https://github.com/alextanhongpin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-openid\n\nCreating an OpenID Connect with golang. Things I've learn throughout the process.\n\n- how to setup enum\n- bitwise operator for conditionals\n\n## Wiring Dependencies\n\nUsing `wire`. \n```go\nfunc ProvideRepository() *database.ClientKV {\n\treturn database.NewClientKV()\n}\n\nfunc ProvideModel(r repository.Client, v map[string]schema.Validator) *clientModelImpl {\n\treturn NewClientModelImpl(r, v)\n}\n\nfunc ProvideService(m model.Client) *clientServiceImpl {\n\treturn NewClientServiceImpl(m)\n}\n\nvar ClientMegaSet = wire.NewSet(\n\tProvideRepository,\n\twire.Bind(new(repository.Client), new(database.ClientKV)),\n\tProvideModel,\n\twire.Bind(new(model.Client), new(clientModelImpl)),\n\tProvideService)\n\nvar ClientSet = wire.NewSet(\n\t// Creates a new pointer to the struct *ClientKV.\n\tdatabase.NewClientKV,\n\n\t// Map the struct *ClientKV to the interface repository.Client to be\n\t// used as the next argument.\n\twire.Bind(new(repository.Client), new(database.ClientKV)),\n\n\t// Accepts the previous repository.Client interface, but skip the\n\t// second argument. The second argument will be required as a\n\t// parameter, since we do not defined it here. Returns a pointer to the\n\t// struct *clientModelImpl.\n\tNewClientModelImpl,\n\n\t// Take the previous struct pointer and convert it to the interface\n\t// type.\n\twire.Bind(new(model.Client), new(clientModelImpl)),\n\n\t// Takes the previous interface and returns a pointer to the\n\t// *clientServiceImpl.\n\tNewClientServiceImpl)\n```\n\nBoth produces the same result:\n\n```go\n// Code generated by Wire. DO NOT EDIT.\n\n//go:generate wire\n//+build !wireinject\n\npackage client\n\nimport (\n\tdatabase \"github.com/alextanhongpin/go-openid/internal/database\"\n\tschema \"github.com/alextanhongpin/go-openid/pkg/schema\"\n)\n\n// Injectors from wire.go:\n\nfunc NewService(arg map[string]schema.Validator) *clientServiceImpl {\n\tclientKV := database.NewClientKV()\n\tclientClientModelImpl := NewClientModelImpl(clientKV, arg)\n\tclientClientServiceImpl := NewClientServiceImpl(clientClientModelImpl)\n\treturn clientClientServiceImpl\n}\n\nfunc NewSimplerService(arg map[string]schema.Validator) *clientServiceImpl {\n\tclientKV := ProvideRepository()\n\tclientClientModelImpl := ProvideModel(clientKV, arg)\n\tclientClientServiceImpl := ProvideService(clientClientModelImpl)\n\treturn clientClientServiceImpl\n}\n```\n\n## TODOS\n\n- add check login multiple time (and captcha)\n- add block ip functionality\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextanhongpin%2Fgo-openid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextanhongpin%2Fgo-openid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextanhongpin%2Fgo-openid/lists"}