~sircmpwn/sr.ht-dev

meta.sr.ht: Make User.userType @private v1 APPLIED

Simon Ser: 1
 Make User.userType @private

 3 files changed, 9 insertions(+), 9 deletions(-)
#633996 alpine.yml success
#633997 archlinux.yml success
#633998 debian.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/26781/mbox | git am -3
Learn more about email & git

[PATCH meta.sr.ht] Make User.userType @private Export this patch

This allows requests with a private token or a cookie to query this
field.
---

The url.Scheme change was made by `go generate`.

 api/graph/api/generated.go    | 8 ++++----
 api/graph/schema.graphqls     | 2 +-
 api/graph/schema.resolvers.go | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/api/graph/api/generated.go b/api/graph/api/generated.go
index 86c31d9c9953..a73ff20bb30b 100644
--- a/api/graph/api/generated.go
+++ b/api/graph/api/generated.go
@@ -1593,7 +1593,7 @@ type User implements Entity {
  location: String
  bio: String

  userType: UserType! @internal
  userType: UserType! @private
  suspensionNotice: String @internal

  sshKeys(cursor: Cursor): SSHKeyCursor! @access(scope: SSH_KEYS, kind: RO)
@@ -7684,10 +7684,10 @@ func (ec *executionContext) _User_userType(ctx context.Context, field graphql.Co
			return obj.UserType(), nil
		}
		directive1 := func(ctx context.Context) (interface{}, error) {
			if ec.directives.Internal == nil {
				return nil, errors.New("directive internal is not implemented")
			if ec.directives.Private == nil {
				return nil, errors.New("directive private is not implemented")
			}
			return ec.directives.Internal(ctx, obj, directive0)
			return ec.directives.Private(ctx, obj, directive0)
		}

		tmp, err := directive1(rctx)
diff --git a/api/graph/schema.graphqls b/api/graph/schema.graphqls
index dc460c56d45e..0fedb4017fff 100644
--- a/api/graph/schema.graphqls
+++ b/api/graph/schema.graphqls
@@ -75,7 +75,7 @@ type User implements Entity {
  location: String
  bio: String

  userType: UserType! @internal
  userType: UserType! @private
  suspensionNotice: String @internal

  sshKeys(cursor: Cursor): SSHKeyCursor! @access(scope: SSH_KEYS, kind: RO)
diff --git a/api/graph/schema.resolvers.go b/api/graph/schema.resolvers.go
index df1b2bbd0ebc..b4b5e39be8f3 100644
--- a/api/graph/schema.resolvers.go
+++ b/api/graph/schema.resolvers.go
@@ -70,10 +70,10 @@ func (r *mutationResolver) UpdateUser(ctx context.Context, input map[string]inte
			WithField("url").
			And(url == nil || // Prevents nil dereference if Expect failed
				(url.Host != "" && (url.Scheme == "http" ||
				url.Scheme == "https" ||
				url.Scheme == "gopher" ||
				url.Scheme == "gemini" ||
				url.Scheme == "finger")),
					url.Scheme == "https" ||
					url.Scheme == "gopher" ||
					url.Scheme == "gemini" ||
					url.Scheme == "finger")),
				"URL must have a host and a permitted scheme").
			WithField("url")
	})

base-commit: d1ea088dfbc2da6dc284b8054153cbffee8aebe1
-- 
2.34.0
meta.sr.ht/patches: SUCCESS in 3m17s

[Make User.userType @private][0] from [Simon Ser][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/26781
[1]: mailto:contact@emersion.fr

✓ #633996 SUCCESS meta.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/633996
✓ #633998 SUCCESS meta.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/633998
✓ #633997 SUCCESS meta.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/633997
Thanks!

To git@git.sr.ht:~sircmpwn/meta.sr.ht
   d1ea088..cd0ef90  master -> master