mirror of https://github.com/matrix-org/go-neb.git
Browse Source
Add concept of AuthRealms
Add concept of AuthRealms
- These represent a place where a user can authenticate themselves. - They function in the same way as Services (insert/update based on an HTTP API) - They currently don't *do* a lot other than exist for storing realm-specific information (e.g. the `GithubRealm` stores the `ClientSecret` and `ClientID`)pull/6/head
Kegan Dougal
9 years ago
6 changed files with 173 additions and 11 deletions
-
37src/github.com/matrix-org/go-neb/api.go
-
27src/github.com/matrix-org/go-neb/database/db.go
-
67src/github.com/matrix-org/go-neb/database/schema.go
-
3src/github.com/matrix-org/go-neb/goneb.go
-
26src/github.com/matrix-org/go-neb/realms/github/github.go
-
24src/github.com/matrix-org/go-neb/types/types.go
@ -0,0 +1,26 @@ |
|||
package realms |
|||
|
|||
import ( |
|||
"github.com/matrix-org/go-neb/types" |
|||
) |
|||
|
|||
type githubRealm struct { |
|||
id string |
|||
ClientSecret string |
|||
ClientID string |
|||
WebhookEndpoint string |
|||
} |
|||
|
|||
func (r *githubRealm) ID() string { |
|||
return r.id |
|||
} |
|||
|
|||
func (r *githubRealm) Type() string { |
|||
return "github" |
|||
} |
|||
|
|||
func init() { |
|||
types.RegisterAuthRealm(func(realmID string) types.AuthRealm { |
|||
return &githubRealm{id: realmID} |
|||
}) |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue