Ich wollte Verschlüsselung verwenden, um Benutzerdaten in Grails 2.5.4 Anwendung zu verschlüsseln. Ich folgte den Anweisungen zum Herunterladen der Konfiguration der Version 1.3.1 des Plugins.Jasypt verschlüsselt nicht in Grails 2.5.4
Meine Java-Sicherheits-JCE-Dateien in JDK 1.8 wurden aktualisiert (sowohl in JDK-JRE- als auch in Standalone-JRE-Verzeichnissen).
Ich habe hier einige Beiträge gefunden, die ähnlich waren und die Fixes wie die Kleinschreibung in ConfigFIlePath angewendet haben.
def configFilePath = System.getenv('ENCRYPTION_CONFIG_LOCATION') ?: "file:${userHome}"
configFilePath += "/.jasypt.groovy"
grails.config.locations = [configFilePath]
ich auch mit der Konfiguration innerhalb des Objekts
jasypt {
algorithm = "PBEWITHSHA256AND256BITAES-CBC-BC"
providerName = "BC"
password = "test"
keyObtentionIterations = 1000
}
Config.groovy versucht
Meine Domain ist wie folgt definiert:
Egalpackage com.xyz
import java.util.Date;
import com.bloomhealthco.jasypt.*
class UserProfile {
String firstName
String lastName
Date dateOfBirth
// USATT membership information
long usattID
Date expirationDate
// contact information
String email
String phone
String streetAddress
String city
String state
String zipCode
String country
String gender
String club
// no reference to SecUser
static belongsTo = SecUser
static hasMany = [tournamentEntries: TournamentEntry]
static constraints = {
firstName blank: false, maxSize: 384, type: GormEncryptedStringType
lastName blank: false, maxSize: 384, type: GormEncryptedStringType
dateOfBirth blank: false
gender blank: false, type: GormEncryptedStringType
email blank: false, maxSize: 384, type: GormEncryptedStringType
phone blank: false, maxSize: 384, type: GormEncryptedStringType
streetAddress blank: false, maxSize: 384, type: GormEncryptedStringType
city blank: false, maxSize: 384, type: GormEncryptedStringType
state blank: false, type: GormEncryptedStringType
zipCode blank: false, type: GormEncryptedStringType
country blank: false, maxSize: 384, type: GormEncryptedStringType
expirationDate nullable: true
}
}
was ich die Daten in meiner Domain Objekt versuchen wird nicht verschlüsselt, soweit ich das beurteilen kann, indem ich es über die Grails-dbconsole-Anwendung anschaue.
Ich habe die Debugprotokollierung aktiviert, sehe aber keine Protokolle von jasept.