Skip to content

Commit

Permalink
stringcookiejar: move into linkedingo
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Feb 26, 2025
1 parent 47daf58 commit 6e7d7d1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 230 deletions.
4 changes: 2 additions & 2 deletions pkg/connector/dbmeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package connector
import (
"maunium.net/go/mautrix/bridgev2/database"

"go.mau.fi/mautrix-linkedin/pkg/stringcookiejar"
"go.mau.fi/mautrix-linkedin/pkg/linkedingo"
)

func (lc *LinkedInConnector) GetDBMetaTypes() database.MetaTypes {
Expand All @@ -33,5 +33,5 @@ func (lc *LinkedInConnector) GetDBMetaTypes() database.MetaTypes {
}

type UserLoginMetadata struct {
Cookies *stringcookiejar.Jar `json:"cookies,omitempty"`
Cookies *linkedingo.Jar `json:"cookies,omitempty"`
}
3 changes: 1 addition & 2 deletions pkg/connector/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"maunium.net/go/mautrix/bridgev2/networkid"

"go.mau.fi/mautrix-linkedin/pkg/linkedingo"
"go.mau.fi/mautrix-linkedin/pkg/stringcookiejar"
)

const FlowIDCookies = "cookies"
Expand Down Expand Up @@ -90,7 +89,7 @@ func (c *CookieLogin) Start(ctx context.Context) (*bridgev2.LoginStep, error) {
}

func (c *CookieLogin) SubmitCookies(ctx context.Context, cookies map[string]string) (*bridgev2.LoginStep, error) {
jar, err := stringcookiejar.NewJarFromCookieHeader(cookies[CookieLoginCookieHeaderField])
jar, err := linkedingo.NewJarFromCookieHeader(cookies[CookieLoginCookieHeaderField])
if err != nil {
return nil, err
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/linkedingo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ import (
"net/http"

"github.com/google/uuid"

"go.mau.fi/mautrix-linkedin/pkg/stringcookiejar"
)

type Client struct {
http *http.Client
jar *stringcookiejar.Jar
jar *Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (old)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (old)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (latest)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (latest)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Test (old)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Test (old)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (old)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (old)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (latest)

undefined: Jar

Check failure on line 28 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (latest)

undefined: Jar
userEntityURN URN

realtimeSessionID uuid.UUID
Expand All @@ -43,7 +41,7 @@ type Client struct {
i18nLocale string
}

func NewClient(ctx context.Context, userEntityURN URN, jar *stringcookiejar.Jar, handlers Handlers) *Client {
func NewClient(ctx context.Context, userEntityURN URN, jar *Jar, handlers Handlers) *Client {

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (old)

undefined: Jar (compile)

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (old)

undefined: Jar

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (latest)

undefined: Jar (compile)

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (latest)

undefined: Jar

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Test (old)

undefined: Jar

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Test (old)

undefined: Jar

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (old)

undefined: Jar (compile)

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (old)

undefined: Jar

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (latest)

undefined: Jar (compile)

Check failure on line 44 in pkg/linkedingo/client.go

View workflow job for this annotation

GitHub Actions / Lint (latest)

undefined: Jar
return &Client{
userEntityURN: userEntityURN,
jar: jar,
Expand Down
105 changes: 0 additions & 105 deletions pkg/stringcookiejar/stringcookiejar.go

This file was deleted.

117 changes: 0 additions & 117 deletions pkg/stringcookiejar/stringcookiejar_test.go

This file was deleted.

0 comments on commit 6e7d7d1

Please sign in to comment.