@@ -112,9 +112,9 @@ MysqlStore.connect = function mysqlConnect(options) {
112112
113113const QUERY_CLIENT_REGISTER =
114114 'INSERT INTO clients ' +
115- '(id, name, imageUri, secret , redirectUri, termsUri, privacyUri, ' +
116- ' whitelisted, trusted, canGrant) ' +
117- 'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ? );' ;
115+ '(id, name, imageUri, hashedSecret , redirectUri, termsUri, privacyUri, ' +
116+ ' trusted, canGrant) ' +
117+ 'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);' ;
118118const QUERY_CLIENT_DEVELOPER_INSERT =
119119 'INSERT INTO clientDevelopers ' +
120120 '(rowId, developerId, clientId) ' +
@@ -135,17 +135,17 @@ const QUERY_DEVELOPER_INSERT =
135135 'VALUES (?, ?);' ;
136136const QUERY_CLIENT_GET = 'SELECT * FROM clients WHERE id=?' ;
137137const QUERY_CLIENT_LIST = 'SELECT id, name, redirectUri, imageUri, ' +
138- 'termsUri, privacyUri, canGrant, whitelisted, trusted ' +
138+ 'termsUri, privacyUri, canGrant, trusted ' +
139139 'FROM clients, clientDevelopers, developers ' +
140140 'WHERE clients.id = clientDevelopers.clientId AND ' +
141141 'developers.developerId = clientDevelopers.developerId AND ' +
142142 'developers.email =?;' ;
143143const QUERY_CLIENT_UPDATE = 'UPDATE clients SET ' +
144144 'name=COALESCE(?, name), imageUri=COALESCE(?, imageUri), ' +
145- 'secret=COALESCE(?, secret), redirectUri=COALESCE(?, redirectUri), ' +
145+ 'hashedSecret=COALESCE(?, hashedSecret), ' +
146+ 'redirectUri=COALESCE(?, redirectUri), ' +
146147 'termsUri=COALESCE(?, termsUri), privacyUri=COALESCE(?, privacyUri), ' +
147- 'whitelisted=COALESCE(?, whitelisted), trusted=COALESCE(?, trusted), ' +
148- 'canGrant=COALESCE(?, canGrant) ' +
148+ 'trusted=COALESCE(?, trusted), canGrant=COALESCE(?, canGrant) ' +
149149 'WHERE id=?' ;
150150const QUERY_CLIENT_DELETE = 'DELETE FROM clients WHERE id=?' ;
151151const QUERY_CODE_INSERT =
@@ -215,8 +215,7 @@ MysqlStore.prototype = {
215215 client . redirectUri ,
216216 client . termsUri || '' ,
217217 client . privacyUri || '' ,
218- ! ! client . trusted , // XXX TODO: we have duplicate columns while we're
219- ! ! client . trusted , // in the process of renaming whitelisted=>trusted.
218+ ! ! client . trusted ,
220219 ! ! client . canGrant
221220 ] ) . then ( function ( ) {
222221 logger . debug ( 'registerClient.success' , { id : hex ( id ) } ) ;
@@ -299,7 +298,7 @@ MysqlStore.prototype = {
299298 if ( ! client . id ) {
300299 return P . reject ( new Error ( 'Update client needs an id' ) ) ;
301300 }
302- var secret = client . hashedSecret || client . secret || null ;
301+ var secret = client . hashedSecret ;
303302 if ( secret ) {
304303 secret = buf ( secret ) ;
305304 }
@@ -311,8 +310,7 @@ MysqlStore.prototype = {
311310 client . redirectUri ,
312311 client . termsUri ,
313312 client . privacyUri ,
314- client . trusted , // XXX TODO: we have duplicate columns while we're
315- client . trusted , // in the process of renaming whitelisted => trusted.
313+ client . trusted ,
316314 client . canGrant ,
317315
318316 // WHERE
0 commit comments