$pair ="$($art_user):$($art_pass)"Write-Verbose"Attempting to convert Artifactory credentials to a base64 string for automation"$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))$basicAuthValue ="Basic $encodedCreds"$headers =@{ Authorization = $basicAuthValue}Write-Host"Attempting to perform a AQL search."$aql_search = $art_base_url +"/api/search/aql"Write-Host"Building aql query with the following parameters, groupID: $group_id, artifactID: $artifact_id, version: $version, classifier: $classifier and repos: $art_generic_repokey."$aql_query ='items.find({"repo":"'+ $art_generic_repokey +'","$or":[{"$and":[{"path":{"$match":"'+ $group_id +'/'+ $artifact_id +'/'+ $version +'"},"name":{"$match":"'+ $artifact_id +'*'+ $classifier +'*.'+ $extension +'"}}]}]}).sort({"$desc":["modified"]}).limit(1)'Write-Host"Built the following aql query: '$aql_query' ."$aql_content =Invoke-RestMethod-Uri $aql_search -Headers $headers -Method Post -Body $aql_query -ContentType 'text/plain'Write-Host"Attempting to submit the aql query to the following artifactory server: $art_base_url."$aql_results = ($aql_content).resultsWrite-Host"Attempting to parse query results and build the artifact download uri."$aql_repo,$aql_path,$aql_name = ($aql_results).repo,($aql_results).path,($aql_results).name$artifactDownloadUri = $art_base_url +'/'+ $aql_repo +'/'+ $aql_path +'/'+ $aql_nameWrite-Host"Found the following uri: $artifactDownloadUri !!"if ($artifactMimeType -eq'application/zip'-or $extension -eq'zip') {Write-Verbose"Attempting to save the artifact to $download_dir/$art_dist_name.zip"Invoke-RestMethod-Uri $artifactDownloadUri -Headers $headers -OutFile "$download_dir/$art_dist_name.zip"}
[!NOTE] if issue (i:) is the same as subject (s:). Therefore, this is the root certificat. i.e. :
$openssls_client-connectcdn.redhat.com:443-showcerts</dev/nullCertificatechain0s:C=US,ST=NorthCarolina,O="Red Hat, Inc.",OU=RedHatNetwork,CN=cdn.redhat.comi:C=US,ST=NorthCarolina,O="Red Hat, Inc.",OU=RedHatNetwork,CN=RedHatEntitlementOperationsAuthority,emailAddress=ca-support@redhat.com-----BEGINCERTIFICATE-----...-----ENDCERTIFICATE-----1s:C=US,ST=NorthCarolina,O="Red Hat, Inc.",OU=RedHatNetwork,CN=RedHatEntitlementOperationsAuthority,emailAddress=ca-support@redhat.comi:C=US,ST=NorthCarolina,L=Raleigh,O="Red Hat, Inc.",OU=RedHatNetwork,CN=EntitlementMasterCA,emailAddress=ca-support@redhat.com-----BEGINCERTIFICATE-----...-----ENDCERTIFICATE-----2s:C=US,ST=NorthCarolina,L=Raleigh,O="Red Hat, Inc.",OU=RedHatNetwork,CN=EntitlementMasterCA,emailAddress=ca-support@redhat.comi:C=US,ST=NorthCarolina,L=Raleigh,O="Red Hat, Inc.",OU=RedHatNetwork,CN=EntitlementMasterCA,emailAddress=ca-support@redhat.com-----BEGINCERTIFICATE-----...-----ENDCERTIFICATE-----
from version 7.21.1, this can be specified by setting the token.max-expiry parameter in the $JFROG_HOME/artifactory/var/etc/artifactory/access.config.yml file ( prior to version 7.21.1, the parameter to set was artifactory.access.token.non.admin.max.expires.in ).
if the token.max-expiry is equal to 0 (which is the default), there is no limitation to the token expiry. However, if the maximum expiry is greater than 0, the user cannot create a non-expirable token.
the token.max-expiry parameter must be set to a value higher than the token.default-expiry parameter value.