fix examples
This commit is contained in:
parent
3dd0d5fc3a
commit
5c5d716409
6 changed files with 533 additions and 14 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"crypto/rsa"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
@ -80,7 +81,8 @@ func (s *publicKey) Key() interface{} {
|
|||
return &s.key.PublicKey
|
||||
}
|
||||
|
||||
func NewStorage() *storage {
|
||||
func NewStorage(issuer string) *storage {
|
||||
hostname := strings.Split(strings.Split(issuer, "://")[0], ":")[0]
|
||||
key, _ := rsa.GenerateKey(rand.Reader, 2048)
|
||||
return &storage{
|
||||
authRequests: make(map[string]*AuthRequest),
|
||||
|
@ -91,7 +93,7 @@ func NewStorage() *storage {
|
|||
users: map[string]*User{
|
||||
"id1": {
|
||||
id: "id1",
|
||||
username: "test-user",
|
||||
username: "test-user@" + hostname,
|
||||
password: "verysecure",
|
||||
firstname: "Test",
|
||||
lastname: "User",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue