Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-tkachov committed May 5, 2021
1 parent b845930 commit f30530a
Show file tree
Hide file tree
Showing 32 changed files with 266 additions and 171 deletions.
75 changes: 41 additions & 34 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ go_repository(
go_repository(
name = "com_github_cncf_udpa_go",
importpath = "github.com/cncf/udpa/go",
sum = "h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=",
version = "v0.0.0-20191209042840-269d4d468f6f",
sum = "h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M=",
version = "v0.0.0-20201120205902-5459f2c99403",
)

go_repository(
Expand Down Expand Up @@ -393,8 +393,8 @@ go_repository(
go_repository(
name = "com_github_envoyproxy_go_control_plane",
importpath = "github.com/envoyproxy/go-control-plane",
sum = "h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E=",
version = "v0.9.4",
sum = "h1:QyzYnTnPE15SQyUeqU6qLbWxMkwyAyu+vGksa0b7j00=",
version = "v0.9.9-0.20210217033140-668b12f5399d",
)

go_repository(
Expand Down Expand Up @@ -463,8 +463,8 @@ go_repository(
go_repository(
name = "com_github_go_kit_kit",
importpath = "github.com/go-kit/kit",
sum = "h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0=",
version = "v0.8.0",
sum = "h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=",
version = "v0.9.0",
)

go_repository(
Expand Down Expand Up @@ -520,8 +520,8 @@ go_repository(
go_repository(
name = "com_github_gogo_protobuf",
importpath = "github.com/gogo/protobuf",
sum = "h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=",
version = "v1.2.1",
sum = "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=",
version = "v1.3.2",
)

go_repository(
Expand All @@ -548,8 +548,8 @@ go_repository(
go_repository(
name = "com_github_golang_protobuf",
importpath = "github.com/golang/protobuf",
sum = "h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=",
version = "v1.4.2",
sum = "h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=",
version = "v1.5.2",
)

go_repository(
Expand All @@ -576,8 +576,8 @@ go_repository(
go_repository(
name = "com_github_google_go_cmp",
importpath = "github.com/google/go-cmp",
sum = "h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=",
version = "v0.5.4",
sum = "h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=",
version = "v0.5.5",
)

go_repository(
Expand Down Expand Up @@ -653,8 +653,8 @@ go_repository(
go_repository(
name = "com_github_grpc_ecosystem_go_grpc_middleware",
importpath = "github.com/grpc-ecosystem/go-grpc-middleware",
sum = "h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg=",
version = "v1.1.0",
sum = "h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=",
version = "v1.3.0",
)

go_repository(
Expand Down Expand Up @@ -877,8 +877,8 @@ go_repository(
go_repository(
name = "com_github_kisielk_errcheck",
importpath = "github.com/kisielk/errcheck",
sum = "h1:ZqfnKyx9KGpRcW04j5nnPDgRgoXUeLh2YFBeFzphcA0=",
version = "v1.1.0",
sum = "h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=",
version = "v1.5.0",
)

go_repository(
Expand Down Expand Up @@ -1619,22 +1619,22 @@ go_repository(
go_repository(
name = "org_golang_google_genproto",
importpath = "google.golang.org/genproto",
sum = "h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4=",
version = "v0.0.0-20191108220845-16a3f7862a1a",
sum = "h1:0pBp6vCQyvmttnWa4c74n/y2U7bAQeIUVyVvZpb7Fyo=",
version = "v0.0.0-20210505142820-a42aa055cf76",
)

go_repository(
name = "org_golang_google_grpc",
importpath = "google.golang.org/grpc",
sum = "h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4=",
version = "v1.29.1",
sum = "h1:uSZWeQJX5j11bIQ4AJoj+McDBo29cY1MCoC1wO3ts+c=",
version = "v1.37.0",
)

go_repository(
name = "org_golang_google_protobuf",
importpath = "google.golang.org/protobuf",
sum = "h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=",
version = "v1.23.0",
sum = "h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=",
version = "v1.26.0",
)

go_repository(
Expand All @@ -1661,8 +1661,8 @@ go_repository(
go_repository(
name = "org_golang_x_lint",
importpath = "golang.org/x/lint",
sum = "h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=",
version = "v0.0.0-20190930215403-16217165b5de",
sum = "h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI=",
version = "v0.0.0-20201208152925-83fdc39ff7b5",
)

go_repository(
Expand All @@ -1675,15 +1675,15 @@ go_repository(
go_repository(
name = "org_golang_x_mod",
importpath = "golang.org/x/mod",
sum = "h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=",
version = "v0.1.1-0.20191105210325-c90efee705ee",
sum = "h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=",
version = "v0.3.0",
)

go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:0PC75Fz/kyMGhL0e1QnypqK2kQMqKt9csD1GnMJR+Zk=",
version = "v0.0.0-20210423184538-5f58ad60dda6",
sum = "h1:Ugb8sMTWuWRC3+sz5WeN/4kejDx9BvIwnPUiJBjJE+8=",
version = "v0.0.0-20210505024714-0287a6fb4125",
)

go_repository(
Expand All @@ -1696,15 +1696,15 @@ go_repository(
go_repository(
name = "org_golang_x_sync",
importpath = "golang.org/x/sync",
sum = "h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o=",
version = "v0.0.0-20200317015054-43a5402ce75a",
sum = "h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=",
version = "v0.0.0-20201020160332-67f06af15bc9",
)

go_repository(
name = "org_golang_x_sys",
importpath = "golang.org/x/sys",
sum = "h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=",
version = "v0.0.0-20210423082822-04245dca01da",
sum = "h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c=",
version = "v0.0.0-20210503173754-0981d6026fa6",
)

go_repository(
Expand All @@ -1724,8 +1724,8 @@ go_repository(
go_repository(
name = "org_golang_x_tools",
importpath = "golang.org/x/tools",
sum = "h1:rjUrONFu4kLchcZTfp3/96bR8bW8dIa8uz3cR5n0cgM=",
version = "v0.0.0-20200114235610-7ae403b6b589",
sum = "h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=",
version = "v0.1.0",
)

go_repository(
Expand Down Expand Up @@ -1937,3 +1937,10 @@ go_repository(
sum = "h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=",
version = "v0.0.0-20201126162022-7de9c90e9dd1",
)

go_repository(
name = "com_github_yuin_goldmark",
importpath = "github.com/yuin/goldmark",
sum = "h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM=",
version = "v1.2.1",
)
1 change: 0 additions & 1 deletion applications/buffer/src/adapters/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ go_library(
deps = [
"//applications/buffer/src/domain/file:go_default_library",
"//applications/eva/proto:v1_go_proto",
"//libraries/user:go_default_library",
"@com_github_aws_aws_sdk_go//aws:go_default_library",
"@com_github_aws_aws_sdk_go//aws/session:go_default_library",
"@com_github_aws_aws_sdk_go//service/s3:go_default_library",
Expand Down
1 change: 0 additions & 1 deletion applications/buffer/src/ports/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//applications/buffer/src/app:go_default_library",
"//libraries/middleware:go_default_library",
"@com_github_bmizerany_pat//:go_default_library",
"@com_github_tus_tusd//pkg/handler:go_default_library",
],
Expand Down
2 changes: 0 additions & 2 deletions applications/eva/src/adapters/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go_library(
name = "go_default_library",
srcs = [
"cookie_cassandra_repository.go",
"session_redis_repository.go",
"user_cassandra_repository.go",
],
importpath = "overdoll/applications/eva/src/adapters",
Expand All @@ -13,7 +12,6 @@ go_library(
"//applications/eva/src/domain/cookie:go_default_library",
"//applications/eva/src/domain/user:go_default_library",
"@com_github_gocql_gocql//:go_default_library",
"@com_github_gomodule_redigo//redis:go_default_library",
"@com_github_scylladb_gocqlx_v2//:go_default_library",
"@com_github_scylladb_gocqlx_v2//qb:go_default_library",
],
Expand Down
3 changes: 1 addition & 2 deletions applications/eva/src/app/command/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ go_library(
"logout.go",
"redeem_cookie.go",
"register.go",
"validate_session.go",
],
importpath = "overdoll/applications/eva/src/app/command",
visibility = ["//visibility:public"],
Expand All @@ -19,7 +18,7 @@ go_library(
"//libraries/cookies:go_default_library",
"//libraries/helpers:go_default_library",
"//libraries/ksuid:go_default_library",
"//libraries/user:go_default_library",
"//libraries/passport:go_default_library",
],
)

Expand Down
8 changes: 8 additions & 0 deletions applications/eva/src/app/command/redeem_cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"overdoll/applications/eva/src/domain/user"
"overdoll/libraries/cookies"
"overdoll/libraries/helpers"
"overdoll/libraries/passport"
)

type RedeemCookieHandler struct {
Expand All @@ -23,6 +24,13 @@ func NewRedeemCookieHandler(cr cookie.Repository, ur user.Repository) RedeemCook

func (h RedeemCookieHandler) Handle(ctx context.Context, id string) (*cookie.Cookie, error) {

pass := passport.FromContext(ctx)

// User is logged in
if pass.IsAuthenticated() {
return nil, errors.New("user is logged in")
}

// RedeemCookie - this is when the user uses the redeemed cookie. This will
// occur when the user uses the redeemed cookie in the same browser that has the 'otp-cookie' cookie

Expand Down
1 change: 0 additions & 1 deletion applications/eva/src/app/command/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func NewRegisterHandler(cr cookie.Repository, ur user.Repository) RegisterHandle
func (h RegisterHandler) Handle(ctx context.Context, username string) (bool, error) {
pass := passport.FromContext(ctx)


if pass.IsAuthenticated() {
return false, errors.New("user currently logged in")
}
Expand Down
1 change: 0 additions & 1 deletion applications/eva/src/service/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ go_library(
"//applications/eva/src/app/command:go_default_library",
"//applications/eva/src/app/query:go_default_library",
"//libraries/bootstrap:go_default_library",
"@com_github_gomodule_redigo//redis:go_default_library",
],
)

Expand Down
4 changes: 2 additions & 2 deletions applications/eva/src/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ func NewComponentTestApplication(ctx context.Context) app.Application {

func createApplication(ctx context.Context) app.Application {

init, err := bootstrap.NewBootstrap(ctx)
_, err := bootstrap.NewBootstrap(ctx)

if err != nil {
log.Fatalf("bootstrap failed with errors: %s", err)
}

session, err := init.InitializeDatabaseSession()
session, err := bootstrap.InitializeDatabaseSession()

if err != nil {
log.Fatalf("database session failed with errors: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion applications/sting/src/adapters/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ go_library(
"//applications/eva/proto:v1_go_proto",
"//applications/sting/proto:v1_go_proto",
"//applications/sting/src/domain/post:go_default_library",
"//libraries/elasticsearch:go_default_library",
"//libraries/ksuid:go_default_library",
"//libraries/search:go_default_library",
"//libraries/user:go_default_library",
"@com_github_aws_aws_sdk_go//aws:go_default_library",
"@com_github_aws_aws_sdk_go//aws/session:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"overdoll/applications/sting/src/domain/post"
"overdoll/libraries/search"
"overdoll/libraries/elasticsearch"
)

type PostDocument struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestNewPendingPost_in_review(t *testing.T) {
handler := command.NewNewPostHandler(postMock, &adapters.PostIndexMock{}, &adapters.ContentMock{
NewContent: newContent,
}, &adapters.EvaServiceMock{
User: common.NewUser(
User: user.NewUser(
"some-random-id",
"actual-user",
"",
Expand Down
16 changes: 8 additions & 8 deletions applications/sting/src/domain/post/post_pending.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"time"

"overdoll/libraries/user"
"overdoll/libraries/ksuid"
"overdoll/libraries/user"
)

type PostPendingState string
Expand Down Expand Up @@ -46,7 +46,7 @@ type PostPending struct {
characters []*Character
categories []*Category

contributor *common.User
contributor *user.User

artist *Artist

Expand All @@ -59,7 +59,7 @@ type PostPending struct {
generatedIds []string
}

func NewPendingPost(id string, artist *Artist, contributor *common.User, content []string, characters []*Character, categories []*Category) (*PostPending, error) {
func NewPendingPost(id string, artist *Artist, contributor *user.User, content []string, characters []*Character, categories []*Category) (*PostPending, error) {
return &PostPending{
id: id,
state: Publishing,
Expand All @@ -78,7 +78,7 @@ func UnmarshalPendingPostFromDatabase(id string, state string, artist *Artist, c
id: id,
state: PostPendingState(state),
artist: artist,
contributor: &common.User{Id: contributorId},
contributor: user.NewUser(contributorId, "", "", nil, false),
content: content,
characters: characters,
categories: categories,
Expand All @@ -103,7 +103,7 @@ func (p *PostPending) Artist() *Artist {
return p.artist
}

func (p *PostPending) Contributor() *common.User {
func (p *PostPending) Contributor() *user.User {
return p.contributor
}

Expand All @@ -124,7 +124,7 @@ func (p *PostPending) Content() []string {
}

// generate the proper content url
generatedContent = append(generatedContent, baseUrl+"/"+p.Contributor().Id+"/"+image)
generatedContent = append(generatedContent, baseUrl+"/"+p.Contributor().ID()+"/"+image)
}

return generatedContent
Expand All @@ -144,7 +144,7 @@ func (p *PostPending) UpdateArtist(artist *Artist) {
p.artist = artist
}

func (p *PostPending) UpdateContributor(contributor *common.User) {
func (p *PostPending) UpdateContributor(contributor *user.User) {
p.contributor = contributor
}

Expand Down Expand Up @@ -204,7 +204,7 @@ func (p *PostPending) MakePublishing() {

func (p *PostPending) MakePublicOrReview() error {

if !p.contributor.Verified {
if !p.contributor.IsVerified() {
p.state = Review
}

Expand Down

0 comments on commit f30530a

Please sign in to comment.