Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signed reference expiration time is measured in seconds since epoch #107

Closed
jboynes opened this issue Jun 10, 2015 · 6 comments
Closed

Signed reference expiration time is measured in seconds since epoch #107

jboynes opened this issue Jun 10, 2015 · 6 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@jboynes
Copy link

jboynes commented Jun 10, 2015

Java measures time in milliseconds from the epoch not seconds and using this as a base would be simpler. The example:

      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.DATE, 1);
      long expiration = cal.getTimeInMillis() / 1000;
      storage.signUrl(blobInfo, expiration));

would become:

      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.DATE, 1);
      storage.signUrl(blobInfo, cal.getTime()));

However, given this is actually just performing an interval calculation we could also support:

    storage.signUrl(blobInfo, 1, TimeUnit.DAYS);

Ideally we would also support the time classes added in Java 8:

    storage.signUrl(blobInfo, Instant.now().plus(24, ChronoUnit.HOURS));
    storage.signUrl(blobInfo, Duration.ofDays(1));
@jgeewax
Copy link

jgeewax commented Jun 10, 2015

Bit +1 to the Duration.ofDays(1) syntax :)

@jgeewax jgeewax added the api: storage Issues related to the Cloud Storage API. label Jun 10, 2015
@aozarov
Copy link
Contributor

aozarov commented Jun 10, 2015

It is in second because this is the granularity that the underlying service supports and I was hesitant to give the impression that we support something finer (even though I completely agree that for Java millis is more natural).

Indeed Java 8 gives us much better options but do we want to change it until then?

I considered TimeUnit but found it a bit strange to use because of its association to util.concurrent.

Another option could be to use/pass java.util.Date.

@eamonnmcmanus
Copy link

If we are happy to target only Java 8 then Duration is perfect. If we want to support pre-Java 8, including Android, then I think TimeUnit is the way to go. Though it happens to be in java.util.concurrent for historical reasons, that doesn't stop other APIs like java.nio and even javax.swing from using it. Leaving a raw number seems problematic; I'm sure we've all seen bugs, sometimes long-standing bugs, due to people accidentally using the wrong units.

@mziccard
Copy link
Contributor

I am in favour of using TimeUnit and support:

storage.signUrl(blobInfo, 1, TimeUnit.DAYS);

Should we drop the support for storage.signUrl(blobInfo, expiration)? There still might be some use cases for that even though I think we should just drop it.

@aozarov
Copy link
Contributor

aozarov commented Oct 12, 2015

Go ahead and send a PR for it (also javadoc will not get get updated, though code snippets becomes
even less useful in my mind).

Yes, I think we should add it instead rather than keeping them both.

@aozarov
Copy link
Contributor

aozarov commented Oct 13, 2015

Fixed by #243

@aozarov aozarov closed this as completed Oct 13, 2015
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
github-actions bot pushed a commit that referenced this issue Jun 23, 2022
🤖 I have created a release *beep* *boop*
---


## [1.1.1](googleapis/java-ids@v1.1.0...v1.1.1) (2022-06-23)


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#105](googleapis/java-ids#105)) ([1cc04f2](googleapis/java-ids@1cc04f2))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this issue Jun 29, 2022
)

* chore: update dependencies for regapic

* add more dependencies and trigger comment

* update goldens

* fix indentation

* remove duplicate gax-httpjson dependency

