File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,16 @@ export class Client {
146146 . map ( scope => scope . split ( ':' ) [ 0 ] as TokenPermission )
147147 }
148148
149+ /**
150+ * Parse an object URL for its federation and namespace
151+ */
152+ async parseObjectUrl ( objectUrl : string ) : Promise < { federation : string , namespace : string } > {
153+ const { federationHostname } = parsePelicanObjectUrl ( objectUrl )
154+ const federation = await this . getFederation ( federationHostname )
155+ const namespace = await this . getNamespace ( objectUrl , federation )
156+ return { federation : federation . hostname , namespace : namespace . prefix }
157+ }
158+
149159 /**
150160 * If there is an authorization code in the URL, exchange it for a token and save it to the appropriate namespace
151161 */
You can’t perform that action at this time.
0 commit comments