mirror of https://github.com/perkeep/perkeep.git
mysqlindexer: keep map of gpg public key blobref -> keyid
Change-Id: I90f40d23bdaacf30f02e1ae20f17ec7844623e51
This commit is contained in:
parent
7456d6d405
commit
1f8723d30b
|
@ -18,7 +18,7 @@ package mysqlindexer
|
|||
|
||||
import ()
|
||||
|
||||
const requiredSchemaVersion = 11
|
||||
const requiredSchemaVersion = 12
|
||||
|
||||
func SchemaVersion() int {
|
||||
return requiredSchemaVersion
|
||||
|
@ -87,5 +87,13 @@ INDEX (permanode))`,
|
|||
`CREATE TABLE meta (
|
||||
metakey VARCHAR(255) NOT NULL PRIMARY KEY,
|
||||
value VARCHAR(255) NOT NULL)`,
|
||||
|
||||
// Map from blobref (of ASCII armored public key) to keyid
|
||||
`CREATE TABLE signerkeyid (
|
||||
blobref VARCHAR(128) NOT NULL,
|
||||
PRIMARY KEY (blobref),
|
||||
keyid VARCHAR(128) NOT NULL,
|
||||
INDEX (keyid)
|
||||
)`,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,6 +196,11 @@ func (mi *Indexer) populateClaim(client *mysql.Client, blobRef *blobref.BlobRef,
|
|||
if vr.Verify() {
|
||||
verifiedKeyId = vr.SignerKeyId
|
||||
log.Printf("mysqlindex: verified claim %s from %s", blobRef, verifiedKeyId)
|
||||
|
||||
if err = execSQL(client, "INSERT IGNORE INTO signerkeyid (blobref, keyid) "+
|
||||
"VALUES (?, ?)", vr.CamliSigner.String(), verifiedKeyId); err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
log.Printf("mysqlindex: verification failure on claim %s: %v", blobRef, vr.Err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue