Skip to content

Commit

Permalink
Update Policy struct in NanoTDF.swift
Browse files Browse the repository at this point in the history
The Policy struct in the NanoTDF.swift file has been modified. The internal 'PolicyType' enum has been made public to increase its accessibility. Additionally, a public initializer has been introduced to streamline the creation of Policy instances.
  • Loading branch information
arkavo-com committed Jul 3, 2024
1 parent ce75256 commit b1f2bf5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion OpenTDFKit/NanoTDF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public struct ResourceLocator {
}

public struct Policy {
enum PolicyType: UInt8 {
public enum PolicyType: UInt8 {
case remote = 0x00
case embeddedPlaintext = 0x01
case embeddedEncrypted = 0x02
Expand All @@ -180,6 +180,13 @@ public struct Policy {
let body: EmbeddedPolicyBody?
let remote: ResourceLocator?
var binding: Data?

public init(type: PolicyType, body: EmbeddedPolicyBody?, remote: ResourceLocator?, binding: Data? = nil) {
self.type = type
self.body = body
self.remote = remote
self.binding = binding
}

func toData() -> Data {
var data = Data()
Expand Down

0 comments on commit b1f2bf5

Please sign in to comment.