TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

How can you tell if the attribute allowsCloudEncryption works?

Forums > SwiftUI

If you set the "allowsCloudEncryption" attribute on a property like the below, is there a way to be able to see that it has worked?

import Foundation
import SwiftData

@Model
class DataItem {

    var name: String = ""
    @Attribute(.allowsCloudEncryption) var password: String = ""

    init(name: String, password: String) {
        self.name = name
        self.password =  password
    }
}

When logging into the CloudKit Database Console and querying the database (in development), I see the plain text unencrypted value of the field, when I was expecting to see it in some encrypted state.

Am I seeing it unencrypted because I am myself logged into the console, so it knows it is me, and thinking it is safe to show me?

Or did it not actually work, and it has not in fact encrypted it in the first place?

   

Hacking with Swift is sponsored by String Catalog.

SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!

Localize My App

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.