@@ -26,18 +26,24 @@
|
||||
INSERT INTO cb_agent_bearer_key (
|
||||
key_id, user_id, key_prefix, key_hash, expires_at, revoked_at, description
|
||||
) VALUES (
|
||||
#{keyId}, #{userId}, #{keyPrefix}, #{keyHash}, #{expiresAt}, #{revokedAt}, #{description}
|
||||
#{keyId,jdbcType=NUMERIC},
|
||||
#{userId,jdbcType=NUMERIC},
|
||||
#{keyPrefix,jdbcType=VARCHAR},
|
||||
#{keyHash,jdbcType=VARCHAR},
|
||||
#{expiresAt,jdbcType=TIMESTAMP},
|
||||
#{revokedAt,jdbcType=TIMESTAMP},
|
||||
#{description,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="revokeToken">
|
||||
UPDATE cb_agent_bearer_key
|
||||
SET revoked_at = #{revokedAt},
|
||||
SET revoked_at = #{revokedAt,jdbcType=TIMESTAMP},
|
||||
description = CASE
|
||||
WHEN #{reason} IS NULL THEN description
|
||||
ELSE SUBSTR(COALESCE(description, '') || ' revoked: ' || #{reason}, 1, 200)
|
||||
WHEN #{reason,jdbcType=VARCHAR} IS NULL THEN description
|
||||
ELSE SUBSTR(COALESCE(description, '') || ' revoked: ' || #{reason,jdbcType=VARCHAR}, 1, 200)
|
||||
END
|
||||
WHERE key_id = #{keyId}
|
||||
WHERE key_id = #{keyId,jdbcType=NUMERIC}
|
||||
AND revoked_at IS NULL
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user