File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ import { OFFICIAL_REGISTRY } from "../definitions/constants.js" ;
2+
3+ export default function oidcContextEstablished ( registry ) {
4+ return OFFICIAL_REGISTRY === registry ;
5+ }
Original file line number Diff line number Diff line change 1+ import test from "ava" ;
2+
3+ import { OFFICIAL_REGISTRY } from "../../lib/definitions/constants.js" ;
4+ import oidcContextEstablished from "../../lib/trusted-publishing/oidc-context.js" ;
5+
6+ test ( "that `true` is returned when a trusted-publishing context has been established with the official registry" , async ( t ) => {
7+ t . true ( await oidcContextEstablished ( OFFICIAL_REGISTRY ) ) ;
8+ } ) ;
9+
10+ test ( "that `false` is returned when a custom registry is targeted" , async ( t ) => {
11+ t . false ( await oidcContextEstablished ( "https://custom.registry.org/" ) ) ;
12+ } ) ;
You can’t perform that action at this time.
0 commit comments