| | |
| | | * The protocol needs to be included at the beginning of the address. |
| | | */ |
| | | public static String endpoint; |
| | | public static String externalEndpoint; |
| | | |
| | | public static String accessKey; |
| | | |
| | |
| | | public void setEndpoint(String endpoint) { |
| | | OssConfiguration.endpoint = endpoint; |
| | | } |
| | | public void setExternalEndpoint(String externalEndpoint) { |
| | | OssConfiguration.externalEndpoint = externalEndpoint; |
| | | } |
| | | |
| | | public void setAccessKey(String accessKey) { |
| | | OssConfiguration.accessKey = accessKey; |
| | |
| | | @Override |
| | | public CredentialsDTO getCredentials() { |
| | | try { |
| | | AssumeRoleProvider provider = new AssumeRoleProvider(OssConfiguration.endpoint, OssConfiguration.accessKey, |
| | | AssumeRoleProvider provider = new AssumeRoleProvider(OssConfiguration.externalEndpoint, OssConfiguration.accessKey, |
| | | OssConfiguration.secretKey, Math.toIntExact(OssConfiguration.expire), |
| | | null, OssConfiguration.region, null, null, null, null); |
| | | return new CredentialsDTO(provider.fetch(), OssConfiguration.expire); |
| | |
| | | @Override |
| | | public StsCredentialsDTO getSTSCredentials() { |
| | | return StsCredentialsDTO.builder() |
| | | .endpoint(OssConfiguration.endpoint) |
| | | .endpoint(OssConfiguration.externalEndpoint) |
| | | .bucket(OssConfiguration.bucket) |
| | | .credentials(ossService.getCredentials()) |
| | | .provider(OssConfiguration.provider) |
| | |
| | | # access-key: admin |
| | | # secret-key: 12345678 |
| | | endpoint: http://dev.jxpskj.com:9000 |
| | | external-endpoint: http://dev.jxpskj.com:9000 |
| | | # endpoint: https://dev.jxpskj.com:8026 |
| | | access-key: pskj |
| | | secret-key: pskj@2021 |