webtoons

package module
v0.0.0-...-558b1cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2023 License: AGPL-3.0 Imports: 25 Imported by: 2

README

webtoons

Releasing this because I have no use of it and they don't seem to be sending mails anymore.

You can implement your own mail verification service, it just needs to satisfy the mail.Mailer interface.

This can also be used as a Go package, I exported some utilities functions such as:

  • keyring.Encrypt to encrypt the password and email for the encpw field
  • webtoons.SignRequest to sign the request url for the msgpad and md fields

Usage

  • Run the example:
$ git clone https://github.com/d4c5d1e0/webtoons.git
$ cd webtoons
$ go run cmd/gen/main.go
  • Use as a package:
$ go get -u github.com/d4c5d1e0/webtoons

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignRequest

func SignRequest(uri string) string

SignRequest sign the request like the mobile app would do, using HMAC-SHA1 The return value must be used as the request URL

Before:

_, _ = http.NewRequest(http.MethodGet, getKeysEndpoint, nil)

After:

_, _ =  http.NewRequest(http.MethodGet, SignRequest(getKeysEndpoint), nil)

Types

type Creator

type Creator struct {
	// contains filtered or unexported fields
}

Creator is a new instance used to create an account

func NewCreator

func NewCreator(proxy string, mailer mail.Mailer) (*Creator, error)

func (*Creator) Create

func (c *Creator) Create(mail, username string) error

func (*Creator) RedeemCode

func (c *Creator) RedeemCode() (string, error)

type KeyRing

type KeyRing struct {
	SessionKey string `json:"sessionKey"`
	Modulus    string `json:"evalue"`
	Exponent   string `json:"nvalue"`
	KeyName    string `json:"keyName"`
}

KeyRing is used to store the necessary parameters for encryption

func (*KeyRing) EncryptData

func (k *KeyRing) EncryptData(email, password string) (string, error)

EncryptData encrypts the password and the email using RSA PKCS1

Directories

Path Synopsis
cmd
gen
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL