Skip to content

Commit 740d7a2

Browse files
committed
Support for the new 2.x LCP Profiles (#510)
1 parent 7649378 commit 740d7a2

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file. Take a look
44

55
**Warning:** Features marked as *experimental* may change or be removed in a future release without notice. Use with caution.
66

7-
<!-- ## [Unreleased] -->
7+
## [Unreleased]
8+
9+
### Added
10+
11+
#### LCP
12+
13+
* [#509](https://github.com/readium/kotlin-toolkit/issues/509) Support for the new 2.x LCP Profiles.
14+
815

916
## [2.4.0]
1017

readium/lcp/src/main/java/org/readium/r2/lcp/license/LicenseValidation.kt

+15-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
package org.readium.r2.lcp.license
1111

12-
import java.util.*
12+
import java.util.Date
1313
import kotlin.time.Duration.Companion.seconds
1414
import kotlin.time.ExperimentalTime
1515
import kotlinx.coroutines.runBlocking
@@ -29,7 +29,20 @@ internal sealed class Either<A, B> {
2929
class Right<A, B>(val right: B) : Either<A, B>()
3030
}
3131

32-
private val supportedProfiles = listOf("http://readium.org/lcp/basic-profile", "http://readium.org/lcp/profile-1.0")
32+
private val supportedProfiles = listOf(
33+
"http://readium.org/lcp/basic-profile",
34+
"http://readium.org/lcp/profile-1.0",
35+
"http://readium.org/lcp/profile-2.0",
36+
"http://readium.org/lcp/profile-2.1",
37+
"http://readium.org/lcp/profile-2.2",
38+
"http://readium.org/lcp/profile-2.3",
39+
"http://readium.org/lcp/profile-2.4",
40+
"http://readium.org/lcp/profile-2.5",
41+
"http://readium.org/lcp/profile-2.6",
42+
"http://readium.org/lcp/profile-2.7",
43+
"http://readium.org/lcp/profile-2.8",
44+
"http://readium.org/lcp/profile-2.9"
45+
)
3346

3447
internal typealias Context = Either<LcpClient.Context, LcpException.LicenseStatus>
3548

0 commit comments

Comments
 (0)