This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var endpoint *string | |
cognitoEndpoint = os.Getenv("COGNITO_ENDPOINT") | |
if cognitoEndpoint != "" { | |
endpoint = aws.String(cognitoEndpoint) | |
} | |
client := cognitoidentityprovider.New( | |
session.Must(session.NewSessionWithOptions(session.Options{ | |
Config: aws.Config{Endpoint: endpoint}, | |
SharedConfigState: session.SharedConfigEnable, | |
})), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rsa" | |
"encoding/base64" | |
"encoding/binary" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"encoding/json" | |
"fmt" | |
"math/rand" | |
"github.com/aws/aws-sdk-go/service/cognitoidentityprovider" | |
"github.com/gofrs/uuid" | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"crypto/rsa" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"time" | |
"github.com/aws/aws-sdk-go/service/cognitoidentityprovider" | |
"github.com/dgrijalva/jwt-go" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"strings" | |
"github.com/go-chi/chi/v5" | |
"github.com/go-chi/render" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"user-pool-id-hoge": { | |
"username-hoge": { | |
"uuid": "208b377c-e86e-3f1d-a23c-cdab84d86901", | |
"password": "password", | |
"username": "username-hoge", | |
"email": "email@example.com", | |
"email_verified": true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"encoding/json" | |
"fmt" | |
"sync" | |
) | |
const poolFileName = "pool.json" | |
func main() { | |
data, err := ioutil.ReadFile(poolFileName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"github.com/go-chi/chi/v5" | |
"github.com/go-chi/chi/v5/middleware" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"encoding/base64" | |
"encoding/binary" | |
"encoding/json" | |
"io/ioutil" | |
"github.com/dgrijalva/jwt-go" | |
) | |
const jwkKeyID = "hoge" |
NewerOlder