* remove duplicated dependencies
Source-Link: googleapis/synthtool@fa54eb2
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:1ec28a46062b19135b11178ceee60231e5f5a92dab454e23ae0aab72cd875906
github-actions bot pushed a commit that referenced this issue Aug 9, 2022
🤖 I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit that referenced this issue Sep 15, 2022
…cies to v3.0.2 (#107)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.1` -> `3.0.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/compatibility-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/confidence-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-shared-dependencies</summary>

### [`v3.0.2`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#&#8203;302-httpsgithubcomgoogleapisjava-shared-dependenciescomparev301v302-2022-09-08)

[Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.1...v3.0.2)

##### Dependencies

-   Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4 ([#&#8203;789](https://togithub.com/googleapis/java-shared-dependencies/issues/789)) ([6cf91a9](https://togithub.com/googleapis/java-shared-dependencies/commit/6cf91a96b9ea6af0fb845b50582dac7aa2892cab))
-   Update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#&#8203;781](https://togithub.com/googleapis/java-shared-dependencies/issues/781)) ([8859e61](https://togithub.com/googleapis/java-shared-dependencies/commit/8859e61808bfc5cd9546e27e945fc855b36d2554))
-   Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#&#8203;790](https://togithub.com/googleapis/java-shared-dependencies/issues/790)) ([3431a47](https://togithub.com/googleapis/java-shared-dependencies/commit/3431a471cbf874a67a4f1a42e31f0ed891dedc92))
-   Update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#&#8203;773](https://togithub.com/googleapis/java-shared-dependencies/issues/773)) ([27fc79f](https://togithub.com/googleapis/java-shared-dependencies/commit/27fc79f00ee70011df6a368bb8fcfad7f0ce41f0))
-   Update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#&#8203;776](https://togithub.com/googleapis/java-shared-dependencies/issues/776)) ([bf333b8](https://togithub.com/googleapis/java-shared-dependencies/commit/bf333b8c88072d21cb959db4d3328bbb55d9ef5c))
-   Update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#&#8203;780](https://togithub.com/googleapis/java-shared-dependencies/issues/780)) ([da7f44d](https://togithub.com/googleapis/java-shared-dependencies/commit/da7f44d71d6d7f372b5313dab68ce220308614d4))
-   Update dependency io.grpc:grpc-bom to v1.48.1 ([#&#8203;768](https://togithub.com/googleapis/java-shared-dependencies/issues/768)) ([5c7768d](https://togithub.com/googleapis/java-shared-dependencies/commit/5c7768d3c9665dd356de6c39c0a6a5fa6e992f2e))
-   Update dependency io.grpc:grpc-bom to v1.49.0 ([#&#8203;786](https://togithub.com/googleapis/java-shared-dependencies/issues/786)) ([8734812](https://togithub.com/googleapis/java-shared-dependencies/commit/8734812f1b4e2faaa48caf41eff59a85892ae344))
-   Update dependency org.checkerframework:checker-qual to v3.24.0 ([#&#8203;775](https://togithub.com/googleapis/java-shared-dependencies/issues/775)) ([df74b7b](https://togithub.com/googleapis/java-shared-dependencies/commit/df74b7b0dd5dd592523f302d9fb36adb5991cb0b))
-   Update dependency org.checkerframework:checker-qual to v3.25.0 ([#&#8203;788](https://togithub.com/googleapis/java-shared-dependencies/issues/788)) ([207035b](https://togithub.com/googleapis/java-shared-dependencies/commit/207035bd04c9305899eea540acbefaf06a7b1ec9))
-   Update dependency org.threeten:threetenbp to v1.6.1 ([#&#8203;782](https://togithub.com/googleapis/java-shared-dependencies/issues/782)) ([0f218ae](https://togithub.com/googleapis/java-shared-dependencies/commit/0f218aeb6aa33cf1da4a8b1d6c82bbf87946dab9))
-   Update gax.version to v2.19.0 ([#&#8203;785](https://togithub.com/googleapis/java-shared-dependencies/issues/785)) ([4448331](https://togithub.com/googleapis/java-shared-dependencies/commit/4448331c4c6d88ea8076260776d1d47d24aa19fa))
-   Update google.core.version to v2.8.10 ([#&#8203;787](https://togithub.com/googleapis/java-shared-dependencies/issues/787)) ([3c344d5](https://togithub.com/googleapis/java-shared-dependencies/commit/3c344d515e3b9215db5a1f8ef550d800d974e558))
-   Update google.core.version to v2.8.7 ([#&#8203;774](https://togithub.com/googleapis/java-shared-dependencies/issues/774)) ([d0cd5e8](https://togithub.com/googleapis/java-shared-dependencies/commit/d0cd5e8f6ca88787fe0dbf7f30c849cb4c4fae5e))
-   Update google.core.version to v2.8.8 ([#&#8203;777](https://togithub.com/googleapis/java-shared-dependencies/issues/777)) ([f00571c](https://togithub.com/googleapis/java-shared-dependencies/commit/f00571cd1e9f1c4e011fba4a1e1674c1d8d60200))
-   Update google.core.version to v2.8.9 ([#&#8203;784](https://togithub.com/googleapis/java-shared-dependencies/issues/784)) ([aa8e505](https://togithub.com/googleapis/java-shared-dependencies/commit/aa8e505dbb1214b2239e55d5ac83b00c167d77e4))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-optimization).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTQuMiIsInVwZGF0ZWRJblZlciI6IjMyLjE5NC4yIn0=-->
github-actions bot pushed a commit that referenced this issue Sep 15, 2022
🤖 I have created a release *beep* *boop*
---


## [1.1.9](googleapis/java-optimization@v1.1.8...v1.1.9) (2022-09-09)


### Dependencies

* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#107](googleapis/java-optimization#107)) ([538d872](googleapis/java-optimization@538d872))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit that referenced this issue Oct 4, 2022
🤖 I have created a release *beep* *boop*
---


## [1.1.3](https://togithub.com/googleapis/java-dataplex/compare/v1.1.2...v1.1.3) (2022-10-03)


### Dependencies

* Update dependency certifi to v2022.9.24 ([#105](https://togithub.com/googleapis/java-dataplex/issues/105)) ([9ec5871](https://togithub.com/googleapis/java-dataplex/commit/9ec587107037a27ebf3f641ee6fc591d8cd6a8cd))
* Update dependency charset-normalizer to v2.1.1 ([#110](https://togithub.com/googleapis/java-dataplex/issues/110)) ([aebc143](https://togithub.com/googleapis/java-dataplex/commit/aebc1435ba5b0ec9e1b38afeca7f4b3abef3682d))
* Update dependency click to v8.1.3 ([#111](https://togithub.com/googleapis/java-dataplex/issues/111)) ([a649c72](https://togithub.com/googleapis/java-dataplex/commit/a649c72a80c3043ec4b58791b8172ffc5e65f670))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#129](https://togithub.com/googleapis/java-dataplex/issues/129)) ([01e197b](https://togithub.com/googleapis/java-dataplex/commit/01e197b7ebb984eabd4cc77abde29fa70089c28c))
* Update dependency gcp-releasetool to v1.8.8 ([#106](https://togithub.com/googleapis/java-dataplex/issues/106)) ([6c7529d](https://togithub.com/googleapis/java-dataplex/commit/6c7529d2ed8c5e1e57e5686b28f8cf52ecf443b2))
* Update dependency google-api-core to v2.10.1 ([#112](https://togithub.com/googleapis/java-dataplex/issues/112)) ([83adb9a](https://togithub.com/googleapis/java-dataplex/commit/83adb9a379bd46f95277370713aa08eb3b6551d9))
* Update dependency google-auth to v2.11.1 ([#107](https://togithub.com/googleapis/java-dataplex/issues/107)) ([7857c3b](https://togithub.com/googleapis/java-dataplex/commit/7857c3be9080b0f6498f2f61b5d5eafb79fae06d))
* Update dependency google-cloud-core to v2.3.2 ([#108](https://togithub.com/googleapis/java-dataplex/issues/108)) ([2ba0594](https://togithub.com/googleapis/java-dataplex/commit/2ba059481a696983ac4b08bb9b8b31335c8f6ba9))
* Update dependency google-cloud-storage to v2.5.0 ([#113](https://togithub.com/googleapis/java-dataplex/issues/113)) ([ea11bee](https://togithub.com/googleapis/java-dataplex/commit/ea11bee7e65cd393c08b9addcb25965440fb0434))
* Update dependency google-crc32c to v1.5.0 ([#114](https://togithub.com/googleapis/java-dataplex/issues/114)) ([dd9dacb](https://togithub.com/googleapis/java-dataplex/commit/dd9dacb0ea4e70db8e0f5162fe900b9656a457df))
* Update dependency googleapis-common-protos to v1.56.4 ([#109](https://togithub.com/googleapis/java-dataplex/issues/109)) ([fed3704](https://togithub.com/googleapis/java-dataplex/commit/fed3704df12e7ec68d5e16b894f442c61a29cba6))
* Update dependency importlib-metadata to v4.12.0 ([#124](https://togithub.com/googleapis/java-dataplex/issues/124)) ([fde2280](https://togithub.com/googleapis/java-dataplex/commit/fde2280152f4376d04424536d79a9dc87ffbe176))
* Update dependency jeepney to v0.8.0 ([#125](https://togithub.com/googleapis/java-dataplex/issues/125)) ([b38a113](https://togithub.com/googleapis/java-dataplex/commit/b38a113ea529577778042bd40e1236a6e6fbbeae))
* Update dependency jinja2 to v3.1.2 ([#126](https://togithub.com/googleapis/java-dataplex/issues/126)) ([a9a5b03](https://togithub.com/googleapis/java-dataplex/commit/a9a5b036002c04c4d76f43332ecaa2b3c5d6aaec))
* Update dependency keyring to v23.9.3 ([#127](https://togithub.com/googleapis/java-dataplex/issues/127)) ([0772b45](https://togithub.com/googleapis/java-dataplex/commit/0772b4549c4e285dcea9f7551f9eeb684e2073a4))
* Update dependency markupsafe to v2.1.1 ([#115](https://togithub.com/googleapis/java-dataplex/issues/115)) ([71ecee0](https://togithub.com/googleapis/java-dataplex/commit/71ecee06bd02ad777d5f24b8f5f8f8bce7b40242))
* Update dependency protobuf to v3.20.2 ([#116](https://togithub.com/googleapis/java-dataplex/issues/116)) ([d7049a4](https://togithub.com/googleapis/java-dataplex/commit/d7049a49e141ab098f3e0b1a80b807d74a15fc96))
* Update dependency requests to v2.28.1 ([#118](https://togithub.com/googleapis/java-dataplex/issues/118)) ([3fd6dc4](https://togithub.com/googleapis/java-dataplex/commit/3fd6dc4ee3f2368149425ef43158fbd4d6796ed7))
* Update dependency zipp to v3.8.1 ([#120](https://togithub.com/googleapis/java-dataplex/issues/120)) ([2215798](https://togithub.com/googleapis/java-dataplex/commit/221579818ffe58bbcf037a61413e64164ac5fc37))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
github-actions bot pushed a commit that referenced this issue Oct 4, 2022
🤖 I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
github-actions bot pushed a commit to yoshi-code-bot/google-cloud-java that referenced this issue Oct 6, 2022
…itcher to v0.3.5 (googleapis#107)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-video-stitcher](https://togithub.com/googleapis/java-video-stitcher) | `0.3.4` -> `0.3.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-video-stitcher/0.3.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-video-stitcher/0.3.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-video-stitcher/0.3.6/compatibility-slim/0.3.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-video-stitcher/0.3.6/confidence-slim/0.3.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-video-stitcher).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMTcuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIxNy4wIn0=-->
github-actions bot pushed a commit that referenced this issue Nov 9, 2022
#107)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 485623855

Source-Link: https://togithub.com/googleapis/googleapis/commit/807125e7953e32535710924fe4bf0362ac93754d

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c4ddd6d651da69658a4762c5eafff5cd8f0e25c5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzRkZGQ2ZDY1MWRhNjk2NThhNDc2MmM1ZWFmZmY1Y2Q4ZjBlMjVjNSJ9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants