~netlandish/gobwebs-oauth2

5748a84d4eacad7299cc477954cb1f69df2d094b — Peter Sanchez 5 days ago ef9d7f9 master v0.2.0
gobwebs bump and udating for placeholder updates
5 files changed, 16 insertions(+), 14 deletions(-)

M authorizations.go
M clients.go
M go.mod
M go.sum
M grants.go
M authorizations.go => authorizations.go +4 -4
@@ 21,7 21,7 @@ func GetAuthorizations(ctx context.Context, opts *database.FilterOptions) ([]*Au
		rows, err := q.
			Columns("id", "code", "payload", "created_on").
			From("oauth2_authorizations").
			PlaceholderFormat(sq.Dollar).
			PlaceholderFormat(database.GetPlaceholderFormat()).
			RunWith(tx).
			QueryContext(ctx)
		if err != nil {


@@ 56,7 56,7 @@ func (a *Authorization) Store(ctx context.Context) error {
				Columns("code", "payload").
				Values(a.Code, a.Payload).
				Suffix(`RETURNING (id)`).
				PlaceholderFormat(sq.Dollar).
				PlaceholderFormat(database.GetPlaceholderFormat()).
				RunWith(tx).
				ScanContext(ctx, &a.ID)
		} else {


@@ 66,7 66,7 @@ func (a *Authorization) Store(ctx context.Context) error {
				Set("payload", a.Payload).
				Where("id = ?", a.ID).
				Suffix(`RETURNING (id)`).
				PlaceholderFormat(sq.Dollar).
				PlaceholderFormat(database.GetPlaceholderFormat()).
				RunWith(tx).
				ScanContext(ctx, &a.ID)
		}


@@ 84,7 84,7 @@ func (a *Authorization) Delete(ctx context.Context) error {
		_, err := sq.
			Delete("oauth2_authorizations").
			Where("id = ?", a.ID).
			PlaceholderFormat(sq.Dollar).
			PlaceholderFormat(database.GetPlaceholderFormat()).
			RunWith(tx).
			ExecContext(ctx)
		return err

M clients.go => clients.go +5 -5
@@ 28,7 28,7 @@ func GetClients(ctx context.Context, opts *database.FilterOptions) ([]*Client, e
				"secret_hash", "secret_partial", "redirect_url", "client_url",
				"revoked", "created_on", "updated_on").
			From("oauth2_clients").
			PlaceholderFormat(sq.Dollar).
			PlaceholderFormat(database.GetPlaceholderFormat()).
			RunWith(tx).
			QueryContext(ctx)
		if err != nil {


@@ 84,7 84,7 @@ func (c *Client) Store(ctx context.Context) error {
					c.SecretHash, c.SecretPartial, c.RedirectURL, c.ClientURL,
					c.Revoked).
				Suffix(`RETURNING id, created_on, updated_on`).
				PlaceholderFormat(sq.Dollar).
				PlaceholderFormat(database.GetPlaceholderFormat()).
				RunWith(tx).
				ScanContext(ctx, &c.ID, &c.CreatedOn, &c.UpdatedOn)
		} else {


@@ 101,7 101,7 @@ func (c *Client) Store(ctx context.Context) error {
				Set("revoked", c.Revoked).
				Where("id = ?", c.ID).
				Suffix(`RETURNING (updated_on)`).
				PlaceholderFormat(sq.Dollar).
				PlaceholderFormat(database.GetPlaceholderFormat()).
				RunWith(tx).
				ScanContext(ctx, &c.UpdatedOn)
		}


@@ 157,7 157,7 @@ func (c *Client) Revoke(ctx context.Context) error {
			Set("revoked", c.Revoked).
			Where("id = ?", c.ID).
			Suffix(`RETURNING (updated_on)`).
			PlaceholderFormat(sq.Dollar).
			PlaceholderFormat(database.GetPlaceholderFormat()).
			RunWith(tx).
			ScanContext(ctx, &c.UpdatedOn)
		if err != nil {


@@ 183,7 183,7 @@ func (c *Client) Delete(ctx context.Context) error {
		_, err := sq.
			Delete("oauth2_clients").
			Where("id = ?", c.ID).
			PlaceholderFormat(sq.Dollar).
			PlaceholderFormat(database.GetPlaceholderFormat()).
			RunWith(tx).
			ExecContext(ctx)
		return err

M go.mod => go.mod +1 -1
@@ 8,7 8,7 @@ require (
	github.com/labstack/echo/v4 v4.13.3
	github.com/segmentio/ksuid v1.0.4
	golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
	netlandish.com/x/gobwebs v0.1.1
	netlandish.com/x/gobwebs v0.1.2
)

require (

M go.sum => go.sum +2 -0
@@ 626,6 626,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
netlandish.com/x/gobwebs v0.1.1 h1:7j9CbtvvVZFihd1M0uABC30EF/4xSctARJX5js8YORU=
netlandish.com/x/gobwebs v0.1.1/go.mod h1:RAf0VNiujzXen/pu0k6yyhvPWMgCY9tKD7ftXrkT53E=
netlandish.com/x/gobwebs v0.1.2 h1:ppNJhHQ4qCDO3adVwE4XVA1U+wl2dLdZXxQ0+sbJZrg=
netlandish.com/x/gobwebs v0.1.2/go.mod h1:RAf0VNiujzXen/pu0k6yyhvPWMgCY9tKD7ftXrkT53E=
petersanchez.com/x/carrier v0.2.3 h1:6ScWG2HVFqeqafQp2D9kChNdXYkou4rduzppc3SDYMg=
petersanchez.com/x/carrier v0.2.3/go.mod h1:GLiDI9OThDmruufk/VHlR6Ihvq/hIJQyA5beU6AFNYk=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=

M grants.go => grants.go +4 -4
@@ 23,7 23,7 @@ func GetGrants(ctx context.Context, opts *database.FilterOptions) ([]*Grant, err
				"g.refresh_token_hash", "g.user_id", "g.client_id", "c.name").
			From("oauth2_grants g").
			LeftJoin("oauth2_clients c ON c.id = g.client_id").
			PlaceholderFormat(sq.Dollar).
			PlaceholderFormat(database.GetPlaceholderFormat()).
			RunWith(tx).
			QueryContext(ctx)
		if err != nil {


@@ 61,7 61,7 @@ func (g *Grant) Store(ctx context.Context) error {
				Values(g.Issued, g.Expires, g.Comment, g.Grants, g.TokenHash, g.RefreshTokenHash,
					g.UserID, g.ClientID).
				Suffix(`RETURNING (id)`).
				PlaceholderFormat(sq.Dollar).
				PlaceholderFormat(database.GetPlaceholderFormat()).
				RunWith(tx).
				ScanContext(ctx, &g.ID)
		} else {


@@ 77,7 77,7 @@ func (g *Grant) Store(ctx context.Context) error {
				Set("client_id", g.ClientID).
				Where("id = ?", g.ID).
				Suffix(`RETURNING (id)`).
				PlaceholderFormat(sq.Dollar).
				PlaceholderFormat(database.GetPlaceholderFormat()).
				RunWith(tx).
				ScanContext(ctx, &g.ID)
		}


@@ 106,7 106,7 @@ func (g *Grant) Delete(ctx context.Context) error {
		_, err := sq.
			Delete("oauth2_grants").
			Where("id = ?", g.ID).
			PlaceholderFormat(sq.Dollar).
			PlaceholderFormat(database.GetPlaceholderFormat()).
			RunWith(tx).
			ExecContext(ctx)
		return err

Do not follow this link